16 failed_action_string(xmlNodePtr xml_op) {
22 time_t last_change = 0;
35 "='%s', queued=%sms, exec=%sms",
36 op_key ? op_key :
ID(xml_op),
38 services_ocf_exitcode_str(
rc),
rc,
40 services_lrm_status_str(status),
41 exit_reason ? exit_reason :
"none",
50 return crm_strdup_printf(
"%s on %s '%s' (%d): call=%s, status=%s, exitreason='%s'",
51 op_key ? op_key :
ID(xml_op),
53 services_ocf_exitcode_str(
rc),
rc,
55 services_lrm_status_str(status),
56 exit_reason ? exit_reason :
"none");
63 xmlNode *stack =
get_xpath_object(
"//nvpair[@name='cluster-infrastructure']",
64 data_set->
input, LOG_DEBUG);
69 last_changed_string(
const char *last_written,
const char *user,
70 const char *client,
const char *origin) {
71 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
73 last_written ? last_written :
"",
76 client ?
" via " :
"",
79 origin ? origin :
"");
86 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
87 int rc, gboolean print_timing) {
89 char *interval_str = NULL;
92 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
99 char *last_change_str = NULL;
100 char *last_run_str = NULL;
101 char *exec_str = NULL;
102 char *queue_str = NULL;
104 const char *value = NULL;
137 interval_str ? interval_str :
"",
138 last_change_str ? last_change_str :
"",
139 last_run_str ? last_run_str :
"",
140 exec_str ? exec_str :
"",
141 queue_str ? queue_str :
"",
142 rc, services_ocf_exitcode_str(
rc));
144 if (last_change_str) {
145 free(last_change_str);
161 interval_str ?
":" :
"",
162 interval_str ? interval_str :
"");
173 resource_history_string(
pe_resource_t *rsc,
const char *rsc_id, gboolean all,
174 int failcount, time_t last_failure) {
179 }
else if (all || failcount || last_failure > 0) {
180 char *failcount_s = NULL;
181 char *lastfail_s = NULL;
187 failcount_s = strdup(
"");
189 if (last_failure > 0) {
197 lastfail_s? lastfail_s :
"");
208 "gboolean",
"gboolean",
"gboolean")
212 gboolean print_clone_detail = va_arg(args, gboolean);
213 gboolean show_stack = va_arg(args, gboolean);
214 gboolean show_dc = va_arg(args, gboolean);
215 gboolean show_times = va_arg(args, gboolean);
216 gboolean show_counts = va_arg(args, gboolean);
217 gboolean show_options = va_arg(args, gboolean);
220 const char *stack_s = get_cluster_stack(data_set);
224 out->message(out,
"cluster-stack", stack_s);
228 if (data_set->
dc_node == NULL || show_dc) {
230 data_set->
input, LOG_DEBUG);
231 const char *dc_version_s = dc_version?
238 out->message(out,
"cluster-dc", data_set->
dc_node, quorum, dc_version_s, dc_name);
249 out->message(out,
"cluster-times", last_written, user, client, origin);
254 out->message(out,
"cluster-counts", g_list_length(data_set->
nodes),
261 out->message(out,
"cluster-options", data_set);
273 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"gboolean",
"gboolean",
"gboolean",
274 "gboolean",
"gboolean",
"gboolean")
278 gboolean print_clone_detail = va_arg(args, gboolean);
279 gboolean show_stack = va_arg(args, gboolean);
280 gboolean show_dc = va_arg(args, gboolean);
281 gboolean show_times = va_arg(args, gboolean);
282 gboolean show_counts = va_arg(args, gboolean);
283 gboolean show_options = va_arg(args, gboolean);
286 const char *stack_s = get_cluster_stack(data_set);
290 out->message(out,
"cluster-stack", stack_s);
294 if (data_set->
dc_node == NULL || show_dc) {
296 data_set->
input, LOG_DEBUG);
297 const char *dc_version_s = dc_version?
304 out->message(out,
"cluster-dc", data_set->
dc_node, quorum, dc_version_s, dc_name);
315 out->message(out,
"cluster-times", last_written, user, client, origin);
320 out->message(out,
"cluster-counts", g_list_length(data_set->
nodes),
332 out->begin_list(out, NULL, NULL,
"Config Options");
333 out->message(out,
"cluster-options", data_set);
349 const char *node_host = NULL;
350 const char *node_id = NULL;
359 if (host_node && host_node->
details) {
362 if (node_host == NULL) {
375 name_len += strlen(node_host) + 1;
378 name_len += strlen(node_id) + 3;
382 node_name = malloc(name_len);
386 strcat(node_name,
"@");
387 strcat(node_name, node_host);
390 strcat(node_name,
" (");
391 strcat(node_name, node_id);
392 strcat(node_name,
")");
399 ,
size_t pairs_count, ...)
401 xmlNodePtr xml_node = NULL;
410 : xmlNewChild(xml_node, NULL, (
pcmkXmlStr) tag_name, NULL);
412 va_start(args, pairs_count);
413 while(pairs_count--) {
414 const char *param_name = va_arg(args,
const char *);
415 const char *param_value = va_arg(args,
const char *);
416 if (param_name && param_value) {
433 gboolean print_clone_detail = va_arg(args, gboolean);
453 gboolean print_clone_detail = va_arg(args, gboolean);
456 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
471 gboolean print_clone_detail G_GNUC_UNUSED = va_arg(args, gboolean);
473 char *weight_s = crm_itoa(pe_node->
weight);
492 unsigned int nnodes = va_arg(args,
unsigned int);
493 int nresources = va_arg(args,
int);
494 int ndisabled = va_arg(args,
int);
495 int nblocked = va_arg(args,
int);
503 if (ndisabled && nblocked) {
518 " from further action due to failure)");
519 }
else if (ndisabled && !nblocked) {
528 }
else if (!ndisabled && nblocked) {
537 " from further action due to failure)");
551 unsigned int nnodes = va_arg(args,
unsigned int);
552 int nresources = va_arg(args,
int);
553 int ndisabled = va_arg(args,
int);
554 int nblocked = va_arg(args,
int);
556 out->list_item(out, NULL,
"%d node%s configured",
559 if (ndisabled && nblocked) {
560 out->list_item(out, NULL,
"%d resource instance%s configured " 561 "(%d DISABLED, %d BLOCKED from " 562 "further action due to failure)",
565 }
else if (ndisabled && !nblocked) {
566 out->list_item(out, NULL,
"%d resource instance%s configured " 569 }
else if (!ndisabled && nblocked) {
570 out->list_item(out, NULL,
"%d resource instance%s configured " 571 "(%d BLOCKED from further action " 575 out->list_item(out, NULL,
"%d resource instance%s configured",
588 unsigned int nnodes = va_arg(args,
unsigned int);
589 int nresources = va_arg(args,
int);
590 int ndisabled = va_arg(args,
int);
591 int nblocked = va_arg(args,
int);
593 char *s = crm_itoa(nnodes);
597 s = crm_itoa(nresources);
601 s = crm_itoa(ndisabled);
605 s = crm_itoa(nblocked);
612 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
618 const char *quorum = va_arg(args,
const char *);
619 const char *dc_version_s = va_arg(args,
const char *);
620 char *dc_name = va_arg(args,
char *);
627 dc_name, dc_version_s ? dc_version_s :
"unknown");
632 dc_name, dc_version_s ? dc_version_s :
"unknown");
646 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
650 const char *quorum = va_arg(args,
const char *);
651 const char *dc_version_s = va_arg(args,
const char *);
652 char *dc_name = va_arg(args,
char *);
655 out->list_item(out,
"Current DC",
"%s (version %s) - partition %s quorum",
656 dc_name, dc_version_s ? dc_version_s :
"unknown",
659 out->list_item(out,
"Current DC",
"NONE");
665 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
671 const char *quorum = va_arg(args,
const char *);
672 const char *dc_version_s = va_arg(args,
const char *);
673 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
692 unsigned long long flags = va_arg(args,
unsigned long long);
695 fprintf(out->dest,
"\n *** Resource management is DISABLED ***");
696 fprintf(out->dest,
"\n The cluster will not attempt to start, stop or recover services");
697 fprintf(out->dest,
"\n");
700 fprintf(out->dest,
"\n *** Resource management is DISABLED ***");
701 fprintf(out->dest,
"\n The cluster will keep all resources stopped");
702 fprintf(out->dest,
"\n");
714 out->list_item(out, NULL,
"STONITH of failed nodes %s",
717 out->list_item(out, NULL,
"Cluster is %s",
722 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
726 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
730 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 731 "resources and stop all other resources");
735 out->list_item(out, NULL,
"No quorum policy: Ignore");
739 out->list_item(out, NULL,
"No quorum policy: Suicide");
749 " (the cluster will not attempt to start, stop, or recover services)");
756 " (the cluster will keep all resources stopped)");
758 out->list_item(out, NULL,
"Resource management: enabled");
770 out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
773 out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
785 out->list_item(out, NULL,
"STONITH of failed nodes %s",
788 out->list_item(out, NULL,
"Cluster is %s",
793 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
797 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
801 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 802 "resources and stop all other resources");
806 out->list_item(out, NULL,
"No quorum policy: Ignore");
810 out->list_item(out, NULL,
"No quorum policy: Suicide");
823 xmlSetProp(node, (
pcmkXmlStr)
"stonith-enabled",
825 xmlSetProp(node, (
pcmkXmlStr)
"symmetric-cluster",
850 xmlSetProp(node, (
pcmkXmlStr)
"maintenance-mode",
852 xmlSetProp(node, (
pcmkXmlStr)
"stop-all-resources",
862 const char *stack_s = va_arg(args,
const char *);
873 const char *stack_s = va_arg(args,
const char *);
874 out->list_item(out,
"Stack",
"%s", stack_s);
882 const char *stack_s = va_arg(args,
const char *);
889 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
895 const char *last_written = va_arg(args,
const char *);
896 const char *user = va_arg(args,
const char *);
897 const char *client = va_arg(args,
const char *);
898 const char *origin = va_arg(args,
const char *);
900 char *buf = last_changed_string(last_written, user, client, origin);
913 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
919 const char *last_written = va_arg(args,
const char *);
920 const char *user = va_arg(args,
const char *);
921 const char *client = va_arg(args,
const char *);
922 const char *origin = va_arg(args,
const char *);
934 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
937 const char *last_written = va_arg(args,
const char *);
938 const char *user = va_arg(args,
const char *);
939 const char *client = va_arg(args,
const char *);
940 const char *origin = va_arg(args,
const char *);
942 char *buf = last_changed_string(last_written, user, client, origin);
945 out->list_item(out,
"Last change",
" %s", buf);
954 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
955 char *s = failed_action_string(xml_op);
957 out->list_item(out, NULL,
"%s", s);
965 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
973 char *rc_s = crm_itoa(
rc);
974 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
977 xmlSetProp(node, (
pcmkXmlStr) (op_key ?
"op_key" :
"id"),
988 (
pcmkXmlStr) services_lrm_status_str(status));
991 guint interval_ms = 0;
995 char *rc_change = NULL;
998 s = crm_itoa(interval_ms);
1023 "gboolean",
"gboolean",
"gboolean",
"GListPtr",
"GListPtr")
1027 unsigned int print_opts = va_arg(args,
unsigned int);
1028 gboolean full = va_arg(args, gboolean);
1029 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1030 gboolean print_clone_detail = va_arg(args, gboolean);
1031 gboolean print_brief = va_arg(args, gboolean);
1032 gboolean group_by_node = va_arg(args, gboolean);
1061 if (print_brief && group_by_node) {
1065 out->begin_list(out, NULL, NULL, NULL);
1070 }
else if (group_by_node) {
1073 out->begin_list(out, NULL, NULL, NULL);
1077 rsc, only_node, only_rsc);
1082 out->begin_list(out, NULL, NULL,
"%s", buf);
1090 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1091 "gboolean",
"gboolean",
"gboolean",
"GListPtr",
"GListPtr")
1095 unsigned int print_opts = va_arg(args,
unsigned int);
1096 gboolean full = va_arg(args, gboolean);
1097 const char *node_mode = va_arg(args,
const char *);
1098 gboolean print_clone_detail = va_arg(args, gboolean);
1099 gboolean print_brief = va_arg(args, gboolean);
1100 gboolean group_by_node = va_arg(args, gboolean);
1118 if (group_by_node) {
1123 out->begin_list(out, NULL, NULL,
"%s", buf);
1124 out->begin_list(out, NULL, NULL,
"Resources");
1135 out->begin_list(out, NULL, NULL,
"%s", buf);
1136 out->begin_list(out, NULL, NULL,
"Resources");
1141 rsc, only_node, only_rsc);
1148 out->list_item(out, NULL,
"%s", buf);
1160 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1161 "gboolean",
"gboolean",
"gboolean",
"GListPtr",
"GListPtr")
1165 unsigned int print_opts = va_arg(args,
unsigned int);
1166 gboolean full = va_arg(args, gboolean);
1167 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1168 gboolean print_clone_detail G_GNUC_UNUSED = va_arg(args, gboolean);
1169 gboolean print_brief G_GNUC_UNUSED = va_arg(args, gboolean);
1170 gboolean group_by_node = va_arg(args, gboolean);
1201 "resources_running", length_s,
1206 xmlSetProp(xml_node, (
pcmkXmlStr)
"id_as_resource",
1210 if (group_by_node) {
1216 rsc, only_node, only_rsc);
1231 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1234 const char *
name = va_arg(args,
const char *);
1235 const char *value = va_arg(args,
const char *);
1236 gboolean add_extra = va_arg(args, gboolean);
1237 int expected_score = va_arg(args,
int);
1244 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
1245 }
else if (v < expected_score) {
1246 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
1248 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1251 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1257 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1260 const char *
name = va_arg(args,
const char *);
1261 const char *value = va_arg(args,
const char *);
1262 gboolean add_extra = va_arg(args, gboolean);
1263 int expected_score = va_arg(args,
int);
1275 }
else if (v < expected_score) {
1276 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
1281 out->list_item(out, NULL,
"%s: %s",
name, value);
1287 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1290 const char *
name = va_arg(args,
const char *);
1291 const char *value = va_arg(args,
const char *);
1292 gboolean add_extra = va_arg(args, gboolean);
1293 int expected_score = va_arg(args,
int);
1300 char *buf = crm_itoa(expected_score);
1308 PCMK__OUTPUT_ARGS(
"node-list",
"GListPtr",
"GListPtr",
"GListPtr",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
1314 unsigned int print_opts = va_arg(args,
unsigned int);
1315 gboolean print_clone_detail = va_arg(args, gboolean);
1316 gboolean print_brief = va_arg(args, gboolean);
1317 gboolean group_by_node = va_arg(args, gboolean);
1321 for (
GListPtr gIter = nodes; gIter != NULL; gIter = gIter->next) {
1330 out->message(out,
"node", node, print_opts, TRUE, NULL, print_clone_detail,
1331 print_brief, group_by_node, only_node, only_rsc);
1338 PCMK__OUTPUT_ARGS(
"node-list",
"GListPtr",
"GListPtr",
"GListPtr",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
1344 unsigned int print_opts = va_arg(args,
unsigned int);
1345 gboolean print_clone_detail = va_arg(args, gboolean);
1346 gboolean print_brief = va_arg(args, gboolean);
1347 gboolean group_by_node = va_arg(args, gboolean);
1350 char *online_nodes = NULL;
1351 char *online_remote_nodes = NULL;
1352 char *online_guest_nodes = NULL;
1353 char *offline_nodes = NULL;
1354 char *offline_remote_nodes = NULL;
1356 size_t online_nodes_len = 0;
1357 size_t online_remote_nodes_len = 0;
1358 size_t online_guest_nodes_len = 0;
1359 size_t offline_nodes_len = 0;
1360 size_t offline_remote_nodes_len = 0;
1364 for (
GListPtr gIter = nodes; gIter != NULL; gIter = gIter->next) {
1366 const char *node_mode = NULL;
1379 node_mode =
"UNCLEAN (online)";
1382 node_mode =
"UNCLEAN (pending)";
1385 node_mode =
"UNCLEAN (offline)";
1389 node_mode =
"pending";
1392 node_mode =
"standby (on-fail)";
1397 node_mode =
"standby (with active resources)";
1399 node_mode =
"standby";
1402 node_mode =
"OFFLINE (standby)";
1407 node_mode =
"maintenance";
1409 node_mode =
"OFFLINE (maintenance)";
1413 node_mode =
"online";
1414 if (group_by_node == FALSE) {
1416 pcmk__add_word(&online_guest_nodes,
1417 &online_guest_nodes_len, node_name);
1419 pcmk__add_word(&online_remote_nodes,
1420 &online_remote_nodes_len, node_name);
1422 pcmk__add_word(&online_nodes, &online_nodes_len, node_name);
1429 node_mode =
"OFFLINE";
1430 if (group_by_node == FALSE) {
1432 pcmk__add_word(&offline_remote_nodes,
1433 &offline_remote_nodes_len, node_name);
1437 pcmk__add_word(&offline_nodes,
1438 &offline_nodes_len, node_name);
1446 out->message(out,
"node", node, print_opts, TRUE, node_mode, print_clone_detail,
1447 print_brief, group_by_node, only_node, only_rsc);
1453 out->list_item(out,
"Online",
"[ %s ]", online_nodes);
1456 if (offline_nodes) {
1457 out->list_item(out,
"OFFLINE",
"[ %s ]", offline_nodes);
1458 free(offline_nodes);
1460 if (online_remote_nodes) {
1461 out->list_item(out,
"RemoteOnline",
"[ %s ]", online_remote_nodes);
1462 free(online_remote_nodes);
1464 if (offline_remote_nodes) {
1465 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]", offline_remote_nodes);
1466 free(offline_remote_nodes);
1468 if (online_guest_nodes) {
1469 out->list_item(out,
"GuestOnline",
"[ %s ]", online_guest_nodes);
1470 free(online_guest_nodes);
1477 PCMK__OUTPUT_ARGS(
"node-list",
"GListPtr",
"GListPtr",
"GListPtr",
"unsigned int",
"gboolean",
"gboolean",
"gboolean")
1483 unsigned int print_opts = va_arg(args,
unsigned int);
1484 gboolean print_clone_detail = va_arg(args, gboolean);
1485 gboolean print_brief = va_arg(args, gboolean);
1486 gboolean group_by_node = va_arg(args, gboolean);
1488 out->begin_list(out, NULL, NULL,
"nodes");
1489 for (
GListPtr gIter = nodes; gIter != NULL; gIter = gIter->next) {
1496 out->message(out,
"node", node, print_opts, TRUE, NULL, print_clone_detail,
1497 print_brief, group_by_node, only_node, only_rsc);
1504 PCMK__OUTPUT_ARGS(
"op-history",
"struct xmlNode *",
"const char *",
"const char *",
"int",
"gboolean")
1507 xmlNode *xml_op = va_arg(args, xmlNode *);
1508 const char *task = va_arg(args,
const char *);
1509 const char *interval_ms_s = va_arg(args,
const char *);
1510 int rc = va_arg(args,
int);
1511 gboolean print_timing = va_arg(args, gboolean);
1513 char *buf = op_history_string(xml_op, task, interval_ms_s,
rc, print_timing);
1515 out->list_item(out, NULL,
"%s", buf);
1521 PCMK__OUTPUT_ARGS(
"op-history",
"struct xmlNode *",
"const char *",
"const char *",
"int",
"gboolean")
1524 xmlNode *xml_op = va_arg(args, xmlNode *);
1525 const char *task = va_arg(args,
const char *);
1526 const char *interval_ms_s = va_arg(args,
const char *);
1527 int rc = va_arg(args,
int);
1528 gboolean print_timing = va_arg(args, gboolean);
1538 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
1545 const char *value = NULL;
1550 if (int_value > 0) {
1559 if (int_value > 0) {
1579 rc_s = crm_itoa(
rc);
1586 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
1590 const char *rsc_id = va_arg(args,
const char *);
1591 gboolean all = va_arg(args, gboolean);
1592 int failcount = va_arg(args,
int);
1593 time_t last_failure = va_arg(args,
int);
1594 gboolean as_header = va_arg(args, gboolean);
1596 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
1599 out->begin_list(out, NULL, NULL,
"%s", buf);
1601 out->list_item(out, NULL,
"%s", buf);
1608 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
1612 const char *rsc_id = va_arg(args,
const char *);
1613 gboolean all = va_arg(args, gboolean);
1614 int failcount = va_arg(args,
int);
1615 time_t last_failure = va_arg(args,
int);
1616 gboolean as_header = va_arg(args, gboolean);
1623 }
else if (all || failcount || last_failure > 0) {
1627 xmlSetProp(node, (
pcmkXmlStr)
"migration-threshold",
1631 if (failcount > 0) {
1632 char *s = crm_itoa(failcount);
1639 if (last_failure > 0) {
1645 if (as_header == FALSE) {
1653 "gboolean",
"gboolean",
"gboolean",
"GListPtr",
"GListPtr",
"gboolean")
1658 unsigned int print_opts = va_arg(args,
unsigned int);
1659 gboolean group_by_node = va_arg(args, gboolean);
1660 gboolean inactive_resources = va_arg(args, gboolean);
1661 gboolean brief_output = va_arg(args, gboolean);
1662 gboolean print_summary = va_arg(args, gboolean);
1665 gboolean print_spacer = va_arg(args, gboolean);
1673 if (group_by_node && !inactive_resources) {
1679 if (group_by_node) {
1681 out->begin_list(out, NULL, NULL,
"Inactive Resources");
1682 }
else if (inactive_resources) {
1683 out->begin_list(out, NULL, NULL,
"Full List of Resources");
1685 out->begin_list(out, NULL, NULL,
"Active Resources");
1690 if (brief_output && !group_by_node) {
1698 for (rsc_iter = data_set->
resources; rsc_iter != NULL; rsc_iter = rsc_iter->next) {
1703 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
1704 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
1711 }
else if (group_by_node) {
1723 }
else if (!partially_active && !inactive_resources) {
1731 x = out->message(out, crm_map_element_name(rsc->
xml), print_opts, rsc,
1732 only_node, only_rsc);
1739 if (group_by_node) {
1740 out->list_item(out, NULL,
"No inactive resources");
1741 }
else if (inactive_resources) {
1742 out->list_item(out, NULL,
"No resources");
1744 out->list_item(out, NULL,
"No active resources");
1759 out->list_item(out, NULL,
"%s:\t%s%s %s", ticket->
id,
1760 ticket->
granted ?
"granted" :
"revoked",
1761 ticket->
standby ?
" [standby]" :
"",
1765 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
1766 ticket->
granted ?
"granted" :
"revoked",
1767 ticket->
standby ?
" [standby]" :
"");
1780 out->list_item(out, ticket->
id,
"\t%s%s %s",
1781 ticket->
granted ?
"granted" :
"revoked",
1782 ticket->
standby ?
" [standby]" :
"",
1786 out->list_item(out, ticket->
id,
"\t%s%s",
1787 ticket->
granted ?
"granted" :
"revoked",
1788 ticket->
standby ?
" [standby]" :
"");
1797 xmlNodePtr node = NULL;
1808 xmlSetProp(node, (
pcmkXmlStr)
"last-granted",
1887 { NULL, NULL, NULL }
1904 crm_trace(
"%sNode %s: (weight=%d, fixed=%s)",
1909 char *pe_mutable = strdup(
"\t\t");
1913 all = g_list_prepend(all, strdup(
"*"));
1921 for (; gIter != NULL; gIter = gIter->next) {
1924 out->
message(out, crm_map_element_name(rsc->
xml),
1928 g_list_free_full(all, free);
#define XML_RSC_OP_LAST_CHANGE
#define XML_ATTR_UPDATE_ORIG
enum rsc_role_e role_filter
enum pe_quorum_policy no_quorum_policy
#define XML_ATTR_UPDATE_CLIENT
int pe__cluster_times_xml(pcmk__output_t *out, va_list args)
int pe__cluster_counts_html(pcmk__output_t *out, va_list args)
int pe__node_list_text(pcmk__output_t *out, va_list args)
int pe__ticket_html(pcmk__output_t *out, va_list args)
#define crm_time_log_timeofday
int pe__cluster_summary(pcmk__output_t *out, va_list args)
bool pe__rsc_running_on_any_node_in_list(pe_resource_t *rsc, GListPtr node_list)
pe_resource_t * container
int(* message)(pcmk__output_t *out, const char *message_id,...)
int pe__cluster_options_log(pcmk__output_t *out, va_list args)
struct crm_time_s crm_time_t
#define pe_flag_symmetric_cluster
int pe__failed_action_xml(pcmk__output_t *out, va_list args)
gboolean pcmk__str_in_list(GList *lst, const gchar *s)
#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)
int pe__cluster_counts_text(pcmk__output_t *out, va_list args)
#define XML_ATTR_UPDATE_USER
pe_resource_t * remote_rsc
int pe__failed_action_text(pcmk__output_t *out, va_list args)
int pe__cluster_dc_html(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_T_EXEC
resource_object_functions_t * fns
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name, size_t pairs_count,...)
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
xmlNodePtr pcmk__output_xml_peek_parent(pcmk__output_t *out)
int pe__cluster_dc_text(pcmk__output_t *out, va_list args)
int pe__cluster_stack_text(pcmk__output_t *out, va_list args)
int pe__cluster_stack_html(pcmk__output_t *out, va_list args)
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
char * pcmk_format_nvpair(const char *name, const char *value, const char *units)
int pe__resource_text(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_T_QUEUE
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
int pe__bundle_html(pcmk__output_t *out, va_list args)
char * pcmk_format_named_time(const char *name, time_t epoch_time)
int pe__node_attribute_xml(pcmk__output_t *out, va_list args)
#define pe_flag_stop_everything
int pe__clone_html(pcmk__output_t *out, va_list args)
int pe__cluster_options_html(pcmk__output_t *out, va_list args)
#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 pe__cluster_times_text(pcmk__output_t *out, va_list args)
int pe__node_list_xml(pcmk__output_t *out, va_list args)
int pe__ticket_xml(pcmk__output_t *out, va_list args)
PCMK__OUTPUT_ARGS("cluster-summary", "pe_working_set_t *", "gboolean", "gboolean", "gboolean", "gboolean", "gboolean", "gboolean")
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)
int pe__cluster_options_text(pcmk__output_t *out, va_list args)
int pe__ticket_text(pcmk__output_t *out, va_list args)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr node)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
bool pe__is_guest_node(const pe_node_t *node)
char * pe__node_display_name(pe_node_t *node, bool print_detail)
int pe__resource_history_text(pcmk__output_t *out, va_list args)
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)
void crm_time_set_timet(crm_time_t *target, time_t *source)
int pe__cluster_options_xml(pcmk__output_t *out, va_list args)
#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_ATTR_HAVE_QUORUM
int pe__cluster_times_html(pcmk__output_t *out, va_list args)
int pe__cluster_maint_mode_text(pcmk__output_t *out, va_list args)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
#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.
#define PCMK__FAIL_COUNT_PREFIX
void pe__output_node(pe_node_t *node, gboolean details, pcmk__output_t *out)
int pe__cluster_counts_xml(pcmk__output_t *out, va_list args)
int pe__cluster_summary_html(pcmk__output_t *out, va_list args)
#define XML_LRM_ATTR_EXIT_REASON
#define crm_time_log_with_timezone
enum pe_obj_types variant
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
int pe__resource_history_xml(pcmk__output_t *out, va_list args)
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
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
void void xmlNodePtr pcmk__output_xml_create_parent(pcmk__output_t *out, const char *name)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
int pe__op_history_text(pcmk__output_t *out, va_list args)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
int pe__clone_text(pcmk__output_t *out, va_list args)
int pe__op_history_xml(pcmk__output_t *out, va_list args)
int pe__resource_list(pcmk__output_t *out, va_list args)
int pe__node_attribute_html(pcmk__output_t *out, va_list args)
int pe__node_text(pcmk__output_t *out, va_list args)
#define XML_CIB_ATTR_WRITTEN
crm_time_t * crm_time_new(const char *string)
int pe__node_list_html(pcmk__output_t *out, va_list args)
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
#define XML_LRM_ATTR_OPSTATUS
int pe__resource_html(pcmk__output_t *out, va_list args)
#define pcmk__plural_s(i)
void pcmk__register_messages(pcmk__output_t *out, pcmk__message_entry_t *table)
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name)
int pe__ban_html(pcmk__output_t *out, va_list args)
int pe__node_html(pcmk__output_t *out, va_list args)
gboolean crm_is_true(const char *s)
int pe__cluster_stack_xml(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_LAST_RUN
int pe__node_attribute_text(pcmk__output_t *out, va_list args)
char * crm_xml_escape(const char *text)
void print_str_str(gpointer key, gpointer value, gpointer user_data)
int pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
int pe__cluster_dc_xml(pcmk__output_t *out, va_list args)
void pe__register_messages(pcmk__output_t *out)
int pe__ban_xml(pcmk__output_t *out, va_list args)
#define crm_time_log_date
int pe__ban_text(pcmk__output_t *out, va_list args)
gboolean(* active)(pe_resource_t *, gboolean)
GListPtr pe__filter_rsc_list(GListPtr rscs, GListPtr filter)
void crm_time_free(crm_time_t *dt)