24 time_t_string(time_t when) {
35 "unsigned int",
"gboolean")
39 GList *only_node = va_arg(args, GList *);
40 unsigned int section_opts = va_arg(args,
unsigned int);
41 gboolean print_spacer = va_arg(args, gboolean);
57 out->increment_list(out);
64 PCMK__OUTPUT_ARGS(
"fencing-list",
"stonith_history_t *",
"GList *",
"unsigned int",
"gboolean")
68 GList *only_node = va_arg(args, GList *);
69 unsigned int section_opts = va_arg(args,
unsigned int);
70 gboolean print_spacer = va_arg(args, gboolean);
83 out->increment_list(out);
92 "unsigned int",
"gboolean")
97 GList *only_node = va_arg(args, GList *);
98 unsigned int section_opts = va_arg(args,
unsigned int);
99 gboolean print_spacer = va_arg(args, gboolean);
111 out->increment_list(out);
118 PCMK__OUTPUT_ARGS(
"full-fencing-list",
"crm_exit_t",
"stonith_history_t *",
"GList *",
119 "unsigned int",
"gboolean")
124 GList *only_node = va_arg(args, GList *);
125 unsigned int section_opts = va_arg(args,
unsigned int);
126 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
130 if (history_rc == 0) {
139 out->increment_list(out);
144 char *rc_s = pcmk__itoa(history_rc);
160 const char *
target = va_arg(args,
const char *);
161 time_t when = va_arg(args, time_t);
176 const char *
target = va_arg(args,
const char *);
177 time_t when = va_arg(args, time_t);
191 const char *
target = va_arg(args,
const char *);
192 time_t when = va_arg(args, time_t);
195 char *buf = time_t_string(when);
210 "unsigned int",
"gboolean")
214 GList *only_node = va_arg(args, GList *);
215 unsigned int section_opts = va_arg(args,
unsigned int);
216 gboolean print_spacer = va_arg(args, gboolean);
233 out->increment_list(out);
240 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
244 gboolean full_history = va_arg(args, gboolean);
245 gboolean later_succeeded = va_arg(args, gboolean);
247 switch(event->state) {
249 char *completed_s = time_t_string(event->completed);
251 out->list_item(out,
"successful-stonith-event",
252 "%s of %s successful: delegate=%s, client=%s, origin=%s, %s='%s'",
254 event->delegate ? event->delegate :
"",
255 event->client, event->origin,
256 full_history ?
"completed" :
"last-successful",
263 char *failed_s = time_t_string(event->completed);
265 out->list_item(out,
"failed-stonith-event",
266 "%s of %s failed : delegate=%s, client=%s, origin=%s, %s='%s' %s",
268 event->delegate ? event->delegate :
"",
269 event->client, event->origin,
270 full_history ?
"completed" :
"last-failed",
272 later_succeeded ?
"(a later attempt succeeded)" :
"");
278 out->list_item(out,
"pending-stonith-event",
279 "%s of %s pending: client=%s, origin=%s",
281 event->client, event->origin);
288 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
292 gboolean full_history = va_arg(args, gboolean);
293 gboolean later_succeeded = va_arg(args, gboolean);
295 char *buf = time_t_string(event->completed);
297 switch (event->state) {
301 event->delegate ? event->delegate :
"",
302 event->client, event->origin,
303 full_history ?
"completed" :
"last-failed", buf,
304 later_succeeded ?
"(a later attempt succeeded)" :
"");
310 event->delegate ? event->delegate :
"",
311 event->client, event->origin,
312 full_history ?
"completed" :
"last-successful", buf);
318 event->client, event->origin);
326 PCMK__OUTPUT_ARGS(
"stonith-event",
"stonith_history_t *",
"gboolean",
"gboolean")
330 gboolean full_history G_GNUC_UNUSED = va_arg(args, gboolean);
331 gboolean later_succeeded G_GNUC_UNUSED = va_arg(args, gboolean);
336 "action", event->action,
337 "target", event->target,
338 "client", event->client,
339 "origin", event->origin,
342 switch (event->state) {
352 char *state = pcmk__itoa(event->state);
354 "extended-status", state,
361 if (event->delegate != NULL) {
366 buf = time_t_string(event->completed);
374 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
377 const char *agent = va_arg(args,
const char *);
378 const char *device = va_arg(args,
const char *);
379 char *output = va_arg(args,
char *);
380 char *error_output = va_arg(args,
char *);
381 int rc = va_arg(args,
int);
385 rc ?
"failed" :
"succeeded");
390 rc ?
"failed" :
"succeeded");
395 out->subprocess_output(out,
rc, output, error_output);
399 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
402 const char *agent = va_arg(args,
const char *);
403 const char *device = va_arg(args,
const char *);
404 char *output = va_arg(args,
char *);
405 char *error_output = va_arg(args,
char *);
406 int rc = va_arg(args,
int);
410 rc ?
"failed" :
"succeeded");
413 rc ?
"failed" :
"succeeded");
416 out->subprocess_output(out,
rc, output, error_output);
420 PCMK__OUTPUT_ARGS(
"validate",
"const char *",
"const char *",
"char *",
"char *",
"int")
423 const char *agent = va_arg(args,
const char *);
424 const char *device = va_arg(args,
const char *);
425 char *output = va_arg(args,
char *);
426 char *error_output = va_arg(args,
char *);
427 int rc = va_arg(args,
int);
431 "valid", pcmk__btoa(
rc),
434 if (device != NULL) {
439 out->subprocess_output(out,
rc, output, error_output);
449 {
"full-fencing-list",
"xml", full_history_xml },
450 {
"last-fenced",
"html", last_fenced_html },
451 {
"last-fenced",
"log", last_fenced_text },
452 {
"last-fenced",
"text", last_fenced_text },
453 {
"last-fenced",
"xml", last_fenced_xml },
455 {
"stonith-event",
"html", stonith_event_html },
456 {
"stonith-event",
"log", stonith_event_text },
457 {
"stonith-event",
"text", stonith_event_text },
458 {
"stonith-event",
"xml", stonith_event_xml },
459 {
"validate",
"html", validate_agent_html },
460 {
"validate",
"log", validate_agent_text },
461 {
"validate",
"text", validate_agent_text },
462 {
"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
gboolean pcmk__str_in_list(GList *lst, const gchar *s, uint32_t flags)
int stonith__full_history(pcmk__output_t *out, va_list args)
PCMK__OUTPUT_ARGS("failed-fencing-list", "stonith_history_t *", "GList *", "unsigned int", "gboolean")
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)
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
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
#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)