23 time_t_string(time_t when) {
33 PCMK__OUTPUT_ARGS(
"failed-fencing-list",
"stonith_history_t *",
"GList *",
"gboolean",
"gboolean")
37 GList *only_node = va_arg(args, GList *);
38 gboolean full_history = va_arg(args, gboolean);
39 gboolean print_spacer = va_arg(args, gboolean);
54 out->increment_list(out);
61 PCMK__OUTPUT_ARGS(
"fencing-list",
"stonith_history_t *",
"GList *",
"gboolean",
"gboolean")
65 GList *only_node = va_arg(args, GList *);
66 gboolean full_history = va_arg(args, gboolean);
67 gboolean print_spacer = va_arg(args, gboolean);
79 out->increment_list(out);
87 PCMK__OUTPUT_ARGS(
"full-fencing-list",
"crm_exit_t",
"stonith_history_t *",
"GList *",
"gboolean",
"gboolean")
92 GList *only_node = va_arg(args, GList *);
93 gboolean full_history = va_arg(args, gboolean);
94 gboolean print_spacer = va_arg(args, gboolean);
105 out->increment_list(out);
112 PCMK__OUTPUT_ARGS(
"full-fencing-list",
"crm_exit_t",
"stonith_history_t *",
"GList *",
"gboolean",
"gboolean")
117 GList *only_node = va_arg(args, GList *);
118 gboolean full_history = va_arg(args, gboolean);
119 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
123 if (history_rc == 0) {
131 out->increment_list(out);
136 char *rc_s = pcmk__itoa(history_rc);
152 const char *
target = va_arg(args,
const char *);
153 time_t when = va_arg(args, time_t);
156 char *buf =
crm_strdup_printf(
"Node %s last fenced at: %s", target, ctime(&when));
168 const char *target = va_arg(args,
const char *);
169 time_t when = va_arg(args, time_t);
183 const char *target = va_arg(args,
const char *);
184 time_t when = va_arg(args, time_t);
187 char *buf = time_t_string(when);
201 PCMK__OUTPUT_ARGS(
"pending-fencing-list",
"stonith_history_t *",
"GList *",
"gboolean",
"gboolean")
205 GList *only_node = va_arg(args, GList *);
206 gboolean full_history = va_arg(args, gboolean);
207 gboolean print_spacer = va_arg(args, gboolean);
223 out->increment_list(out);
230 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
234 gboolean full_history = va_arg(args, gboolean);
235 gboolean later_succeeded = va_arg(args, gboolean);
237 switch(event->state) {
239 char *completed_s = time_t_string(event->completed);
241 out->list_item(out,
"successful-stonith-event",
242 "%s of %s successful: delegate=%s, client=%s, origin=%s, %s='%s'",
244 event->delegate ? event->delegate :
"",
245 event->client, event->origin,
246 full_history ?
"completed" :
"last-successful",
253 char *failed_s = time_t_string(event->completed);
255 out->list_item(out,
"failed-stonith-event",
256 "%s of %s failed : delegate=%s, client=%s, origin=%s, %s='%s' %s",
258 event->delegate ? event->delegate :
"",
259 event->client, event->origin,
260 full_history ?
"completed" :
"last-failed",
262 later_succeeded ?
"(a later attempt succeeded)" :
"");
268 out->list_item(out,
"pending-stonith-event",
269 "%s of %s pending: client=%s, origin=%s",
271 event->client, event->origin);
278 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
282 gboolean full_history = va_arg(args, gboolean);
283 gboolean later_succeeded = va_arg(args, gboolean);
285 char *buf = time_t_string(event->completed);
287 switch (event->state) {
291 event->delegate ? event->delegate :
"",
292 event->client, event->origin,
293 full_history ?
"completed" :
"last-failed", buf,
294 later_succeeded ?
"(a later attempt succeeded)" :
"");
300 event->delegate ? event->delegate :
"",
301 event->client, event->origin,
302 full_history ?
"completed" :
"last-successful", buf);
308 event->client, event->origin);
316 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
320 gboolean full_history G_GNUC_UNUSED = va_arg(args, gboolean);
321 gboolean later_succeeded G_GNUC_UNUSED = va_arg(args, gboolean);
326 "action", event->action,
327 "target", event->target,
328 "client", event->client,
329 "origin", event->origin,
332 switch (event->state) {
342 char *state = pcmk__itoa(event->state);
344 "extended-status", state,
351 if (event->delegate != NULL) {
356 buf = time_t_string(event->completed);
364 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
367 const char *agent = va_arg(args,
const char *);
368 const char *device = va_arg(args,
const char *);
369 char *output = va_arg(args,
char *);
370 char *error_output = va_arg(args,
char *);
371 int rc = va_arg(args,
int);
375 rc ?
"failed" :
"succeeded");
380 rc ?
"failed" :
"succeeded");
385 out->subprocess_output(out, rc, output, error_output);
389 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
392 const char *agent = va_arg(args,
const char *);
393 const char *device = va_arg(args,
const char *);
394 char *output = va_arg(args,
char *);
395 char *error_output = va_arg(args,
char *);
396 int rc = va_arg(args,
int);
400 rc ?
"failed" :
"succeeded");
403 rc ?
"failed" :
"succeeded");
406 out->subprocess_output(out, rc, output, error_output);
410 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
413 const char *agent = va_arg(args,
const char *);
414 const char *device = va_arg(args,
const char *);
415 char *output = va_arg(args,
char *);
416 char *error_output = va_arg(args,
char *);
417 int rc = va_arg(args,
int);
421 "valid", pcmk__btoa(rc),
424 if (device != NULL) {
429 out->subprocess_output(out, rc, output, error_output);
439 {
"full-fencing-list",
"xml", full_history_xml },
440 {
"last-fenced",
"html", last_fenced_html },
441 {
"last-fenced",
"log", last_fenced_text },
442 {
"last-fenced",
"text", last_fenced_text },
443 {
"last-fenced",
"xml", last_fenced_xml },
445 {
"stonith-event",
"html", stonith_event_html },
446 {
"stonith-event",
"log", stonith_event_text },
447 {
"stonith-event",
"text", stonith_event_text },
448 {
"stonith-event",
"xml", stonith_event_xml },
449 {
"validate",
"html", validate_agent_html },
450 {
"validate",
"log", validate_agent_text },
451 {
"validate",
"text", validate_agent_text },
452 {
"validate",
"xml", validate_agent_xml },
struct stonith_history_s * next
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...)
void stonith__register_messages(pcmk__output_t *out)
#define crm_time_log_timeofday
struct crm_time_s crm_time_t
gboolean pcmk__str_in_list(GList *lst, const gchar *s)
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.
void pcmk__xe_set_props(xmlNodePtr node,...)
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)
Formatted output for pacemaker tools.
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.
#define PCMK__OUTPUT_ARGS(ARGS...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
void crm_time_set_timet(crm_time_t *target, time_t *source)
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
#define crm_time_log_with_timezone
int stonith__history(pcmk__output_t *out, va_list args)
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
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)