26 time_t_string(time_t when) {
41 GList *only_node = va_arg(args, GList *);
42 uint32_t section_opts = va_arg(args, uint32_t);
43 gboolean print_spacer = va_arg(args, gboolean);
59 out->increment_list(out);
66 PCMK__OUTPUT_ARGS(
"fencing-list",
"stonith_history_t *",
"GList *",
"uint32_t",
"gboolean")
70 GList *only_node = va_arg(args, GList *);
71 uint32_t section_opts = va_arg(args, uint32_t);
72 gboolean print_spacer = va_arg(args, gboolean);
85 out->increment_list(out);
94 "uint32_t",
"gboolean")
99 GList *only_node = va_arg(args, GList *);
100 uint32_t section_opts = va_arg(args, uint32_t);
101 gboolean print_spacer = va_arg(args, gboolean);
113 out->increment_list(out);
120 PCMK__OUTPUT_ARGS(
"full-fencing-list",
"crm_exit_t",
"stonith_history_t *",
"GList *",
121 "uint32_t",
"gboolean")
126 GList *only_node = va_arg(args, GList *);
127 uint32_t section_opts = va_arg(args, uint32_t);
128 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
132 if (history_rc == 0) {
141 out->increment_list(out);
146 char *rc_s = pcmk__itoa(history_rc);
162 const char *
target = va_arg(args,
const char *);
163 time_t when = va_arg(args, time_t);
178 const char *
target = va_arg(args,
const char *);
179 time_t when = va_arg(args, time_t);
193 const char *
target = va_arg(args,
const char *);
194 time_t when = va_arg(args, time_t);
197 char *buf = time_t_string(when);
216 GList *only_node = va_arg(args, GList *);
217 uint32_t section_opts = va_arg(args, uint32_t);
218 gboolean print_spacer = va_arg(args, gboolean);
235 out->increment_list(out);
242 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
246 gboolean full_history = va_arg(args, gboolean);
247 gboolean later_succeeded = va_arg(args, gboolean);
249 switch(event->state) {
251 char *completed_s = time_t_string(event->completed);
253 out->list_item(out,
"successful-stonith-event",
254 "%s of %s successful: delegate=%s, client=%s, origin=%s, %s='%s'",
256 event->delegate ? event->delegate :
"",
257 event->client, event->origin,
258 full_history ?
"completed" :
"last-successful",
265 char *failed_s = time_t_string(event->completed);
267 out->list_item(out,
"failed-stonith-event",
268 "%s of %s failed%s%s%s: " 269 "delegate=%s, client=%s, origin=%s, %s='%s' %s",
271 (event->exit_reason == NULL)?
"" :
" (",
272 (event->exit_reason == NULL)?
"" : event->exit_reason,
273 (event->exit_reason == NULL)?
"" :
")",
274 event->delegate ? event->delegate :
"",
275 event->client, event->origin,
276 full_history ?
"completed" :
"last-failed",
278 later_succeeded ?
"(a later attempt succeeded)" :
"");
284 out->list_item(out,
"pending-stonith-event",
285 "%s of %s pending: client=%s, origin=%s",
287 event->client, event->origin);
294 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
298 gboolean full_history = va_arg(args, gboolean);
299 gboolean later_succeeded = va_arg(args, gboolean);
301 char *buf = time_t_string(event->completed);
303 switch (event->state) {
306 "%s of %s failed%s%s%s: " 307 "delegate=%s, client=%s, origin=%s, %s='%s' %s\n",
309 (event->exit_reason == NULL)?
"" :
" (",
310 (event->exit_reason == NULL)?
"" : event->exit_reason,
311 (event->exit_reason == NULL)?
"" :
")",
312 event->delegate ? event->delegate :
"",
313 event->client, event->origin,
314 full_history ?
"completed" :
"last-failed", buf,
315 later_succeeded ?
"(a later attempt succeeded)" :
"");
321 event->delegate ? event->delegate :
"",
322 event->client, event->origin,
323 full_history ?
"completed" :
"last-successful", buf);
329 event->client, event->origin);
337 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
341 gboolean full_history G_GNUC_UNUSED = va_arg(args, gboolean);
342 gboolean later_succeeded G_GNUC_UNUSED = va_arg(args, gboolean);
347 "action", event->action,
348 "target", event->target,
349 "client", event->client,
350 "origin", event->origin,
353 switch (event->state) {
365 char *state = pcmk__itoa(event->state);
367 "extended-status", state,
374 if (event->delegate != NULL) {
379 buf = time_t_string(event->completed);
387 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
390 const char *agent = va_arg(args,
const char *);
391 const char *device = va_arg(args,
const char *);
392 char *output = va_arg(args,
char *);
393 char *error_output = va_arg(args,
char *);
394 int rc = va_arg(args,
int);
398 rc ?
"failed" :
"succeeded");
403 rc ?
"failed" :
"succeeded");
408 out->subprocess_output(out, rc, output, error_output);
412 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
415 const char *agent = va_arg(args,
const char *);
416 const char *device = va_arg(args,
const char *);
417 char *output = va_arg(args,
char *);
418 char *error_output = va_arg(args,
char *);
419 int rc = va_arg(args,
int);
423 rc ?
"failed" :
"succeeded");
426 rc ?
"failed" :
"succeeded");
429 out->subprocess_output(out, rc, output, error_output);
433 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
436 const char *agent = va_arg(args,
const char *);
437 const char *device = va_arg(args,
const char *);
438 char *output = va_arg(args,
char *);
439 char *error_output = va_arg(args,
char *);
440 int rc = va_arg(args,
int);
444 "valid", pcmk__btoa(rc),
447 if (device != NULL) {
452 out->subprocess_output(out, rc, output, error_output);
462 {
"full-fencing-list",
"xml", full_history_xml },
463 {
"last-fenced",
"html", last_fenced_html },
464 {
"last-fenced",
"log", last_fenced_text },
465 {
"last-fenced",
"text", last_fenced_text },
466 {
"last-fenced",
"xml", last_fenced_xml },
468 {
"stonith-event",
"html", stonith_event_html },
469 {
"stonith-event",
"log", stonith_event_text },
470 {
"stonith-event",
"text", stonith_event_text },
471 {
"stonith-event",
"xml", stonith_event_xml },
472 {
"validate",
"html", validate_agent_html },
473 {
"validate",
"log", validate_agent_text },
474 {
"validate",
"text", validate_agent_text },
475 {
"validate",
"xml", validate_agent_xml },
struct stonith_history_s * next
Control output from tools.
#define crm_time_log_timeofday
struct crm_time_s crm_time_t
int stonith__full_history(pcmk__output_t *out, va_list args)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
enum crm_exit_e crm_exit_t
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
PCMK__OUTPUT_ARGS("failed-fencing-list", "stonith_history_t *", "GList *", "uint32_t", "gboolean")
Formatted output for pacemaker tools.
int stonith__history(pcmk__output_t *out, va_list args)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr node)
const char * stonith_action_str(const char *action)
Turn stonith action into a more readable string.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
void crm_time_set_timet(crm_time_t *target, time_t *source)
void stonith__register_messages(pcmk__output_t *out)
gboolean stonith__later_succeeded(stonith_history_t *event, stonith_history_t *top_history)
Wrappers for and extensions to libxml2.
void pcmk__indented_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
gboolean pcmk__str_in_list(const gchar *s, GList *lst, uint32_t flags)
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
#define XML_LRM_ATTR_EXIT_REASON
#define pcmk_section_fencing_all
#define crm_time_log_with_timezone
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
char * crm_time_as_string(crm_time_t *dt, int flags)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
crm_time_t * crm_time_new(const char *string)
This structure contains everything that makes up a single output formatter.
int stonith__failed_history(pcmk__output_t *out, va_list args)
void pcmk__register_messages(pcmk__output_t *out, pcmk__message_entry_t *table)
int stonith__pending_actions(pcmk__output_t *out, va_list args)
#define crm_time_log_date
void crm_time_free(crm_time_t *dt)