18 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \
19 "shutdown", "terminate", "standby", "probe_complete", \
23 compare_attribute(gconstpointer a, gconstpointer b)
27 rc = strcmp((
const char *)a, (
const char *)b);
48 const char *attrname,
int *expected_score)
52 for (gIter = rsc_list; gIter != NULL; gIter = gIter->next) {
54 const char *
type = g_hash_table_lookup(rsc->
meta,
"type");
55 const char *
name = NULL;
56 GHashTable *params = NULL;
59 if (add_extra_info(node, rsc->
children, data_set, attrname,
70 name = g_hash_table_lookup(params,
"name");
78 int host_list_num = 0;
79 const char *hosts = g_hash_table_lookup(params,
"host_list");
80 const char *multiplier = g_hash_table_lookup(params,
"multiplier");
84 char **host_list = g_strsplit(hosts,
" ", 0);
85 host_list_num = g_strv_length(host_list);
86 g_strfreev(host_list);
89 if ((multiplier == NULL)
98 *expected_score = host_list_num * multiplier_i;
107 filter_attr_list(GList *attr_list,
char *name)
112 CRM_CHECK(name != NULL,
return attr_list);
115 for (i = 0; filt_str[i] != NULL; i++) {
116 if (g_str_has_prefix(name, filt_str[i])) {
121 return g_list_insert_sorted(attr_list, name, compare_attribute);
125 get_operation_list(xmlNode *rsc_entry) {
126 GList *op_list = NULL;
127 xmlNode *rsc_op = NULL;
129 for (rsc_op = pcmk__xe_first_child(rsc_entry); rsc_op != NULL;
130 rsc_op = pcmk__xe_next(rsc_op)) {
151 op_list = g_list_append(op_list, rsc_op);
160 add_dump_node(gpointer key, gpointer value, gpointer user_data)
162 xmlNodePtr node = user_data;
167 append_dump_text(gpointer key, gpointer value, gpointer user_data)
169 char **dump_text = user_data;
171 *dump_text, (
char *)key, (
char *)value);
174 *dump_text = new_text;
178 failed_action_string(xmlNodePtr xml_op) {
184 time_t last_change = 0;
201 "='%s', queued=%sms, exec=%sms",
202 op_key ? op_key :
ID(xml_op),
204 services_ocf_exitcode_str(rc), rc,
206 services_lrm_status_str(status),
207 exit_reason ? exit_reason :
"none",
216 return crm_strdup_printf(
"%s on %s '%s' (%d): call=%s, status=%s, exitreason='%s'",
217 op_key ? op_key :
ID(xml_op),
219 services_ocf_exitcode_str(rc), rc,
221 services_lrm_status_str(status),
222 exit_reason ? exit_reason :
"none");
229 xmlNode *stack =
get_xpath_object(
"//nvpair[@name='cluster-infrastructure']",
230 data_set->
input, LOG_DEBUG);
235 last_changed_string(
const char *last_written,
const char *user,
236 const char *client,
const char *origin) {
237 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
239 last_written ? last_written :
"",
242 client ?
" via " :
"",
243 client ? client :
"",
244 origin ?
" on " :
"",
245 origin ? origin :
"");
252 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
253 int rc, gboolean print_timing) {
255 char *interval_str = NULL;
258 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
265 char *last_change_str = NULL;
266 char *exec_str = NULL;
267 char *queue_str = NULL;
269 const char *value = NULL;
296 interval_str ? interval_str :
"",
297 last_change_str ? last_change_str :
"",
298 exec_str ? exec_str :
"",
299 queue_str ? queue_str :
"",
300 rc, services_ocf_exitcode_str(rc));
302 if (last_change_str) {
303 free(last_change_str);
315 interval_str ?
":" :
"",
316 interval_str ? interval_str :
"");
327 resource_history_string(
pe_resource_t *rsc,
const char *rsc_id, gboolean all,
328 int failcount, time_t last_failure) {
333 }
else if (all || failcount || last_failure > 0) {
334 char *failcount_s = NULL;
335 char *lastfail_s = NULL;
341 failcount_s = strdup(
"");
343 if (last_failure > 0) {
351 lastfail_s? lastfail_s :
"");
362 "gboolean",
"gboolean",
"gboolean")
366 gboolean print_clone_detail = va_arg(args, gboolean);
367 gboolean show_stack = va_arg(args, gboolean);
368 gboolean show_dc = va_arg(args, gboolean);
369 gboolean show_times = va_arg(args, gboolean);
370 gboolean show_counts = va_arg(args, gboolean);
371 gboolean show_options = va_arg(args, gboolean);
374 const char *stack_s = get_cluster_stack(data_set);
378 out->message(out,
"cluster-stack", stack_s);
382 if (data_set->
dc_node == NULL || show_dc) {
384 data_set->
input, LOG_DEBUG);
385 const char *dc_version_s = dc_version?
392 out->message(out,
"cluster-dc", data_set->
dc_node, quorum, dc_version_s, dc_name);
403 out->message(out,
"cluster-times", last_written, user, client, origin);
408 out->message(out,
"cluster-counts", g_list_length(data_set->
nodes),
415 out->message(out,
"cluster-options", data_set);
427 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"gboolean",
"gboolean",
"gboolean",
428 "gboolean",
"gboolean",
"gboolean")
432 gboolean print_clone_detail = va_arg(args, gboolean);
433 gboolean show_stack = va_arg(args, gboolean);
434 gboolean show_dc = va_arg(args, gboolean);
435 gboolean show_times = va_arg(args, gboolean);
436 gboolean show_counts = va_arg(args, gboolean);
437 gboolean show_options = va_arg(args, gboolean);
440 const char *stack_s = get_cluster_stack(data_set);
444 out->message(out,
"cluster-stack", stack_s);
448 if (data_set->
dc_node == NULL || show_dc) {
450 data_set->
input, LOG_DEBUG);
451 const char *dc_version_s = dc_version?
458 out->message(out,
"cluster-dc", data_set->
dc_node, quorum, dc_version_s, dc_name);
469 out->message(out,
"cluster-times", last_written, user, client, origin);
474 out->message(out,
"cluster-counts", g_list_length(data_set->
nodes),
486 out->begin_list(out, NULL, NULL,
"Config Options");
487 out->message(out,
"cluster-options", data_set);
503 const char *node_host = NULL;
504 const char *node_id = NULL;
513 if (host_node && host_node->
details) {
516 if (node_host == NULL) {
529 name_len += strlen(node_host) + 1;
532 name_len += strlen(node_id) + 3;
536 node_name = malloc(name_len);
540 strcat(node_name,
"@");
541 strcat(node_name, node_host);
544 strcat(node_name,
" (");
545 strcat(node_name, node_id);
546 strcat(node_name,
")");
553 ,
size_t pairs_count, ...)
555 xmlNodePtr xml_node = NULL;
564 : xmlNewChild(xml_node, NULL, (
pcmkXmlStr) tag_name, NULL);
566 va_start(args, pairs_count);
567 while(pairs_count--) {
568 const char *param_name = va_arg(args,
const char *);
569 const char *param_value = va_arg(args,
const char *);
570 if (param_name && param_value) {
586 #ifdef PCMK__COMPAT_2_0
600 gboolean print_clone_detail = va_arg(args, gboolean);
619 gboolean print_clone_detail = va_arg(args, gboolean);
622 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
635 gboolean print_clone_detail G_GNUC_UNUSED = va_arg(args, gboolean);
638 char *weight_s = pcmk__itoa(pe_node->
weight);
645 "promoted-only", promoted_only,
652 "master_only", promoted_only,
660 "gboolean",
"gboolean")
664 const char *prefix = va_arg(args,
const char *);
665 GList *only_rsc = va_arg(args, GList *);
666 gboolean print_clone_detail = va_arg(args, gboolean);
667 gboolean print_spacer = va_arg(args, gboolean);
669 GList *gIter, *gIter2;
676 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
685 for (gIter2 = location->
node_list_rh; gIter2 != NULL; gIter2 = gIter2->next) {
690 out->message(out,
"ban", node, location, print_clone_detail);
702 unsigned int nnodes = va_arg(args,
unsigned int);
703 int nresources = va_arg(args,
int);
704 int ndisabled = va_arg(args,
int);
705 int nblocked = va_arg(args,
int);
716 if (ndisabled && nblocked) {
731 " from further action due to failure)");
732 }
else if (ndisabled && !nblocked) {
741 }
else if (!ndisabled && nblocked) {
750 " from further action due to failure)");
764 unsigned int nnodes = va_arg(args,
unsigned int);
765 int nresources = va_arg(args,
int);
766 int ndisabled = va_arg(args,
int);
767 int nblocked = va_arg(args,
int);
769 out->list_item(out, NULL,
"%d node%s configured",
772 if (ndisabled && nblocked) {
773 out->list_item(out, NULL,
"%d resource instance%s configured "
774 "(%d DISABLED, %d BLOCKED from "
775 "further action due to failure)",
778 }
else if (ndisabled && !nblocked) {
779 out->list_item(out, NULL,
"%d resource instance%s configured "
782 }
else if (!ndisabled && nblocked) {
783 out->list_item(out, NULL,
"%d resource instance%s configured "
784 "(%d BLOCKED from further action "
788 out->list_item(out, NULL,
"%d resource instance%s configured",
798 unsigned int nnodes = va_arg(args,
unsigned int);
799 int nresources = va_arg(args,
int);
800 int ndisabled = va_arg(args,
int);
801 int nblocked = va_arg(args,
int);
806 char *s = pcmk__itoa(nnodes);
810 s = pcmk__itoa(nresources);
814 s = pcmk__itoa(ndisabled);
818 s = pcmk__itoa(nblocked);
825 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
829 const char *quorum = va_arg(args,
const char *);
830 const char *dc_version_s = va_arg(args,
const char *);
831 char *dc_name = va_arg(args,
char *);
840 dc_name, dc_version_s ? dc_version_s :
"unknown");
845 dc_name, dc_version_s ? dc_version_s :
"unknown");
859 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
863 const char *quorum = va_arg(args,
const char *);
864 const char *dc_version_s = va_arg(args,
const char *);
865 char *dc_name = va_arg(args,
char *);
868 out->list_item(out,
"Current DC",
"%s (version %s) - partition %s quorum",
869 dc_name, dc_version_s ? dc_version_s :
"unknown",
872 out->list_item(out,
"Current DC",
"NONE");
878 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
882 const char *quorum = va_arg(args,
const char *);
883 const char *dc_version_s = va_arg(args,
const char *);
884 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
889 "version", dc_version_s ? dc_version_s :
"",
906 unsigned long long flags = va_arg(args,
unsigned long long);
926 out->list_item(out, NULL,
"STONITH of failed nodes %s",
929 out->list_item(out, NULL,
"Cluster is %s",
934 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
938 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
942 out->list_item(out, NULL,
"No quorum policy: Demote promotable "
943 "resources and stop all other resources");
947 out->list_item(out, NULL,
"No quorum policy: Ignore");
951 out->list_item(out, NULL,
"No quorum policy: Suicide");
961 " (the cluster will not attempt to start, stop, or recover services)");
968 " (the cluster will keep all resources stopped)");
970 out->list_item(out, NULL,
"Resource management: enabled");
982 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
984 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
995 out->list_item(out, NULL,
"STONITH of failed nodes %s",
998 out->list_item(out, NULL,
"Cluster is %s",
1003 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1007 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1011 out->list_item(out, NULL,
"No quorum policy: Demote promotable "
1012 "resources and stop all other resources");
1016 out->list_item(out, NULL,
"No quorum policy: Ignore");
1020 out->list_item(out, NULL,
"No quorum policy: Suicide");
1032 const char *no_quorum_policy = NULL;
1036 no_quorum_policy =
"freeze";
1040 no_quorum_policy =
"stop";
1044 no_quorum_policy =
"demote";
1048 no_quorum_policy =
"ignore";
1052 no_quorum_policy =
"suicide";
1059 "no-quorum-policy", no_quorum_policy,
1069 const char *stack_s = va_arg(args,
const char *);
1082 const char *stack_s = va_arg(args,
const char *);
1084 out->list_item(out,
"Stack",
"%s", stack_s);
1091 const char *stack_s = va_arg(args,
const char *);
1100 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1103 const char *last_written = va_arg(args,
const char *);
1104 const char *user = va_arg(args,
const char *);
1105 const char *client = va_arg(args,
const char *);
1106 const char *origin = va_arg(args,
const char *);
1111 char *buf = last_changed_string(last_written, user, client, origin);
1124 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1127 const char *last_written = va_arg(args,
const char *);
1128 const char *user = va_arg(args,
const char *);
1129 const char *client = va_arg(args,
const char *);
1130 const char *origin = va_arg(args,
const char *);
1136 "time", last_written ? last_written :
"",
1137 "user", user ? user :
"",
1138 "client", client ? client :
"",
1139 "origin", origin ? origin :
"",
1145 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1148 const char *last_written = va_arg(args,
const char *);
1149 const char *user = va_arg(args,
const char *);
1150 const char *client = va_arg(args,
const char *);
1151 const char *origin = va_arg(args,
const char *);
1153 char *buf = last_changed_string(last_written, user, client, origin);
1156 out->list_item(out,
"Last change",
" %s", buf);
1165 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1167 char *s = failed_action_string(xml_op);
1169 out->list_item(out, NULL,
"%s", s);
1177 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1186 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
1187 xmlNodePtr node = NULL;
1193 rc_s = pcmk__itoa(rc);
1195 (op_key == NULL)?
"id" :
"op_key",
1196 (op_key == NULL)?
ID(xml_op) : op_key,
1198 "exitstatus", services_ocf_exitcode_str(rc),
1199 "exitreason", reason_s,
1202 "status", services_lrm_status_str(status),
1207 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1208 guint interval_ms = 0;
1211 char *rc_change = NULL;
1214 s = pcmk__itoa(interval_ms);
1236 "GList *",
"gboolean")
1240 GList *only_node = va_arg(args, GList *);
1241 GList *only_rsc = va_arg(args, GList *);
1242 gboolean print_spacer = va_arg(args, gboolean);
1244 xmlNode *xml_op = NULL;
1247 const char *
id = NULL;
1249 if (xmlChildElementCount(data_set->
failed) == 0) {
1253 for (xml_op = pcmk__xml_first_child(data_set->
failed); xml_op != NULL;
1254 xml_op = pcmk__xml_next(xml_op)) {
1262 if (
parse_op_key(
id ?
id :
ID(xml_op), &rsc, NULL, NULL) == FALSE) {
1274 out->message(out,
"failed-action", xml_op);
1282 "gboolean",
"gboolean",
"gboolean",
"GList *",
"GList *")
1286 unsigned int print_opts = va_arg(args,
unsigned int);
1287 gboolean full = va_arg(args, gboolean);
1288 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1289 gboolean print_clone_detail = va_arg(args, gboolean);
1290 gboolean print_brief = va_arg(args, gboolean);
1291 gboolean group_by_node = va_arg(args, gboolean);
1292 GList *only_node = va_arg(args, GList *);
1293 GList *only_rsc = va_arg(args, GList *);
1320 if (print_brief && group_by_node) {
1324 out->begin_list(out, NULL, NULL, NULL);
1329 }
else if (group_by_node) {
1332 out->begin_list(out, NULL, NULL, NULL);
1336 rsc, only_node, only_rsc);
1341 out->begin_list(out, NULL, NULL,
"%s", buf);
1349 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1350 "gboolean",
"gboolean",
"gboolean",
"GList *",
"GList *")
1354 unsigned int print_opts = va_arg(args,
unsigned int);
1355 gboolean full = va_arg(args, gboolean);
1356 const char *node_mode = va_arg(args,
const char *);
1357 gboolean print_clone_detail = va_arg(args, gboolean);
1358 gboolean print_brief = va_arg(args, gboolean);
1359 gboolean group_by_node = va_arg(args, gboolean);
1360 GList *only_node = va_arg(args, GList *);
1361 GList *only_rsc = va_arg(args, GList *);
1377 if (group_by_node) {
1382 out->begin_list(out, NULL, NULL,
"%s", buf);
1383 out->begin_list(out, NULL, NULL,
"Resources");
1392 GList *gIter2 = NULL;
1394 out->begin_list(out, NULL, NULL,
"%s", buf);
1395 out->begin_list(out, NULL, NULL,
"Resources");
1400 rsc, only_node, only_rsc);
1407 out->list_item(out, NULL,
"%s", buf);
1414 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1421 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1422 "gboolean",
"gboolean",
"gboolean",
"GList *",
"GList *")
1426 unsigned int print_opts = va_arg(args,
unsigned int);
1427 gboolean full = va_arg(args, gboolean);
1428 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1429 gboolean print_clone_detail G_GNUC_UNUSED = va_arg(args, gboolean);
1430 gboolean print_brief G_GNUC_UNUSED = va_arg(args, gboolean);
1431 gboolean group_by_node = va_arg(args, gboolean);
1432 GList *only_node = va_arg(args, GList *);
1433 GList *only_rsc = va_arg(args, GList *);
1441 node_type =
"member";
1444 node_type =
"remote";
1462 "resources_running", length_s,
1470 if (group_by_node) {
1476 rsc, only_node, only_rsc);
1492 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1495 const char *name = va_arg(args,
const char *);
1496 const char *value = va_arg(args,
const char *);
1497 gboolean add_extra = va_arg(args, gboolean);
1498 int expected_score = va_arg(args,
int);
1503 if (value == NULL) {
1509 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost", name, value);
1510 }
else if (v < expected_score) {
1511 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)", name, value, expected_score);
1513 out->list_item(out, NULL,
"%-32s\t: %-10s", name, value);
1516 out->list_item(out, NULL,
"%-32s\t: %-10s", name, value);
1522 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1525 const char *name = va_arg(args,
const char *);
1526 const char *value = va_arg(args,
const char *);
1527 gboolean add_extra = va_arg(args, gboolean);
1528 int expected_score = va_arg(args,
int);
1535 if (value == NULL) {
1546 }
else if (v < expected_score) {
1547 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
1552 out->list_item(out, NULL,
"%s: %s", name, value);
1562 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1565 gchar *node_str = NULL;
1566 char *last_change_str = NULL;
1571 time_t last_change = 0;
1579 pe_node_t *node = pe__current_node(rsc);
1588 opts, target_role,
false);
1601 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
1602 node_str, op_key ? op_key :
ID(xml_op),
1606 last_change_str ? last_change_str :
"",
1607 services_lrm_status_str(status));
1610 free(last_change_str);
1618 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1624 time_t last_change = 0;
1625 xmlNode *node = NULL;
1630 "op", op_key ? op_key :
ID(xml_op),
1634 "status", services_lrm_status_str(status),
1642 char *agent_tuple = NULL;
1649 "agent", agent_tuple,
1665 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1668 const char *name = va_arg(args,
const char *);
1669 const char *value = va_arg(args,
const char *);
1670 gboolean add_extra = va_arg(args, gboolean);
1671 int expected_score = va_arg(args,
int);
1679 char *buf = pcmk__itoa(expected_score);
1688 "gboolean",
"gboolean",
"gboolean",
"gboolean",
"GList *",
1693 unsigned int print_opts = va_arg(args,
unsigned int);
1694 gboolean print_spacer = va_arg(args, gboolean);
1695 gboolean print_clone_detail = va_arg(args, gboolean);
1696 gboolean print_brief = va_arg(args, gboolean);
1697 gboolean group_by_node = va_arg(args, gboolean);
1698 GList *only_node = va_arg(args, GList *);
1699 GList *only_rsc = va_arg(args, GList *);
1704 for (GList *gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1707 GList *attr_list = NULL;
1708 GHashTableIter iter;
1716 while (g_hash_table_iter_next (&iter, &key, NULL)) {
1717 attr_list = filter_attr_list(attr_list, key);
1720 if (attr_list == NULL) {
1730 out->message(out,
"node", node, print_opts, FALSE, NULL,
1731 print_clone_detail, print_brief,
1732 group_by_node, only_node, only_rsc);
1734 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
1735 const char *name = aIter->data;
1736 const char *value = NULL;
1737 int expected_score = 0;
1738 gboolean add_extra = FALSE;
1743 data_set, name, &expected_score);
1746 out->message(out,
"node-attribute", name, value, add_extra,
1750 g_list_free(attr_list);
1763 const char *comment = va_arg(args,
const char *);
1769 out->list_item(out, NULL,
"%s", dump_text);
1780 const char *comment = va_arg(args,
const char *);
1792 "GList *",
"GList *",
"gboolean",
"unsigned int",
"gboolean",
1793 "gboolean",
"gboolean",
"gboolean")
1798 xmlNode *node_state = va_arg(args, xmlNode *);
1799 GList *only_node = va_arg(args, GList *);
1800 GList *only_rsc = va_arg(args, GList *);
1801 gboolean operations = va_arg(args, gboolean);
1802 unsigned int print_opts = va_arg(args,
unsigned int);
1803 gboolean print_clone_detail = va_arg(args, gboolean);
1804 gboolean print_brief = va_arg(args, gboolean);
1805 gboolean group_by_node = va_arg(args, gboolean);
1806 gboolean print_timing = va_arg(args, gboolean);
1808 xmlNode *lrm_rsc = NULL;
1809 xmlNode *rsc_entry = NULL;
1816 for (rsc_entry = pcmk__xe_first_child(lrm_rsc); rsc_entry != NULL;
1817 rsc_entry = pcmk__xe_next(rsc_entry)) {
1845 if (operations == FALSE) {
1846 time_t last_failure = 0;
1850 if (failcount <= 0) {
1856 out->message(out,
"node", node, print_opts, FALSE, NULL,
1857 print_clone_detail, print_brief,
1858 group_by_node, only_node, only_rsc);
1861 out->message(out,
"resource-history", rsc, rsc_id, FALSE,
1862 failcount, last_failure, FALSE);
1864 GList *op_list = get_operation_list(rsc_entry);
1868 if (op_list == NULL) {
1874 out->message(out,
"node", node, print_opts, FALSE, NULL,
1875 print_clone_detail, print_brief,
1876 group_by_node, only_node, only_rsc);
1879 out->message(out,
"resource-operation-list", data_set, rsc, node,
1880 op_list, print_timing);
1888 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
1891 GList *nodes = va_arg(args, GList *);
1892 GList *only_node = va_arg(args, GList *);
1893 GList *only_rsc = va_arg(args, GList *);
1894 unsigned int print_opts = va_arg(args,
unsigned int);
1895 gboolean print_clone_detail = va_arg(args, gboolean);
1896 gboolean print_brief = va_arg(args, gboolean);
1897 gboolean group_by_node = va_arg(args, gboolean);
1901 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
1910 out->message(out,
"node", node, print_opts, TRUE, NULL, print_clone_detail,
1911 print_brief, group_by_node, only_node, only_rsc);
1918 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
1921 GList *nodes = va_arg(args, GList *);
1922 GList *only_node = va_arg(args, GList *);
1923 GList *only_rsc = va_arg(args, GList *);
1924 unsigned int print_opts = va_arg(args,
unsigned int);
1925 gboolean print_clone_detail = va_arg(args, gboolean);
1926 gboolean print_brief = va_arg(args, gboolean);
1927 gboolean group_by_node = va_arg(args, gboolean);
1930 char *online_nodes = NULL;
1931 char *online_remote_nodes = NULL;
1932 char *online_guest_nodes = NULL;
1933 char *offline_nodes = NULL;
1934 char *offline_remote_nodes = NULL;
1936 size_t online_nodes_len = 0;
1937 size_t online_remote_nodes_len = 0;
1938 size_t online_guest_nodes_len = 0;
1939 size_t offline_nodes_len = 0;
1940 size_t offline_remote_nodes_len = 0;
1944 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
1946 const char *node_mode = NULL;
1959 node_mode =
"UNCLEAN (online)";
1962 node_mode =
"UNCLEAN (pending)";
1965 node_mode =
"UNCLEAN (offline)";
1969 node_mode =
"pending";
1972 node_mode =
"standby (on-fail)";
1977 node_mode =
"standby (with active resources)";
1979 node_mode =
"standby";
1982 node_mode =
"OFFLINE (standby)";
1987 node_mode =
"maintenance";
1989 node_mode =
"OFFLINE (maintenance)";
1993 node_mode =
"online";
1994 if (group_by_node == FALSE) {
1996 pcmk__add_word(&online_guest_nodes,
1997 &online_guest_nodes_len, node_name);
1999 pcmk__add_word(&online_remote_nodes,
2000 &online_remote_nodes_len, node_name);
2002 pcmk__add_word(&online_nodes, &online_nodes_len, node_name);
2009 node_mode =
"OFFLINE";
2010 if (group_by_node == FALSE) {
2012 pcmk__add_word(&offline_remote_nodes,
2013 &offline_remote_nodes_len, node_name);
2017 pcmk__add_word(&offline_nodes,
2018 &offline_nodes_len, node_name);
2026 out->message(out,
"node", node, print_opts, TRUE, node_mode, print_clone_detail,
2027 print_brief, group_by_node, only_node, only_rsc);
2033 out->list_item(out,
"Online",
"[ %s ]", online_nodes);
2036 if (offline_nodes) {
2037 out->list_item(out,
"OFFLINE",
"[ %s ]", offline_nodes);
2038 free(offline_nodes);
2040 if (online_remote_nodes) {
2041 out->list_item(out,
"RemoteOnline",
"[ %s ]", online_remote_nodes);
2042 free(online_remote_nodes);
2044 if (offline_remote_nodes) {
2045 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]", offline_remote_nodes);
2046 free(offline_remote_nodes);
2048 if (online_guest_nodes) {
2049 out->list_item(out,
"GuestOnline",
"[ %s ]", online_guest_nodes);
2050 free(online_guest_nodes);
2057 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
2060 GList *nodes = va_arg(args, GList *);
2061 GList *only_node = va_arg(args, GList *);
2062 GList *only_rsc = va_arg(args, GList *);
2063 unsigned int print_opts = va_arg(args,
unsigned int);
2064 gboolean print_clone_detail = va_arg(args, gboolean);
2065 gboolean print_brief = va_arg(args, gboolean);
2066 gboolean group_by_node = va_arg(args, gboolean);
2068 out->begin_list(out, NULL, NULL,
"nodes");
2069 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2076 out->message(out,
"node", node, print_opts, TRUE, NULL, print_clone_detail,
2077 print_brief, group_by_node, only_node, only_rsc);
2085 "gboolean",
"unsigned int",
"gboolean",
"gboolean",
"gboolean",
2086 "gboolean",
"gboolean")
2090 GList *only_node = va_arg(args, GList *);
2091 GList *only_rsc = va_arg(args, GList *);
2092 gboolean operations = va_arg(args, gboolean);
2093 unsigned int print_opts = va_arg(args,
unsigned int);
2094 gboolean print_clone_detail = va_arg(args, gboolean);
2095 gboolean print_brief = va_arg(args, gboolean);
2096 gboolean group_by_node = va_arg(args, gboolean);
2097 gboolean print_timing = va_arg(args, gboolean);
2098 gboolean print_spacer = va_arg(args, gboolean);
2100 xmlNode *node_state = NULL;
2104 if (xmlChildElementCount(cib_status) == 0) {
2109 for (node_state = pcmk__xe_first_child(cib_status); node_state != NULL;
2110 node_state = pcmk__xe_next(node_state)) {
2129 out->message(out,
"node-history-list", data_set, node, node_state,
2130 only_node, only_rsc, operations, print_opts,
2131 print_clone_detail, print_brief, group_by_node, print_timing);
2138 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2143 const char *prefix = va_arg(args,
const char *);
2144 const char *
uname = va_arg(args,
const char *);
2145 char *score = va_arg(args,
char *);
2148 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2149 prefix, rsc->
id, uname, score);
2151 out->list_item(out, NULL,
"%s: %s = %s", prefix, uname, score);
2157 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2162 const char *prefix = va_arg(args,
const char *);
2163 const char *uname = va_arg(args,
const char *);
2164 char *score = va_arg(args,
char *);
2179 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"gboolean")
2182 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2183 const char *task = va_arg(args,
const char *);
2184 const char *interval_ms_s = va_arg(args,
const char *);
2185 int rc = va_arg(args,
int);
2186 gboolean print_timing = va_arg(args, gboolean);
2188 char *buf = op_history_string(xml_op, task, interval_ms_s, rc, print_timing);
2190 out->list_item(out, NULL,
"%s", buf);
2196 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"gboolean")
2199 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2200 const char *task = va_arg(args,
const char *);
2201 const char *interval_ms_s = va_arg(args,
const char *);
2202 int rc = va_arg(args,
int);
2203 gboolean print_timing = va_arg(args, gboolean);
2205 char *rc_s = pcmk__itoa(rc);
2210 "rc_text", services_ocf_exitcode_str(rc),
2214 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2221 const char *value = NULL;
2225 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2246 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2252 char *score = va_arg(args,
char *);
2254 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2261 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2267 char *score = va_arg(args,
char *);
2270 "id", child_rsc->
id,
2285 gboolean raw = va_arg(args, gboolean);
2287 char *rsc_xml = NULL;
2296 out->output_xml(out,
"xml", rsc_xml);
2302 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2306 const char *rsc_id = va_arg(args,
const char *);
2307 gboolean all = va_arg(args, gboolean);
2308 int failcount = va_arg(args,
int);
2309 time_t last_failure = va_arg(args,
int);
2310 gboolean as_header = va_arg(args, gboolean);
2312 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2315 out->begin_list(out, NULL, NULL,
"%s", buf);
2317 out->list_item(out, NULL,
"%s", buf);
2324 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2328 const char *rsc_id = va_arg(args,
const char *);
2329 gboolean all = va_arg(args, gboolean);
2330 int failcount = va_arg(args,
int);
2331 time_t last_failure = va_arg(args,
int);
2332 gboolean as_header = va_arg(args, gboolean);
2340 }
else if (all || failcount || last_failure > 0) {
2344 "migration-threshold", migration_s,
2348 if (failcount > 0) {
2349 char *s = pcmk__itoa(failcount);
2355 if (last_failure > 0) {
2360 if (as_header == FALSE) {
2368 print_resource_header(
pcmk__output_t *out, gboolean group_by_node,
2369 gboolean inactive_resources)
2371 if (group_by_node) {
2373 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2374 }
else if (inactive_resources) {
2375 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2377 out->
begin_list(out, NULL, NULL,
"Active Resources");
2383 "gboolean",
"gboolean",
"gboolean",
"GList *",
"GList *",
"gboolean")
2388 unsigned int print_opts = va_arg(args,
unsigned int);
2389 gboolean group_by_node = va_arg(args, gboolean);
2390 gboolean inactive_resources = va_arg(args, gboolean);
2391 gboolean brief_output = va_arg(args, gboolean);
2392 gboolean print_summary = va_arg(args, gboolean);
2393 GList *only_node = va_arg(args, GList *);
2394 GList *only_rsc = va_arg(args, GList *);
2395 gboolean print_spacer = va_arg(args, gboolean);
2399 bool printed_header =
false;
2404 if (group_by_node && !inactive_resources) {
2410 if (brief_output && !group_by_node) {
2414 print_resource_header(out, group_by_node, inactive_resources);
2415 printed_header =
true;
2422 for (rsc_iter = data_set->
resources; rsc_iter != NULL; rsc_iter = rsc_iter->next) {
2427 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
2428 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
2435 }
else if (group_by_node) {
2447 }
else if (!partially_active && !inactive_resources) {
2454 if (!printed_header) {
2456 print_resource_header(out, group_by_node, inactive_resources);
2457 printed_header =
true;
2461 x = out->message(out, crm_map_element_name(rsc->
xml), print_opts, rsc,
2462 only_node, only_rsc);
2469 if (!printed_header) {
2471 print_resource_header(out, group_by_node, inactive_resources);
2472 printed_header =
true;
2475 if (group_by_node) {
2476 out->list_item(out, NULL,
"No inactive resources");
2477 }
else if (inactive_resources) {
2478 out->list_item(out, NULL,
"No resources");
2480 out->list_item(out, NULL,
"No active resources");
2484 if (printed_header) {
2492 "pe_node_t *",
"GList *",
"gboolean")
2499 GList *op_list = va_arg(args, GList *);
2500 gboolean print_timing = va_arg(args, gboolean);
2502 GList *gIter = NULL;
2506 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
2507 xmlNode *xml_op = (xmlNode *) gIter->data;
2524 time_t last_failure = 0;
2529 failcount, last_failure, TRUE);
2534 out->message(out,
"op-history", xml_op, task, interval_ms_s,
2535 op_rc_i, print_timing);
2539 g_list_free(op_list);
2545 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2551 const char *fn = va_arg(args,
const char *);
2556 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
2557 out->list_item(out, NULL,
"%s", dump_text);
2563 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2569 const char *fn = va_arg(args,
const char *);
2572 "resource", rsc->
id,
2576 g_hash_table_foreach(rsc->
utilization, add_dump_node, &xml_node);
2590 out->list_item(out, NULL,
"%s:\t%s%s %s", ticket->
id,
2591 ticket->
granted ?
"granted" :
"revoked",
2592 ticket->
standby ?
" [standby]" :
"",
2596 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
2597 ticket->
granted ?
"granted" :
"revoked",
2598 ticket->
standby ?
" [standby]" :
"");
2613 out->list_item(out, ticket->
id,
"%s%s %s",
2614 ticket->
granted ?
"granted" :
"revoked",
2615 ticket->
standby ?
" [standby]" :
"",
2619 out->list_item(out, ticket->
id,
"%s%s",
2620 ticket->
granted ?
"granted" :
"revoked",
2621 ticket->
standby ?
" [standby]" :
"");
2632 xmlNodePtr node = NULL;
2636 "status", ticket->
granted ?
"granted" :
"revoked",
2637 "standby", pcmk__btoa(ticket->
standby),
2651 gboolean print_spacer = va_arg(args, gboolean);
2653 GHashTableIter iter;
2654 gpointer key, value;
2656 if (g_hash_table_size(data_set->
tickets) == 0) {
2663 out->begin_list(out, NULL, NULL,
"Tickets");
2666 g_hash_table_iter_init(&iter, data_set->
tickets);
2667 while (g_hash_table_iter_next(&iter, &key, &value)) {
2669 out->message(out,
"ticket", ticket);
2678 {
"ban",
"html", ban_html },
2681 {
"ban",
"xml", ban_xml },
2682 {
"ban-list",
"default", ban_list },
2691 {
"cluster-counts",
"html", cluster_counts_html },
2694 {
"cluster-counts",
"xml", cluster_counts_xml },
2695 {
"cluster-dc",
"html", cluster_dc_html },
2698 {
"cluster-dc",
"xml", cluster_dc_xml },
2699 {
"cluster-options",
"html", cluster_options_html },
2700 {
"cluster-options",
"log", cluster_options_log },
2702 {
"cluster-options",
"xml", cluster_options_xml },
2704 {
"cluster-summary",
"html", cluster_summary_html },
2705 {
"cluster-stack",
"html", cluster_stack_html },
2708 {
"cluster-stack",
"xml", cluster_stack_xml },
2709 {
"cluster-times",
"html", cluster_times_html },
2712 {
"cluster-times",
"xml", cluster_times_xml },
2714 {
"failed-action",
"xml", failed_action_xml },
2715 {
"failed-action-list",
"default", failed_action_list },
2725 {
"node-and-op",
"default", node_and_op },
2726 {
"node-and-op",
"xml", node_and_op_xml },
2727 {
"node-capacity",
"default", node_capacity },
2728 {
"node-capacity",
"xml", node_capacity_xml },
2729 {
"node-history-list",
"default", node_history_list },
2730 {
"node-list",
"html", node_list_html },
2733 {
"node-list",
"xml", node_list_xml },
2734 {
"node-weight",
"default", node_weight },
2735 {
"node-weight",
"xml", node_weight_xml },
2736 {
"node-attribute",
"html", node_attribute_html },
2739 {
"node-attribute",
"xml", node_attribute_xml },
2740 {
"node-attribute-list",
"default", node_attribute_list },
2741 {
"node-summary",
"default", node_summary },
2743 {
"op-history",
"xml", op_history_xml },
2748 {
"promotion-score",
"default", promotion_score },
2749 {
"promotion-score",
"xml", promotion_score_xml },
2750 {
"resource-config",
"default", resource_config },
2752 {
"resource-history",
"xml", resource_history_xml },
2753 {
"resource-list",
"default", resource_list },
2754 {
"resource-operation-list",
"default", resource_operation_list },
2755 {
"resource-util",
"default", resource_util },
2756 {
"resource-util",
"xml", resource_util_xml },
2757 {
"ticket",
"html", ticket_html },
2760 {
"ticket",
"xml", ticket_xml },
2761 {
"ticket-list",
"default", ticket_list },
2763 { NULL, NULL, NULL }
2780 crm_trace(
"%sNode %s: (weight=%d, fixed=%s)",
2785 char *pe_mutable = strdup(
"\t\t");
2789 all = g_list_prepend(all, strdup(
"*"));
2797 for (; gIter != NULL; gIter = gIter->next) {
2800 out->
message(out, crm_map_element_name(rsc->
xml),
2804 g_list_free_full(all, free);
crm_time_t * crm_time_new_undefined(void)
Allocate memory for an uninitialized time object.
#define CRM_CHECK(expr, failure_action)
#define XML_RSC_OP_LAST_CHANGE
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
#define XML_ATTR_UPDATE_ORIG
enum rsc_role_e role_filter
enum pe_quorum_policy no_quorum_policy
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...)
int pe__cluster_maint_mode_text(pcmk__output_t *out, va_list args)
#define XML_ATTR_UPDATE_CLIENT
int pe__failed_action_text(pcmk__output_t *out, va_list args)
int pe__ticket_text(pcmk__output_t *out, va_list args)
int pcmk__scan_min_int(const char *text, int *result, int minimum)
#define crm_time_log_timeofday
int pe__cluster_summary(pcmk__output_t *out, va_list args)
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
struct crm_time_s crm_time_t
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, long options, gboolean print_all)
#define pe_flag_symmetric_cluster
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
gboolean pcmk__str_in_list(GList *lst, const gchar *s)
int pe__cluster_options_text(pcmk__output_t *out, va_list args)
#define pe_flag_maintenance_mode
xmlNode * pcmk_create_html_node(xmlNode *parent, const char *element_name, const char *id, const char *class_name, const char *text)
#define XML_ATTR_UPDATE_USER
pe_resource_t * remote_rsc
#define CRMD_ACTION_NOTIFY
#define XML_RSC_OP_T_EXEC
resource_object_functions_t * fns
#define XML_LRM_TAG_RESOURCE
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
int pe__cluster_times_text(pcmk__output_t *out, va_list args)
int pe__cluster_counts_text(pcmk__output_t *out, va_list args)
xmlNodePtr pcmk__output_xml_peek_parent(pcmk__output_t *out)
int(* message)(pcmk__output_t *out, const char *message_id,...)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define RSC_ROLE_PROMOTED_LEGACY_S
void pcmk__xe_set_props(xmlNodePtr node,...)
pe_resource_t * pe_find_resource(GList *rsc_list, const char *id_rh)
int pe__ban_text(pcmk__output_t *out, va_list args)
enum crm_ais_msg_types type
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
int pe__resource_text(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_T_QUEUE
char * pcmk__format_named_time(const char *name, time_t epoch_time)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
int pe__group_text(pcmk__output_t *out, va_list args)
#define PCMK__LAST_FAILURE_PREFIX
char * pe__node_display_name(pe_node_t *node, bool print_detail)
int pe__bundle_html(pcmk__output_t *out, va_list args)
int pe__op_history_text(pcmk__output_t *out, va_list args)
void void void pcmk__formatted_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
#define pe_flag_stop_everything
int pe__clone_html(pcmk__output_t *out, va_list args)
int pe__node_list_text(pcmk__output_t *out, va_list args)
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
char * pcmk__format_nvpair(const char *name, const char *value, const char *units)
#define PCMK__OUTPUT_SPACER_IF(out_obj, cond)
#define XML_LRM_ATTR_TASK_KEY
bool pe__is_remote_node(const pe_node_t *node)
#define XML_LRM_ATTR_TASK
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
int pe__bundle_text(pcmk__output_t *out, va_list args)
pe_resource_t * uber_parent(pe_resource_t *rsc)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr node)
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define XML_CIB_TAG_STATE
bool pe__is_guest_node(const pe_node_t *node)
#define PCMK__OUTPUT_ARGS(ARGS...)
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name, size_t pairs_count,...)
xmlNode * pcmk_create_xml_text_node(xmlNode *parent, const char *name, const char *content)
int pe__group_html(pcmk__output_t *out, va_list args)
#define crm_trace(fmt, args...)
int pe__clone_xml(pcmk__output_t *out, va_list args)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
void crm_time_set_timet(crm_time_t *target, time_t *source)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#define XML_AGENT_ATTR_PROVIDER
#define XML_ATTR_HAVE_QUORUM
GHashTable * pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
int pe__resource_history_text(pcmk__output_t *out, va_list args)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
char * dump_xml_formatted(xmlNode *msg)
#define pe_flag_stonith_enabled
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define PCMK__FAIL_COUNT_PREFIX
#define XML_RSC_ATTR_TARGET_ROLE
#define XML_LRM_ATTR_EXIT_REASON
void pe__register_messages(pcmk__output_t *out)
#define crm_time_log_with_timezone
enum pe_obj_types variant
int pe__cluster_dc_text(pcmk__output_t *out, va_list args)
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
#define RSC_ROLE_PROMOTED_S
const char * pcmk__epoch2str(time_t *when)
char * crm_time_as_string(crm_time_t *dt, int flags)
int pe__resource_xml(pcmk__output_t *out, va_list args)
const xmlChar * pcmkXmlStr
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
gboolean(* is_filtered)(pe_resource_t *, GList *, gboolean)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
int pe__clone_text(pcmk__output_t *out, va_list args)
int pe__node_text(pcmk__output_t *out, va_list args)
#define XML_LRM_TAG_RESOURCES
const char * rsc_printable_id(pe_resource_t *rsc)
#define XML_CIB_ATTR_WRITTEN
crm_time_t * crm_time_new(const char *string)
int pe__cluster_stack_text(pcmk__output_t *out, va_list args)
bool pe__rsc_running_on_any_node_in_list(pe_resource_t *rsc, GList *node_list)
int pe__node_xml(pcmk__output_t *out, va_list args)
int pe__group_xml(pcmk__output_t *out, va_list args)
This structure contains everything that makes up a single output formatter.
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_ATTR_CALLID
#define XML_NVPAIR_ATTR_VALUE
int pe__node_attribute_text(pcmk__output_t *out, va_list args)
#define XML_LRM_ATTR_OPSTATUS
int pe__resource_html(pcmk__output_t *out, va_list args)
#define pcmk__plural_s(i)
rsc_role_e
Possible roles that a resource can be in.
void pcmk__register_messages(pcmk__output_t *out, pcmk__message_entry_t *table)
GList * placement_constraints
gchar * pcmk__native_output_string(pe_resource_t *rsc, const char *name, pe_node_t *node, long options, const char *target_role, bool show_nodes)
#define XML_CIB_TAG_STATUS
int pe__node_html(pcmk__output_t *out, va_list args)
uint32_t pcmk_get_ra_caps(const char *standard)
Get capabilities of a resource agent standard.
gboolean crm_is_true(const char *s)
char * pcmk__trim(char *str)
#define XML_LRM_TAG_RSC_OP
gboolean(* active)(pe_resource_t *, gboolean)
void pe__output_node(pe_node_t *node, gboolean details, pcmk__output_t *out)
char * crm_xml_escape(const char *text)
void print_str_str(gpointer key, gpointer value, gpointer user_data)
#define crm_time_log_date
xmlNodePtr pcmk__output_xml_create_parent(pcmk__output_t *out, const char *name,...)
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
#define XML_AGENT_ATTR_CLASS
#define CRMD_ACTION_STATUS
void crm_time_free(crm_time_t *dt)