24 const char * desc = NULL;
34 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \ 35 PCMK__NODE_ATTR_SHUTDOWN, PCMK_NODE_ATTR_TERMINATE, \ 36 PCMK_NODE_ATTR_STANDBY, "#", NULL } 39 compare_attribute(gconstpointer a, gconstpointer b)
43 rc = strcmp((
const char *)a, (
const char *)b);
64 add_extra_info(
const pcmk_node_t *node, GList *rsc_list,
70 for (gIter = rsc_list; gIter != NULL; gIter = gIter->next) {
74 const char *
name = NULL;
75 GHashTable *params = NULL;
79 attrname, expected_score)) {
97 int host_list_num = 0;
98 const char *hosts = g_hash_table_lookup(params,
"host_list");
99 const char *multiplier = g_hash_table_lookup(params,
"multiplier");
103 char **host_list = g_strsplit(hosts,
" ", 0);
104 host_list_num = g_strv_length(host_list);
105 g_strfreev(host_list);
108 if ((multiplier == NULL)
117 *expected_score = host_list_num * multiplier_i;
126 filter_attr_list(GList *attr_list,
char *
name)
134 for (i = 0; filt_str[i] != NULL; i++) {
135 if (g_str_has_prefix(
name, filt_str[i])) {
140 return g_list_insert_sorted(attr_list,
name, compare_attribute);
144 get_operation_list(xmlNode *rsc_entry) {
145 GList *op_list = NULL;
146 xmlNode *rsc_op = NULL;
169 op_list = g_list_append(op_list, rsc_op);
177 add_dump_node(gpointer key, gpointer value, gpointer user_data)
179 xmlNodePtr node = user_data;
186 append_dump_text(gpointer key, gpointer value, gpointer user_data)
188 char **dump_text = user_data;
190 *dump_text, (
char *)key, (
char *)value);
193 *dump_text = new_text;
196 #define XPATH_STACK "//" PCMK_XE_NVPAIR \ 197 "[@" PCMK_XA_NAME "='" \ 198 PCMK_OPT_CLUSTER_INFRASTRUCTURE "']" 212 last_changed_string(
const char *last_written,
const char *user,
213 const char *client,
const char *origin) {
214 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
216 last_written ? last_written :
"",
219 client ?
" via " :
"",
220 client ? client :
"",
221 origin ?
" on " :
"",
222 origin ? origin :
"");
229 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
230 int rc,
bool print_timing) {
232 char *interval_str = NULL;
235 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
242 char *last_change_str = NULL;
243 char *exec_str = NULL;
244 char *queue_str = NULL;
246 const char *value = NULL;
257 pcmk__s(epoch_str,
""));
276 interval_str ? interval_str :
"",
277 last_change_str ? last_change_str :
"",
278 exec_str ? exec_str :
"",
279 queue_str ? queue_str :
"",
282 if (last_change_str) {
283 free(last_change_str);
295 interval_str ?
":" :
"",
296 interval_str ? interval_str :
"");
307 resource_history_string(
pcmk_resource_t *rsc,
const char *rsc_id,
bool all,
308 int failcount, time_t last_failure) {
313 }
else if (all || failcount || last_failure > 0) {
314 char *failcount_s = NULL;
315 char *lastfail_s = NULL;
321 failcount_s = strdup(
"");
323 if (last_failure > 0) {
332 failcount_s, pcmk__s(lastfail_s,
""));
357 && !pcmk__is_pacemaker_remote_node(node)) {
359 const char *feature_set = g_hash_table_lookup(node->
priv->
attrs,
365 return pcmk__s(feature_set,
"<3.15.1");
373 const char *feature_set = NULL;
374 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
376 const char *node_feature_set = get_node_feature_set(node);
377 if (node_feature_set != NULL) {
378 if (feature_set == NULL) {
379 feature_set = node_feature_set;
380 }
else if (strcmp(feature_set, node_feature_set) != 0) {
389 formatted_xml_buf(
const pcmk_resource_t *rsc, GString *xml_buf,
bool raw)
399 #define XPATH_DC_VERSION "//" PCMK_XE_NVPAIR \ 400 "[@" PCMK_XA_NAME "='" PCMK_OPT_DC_VERSION "']" 402 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pcmk_scheduler_t *",
403 "enum pcmk_pacemakerd_state",
"uint32_t",
"uint32_t")
409 uint32_t section_opts = va_arg(args, uint32_t);
410 uint32_t show_opts = va_arg(args, uint32_t);
413 const char *stack_s = get_cluster_stack(
scheduler);
417 out->message(out,
"cluster-stack", stack_s, pcmkd_state);
423 const char *dc_version_s = dc_version?
429 bool mixed_version = is_mixed_version(
scheduler);
433 dc_version_s, dc_name, mixed_version);
449 last_written, user, client, origin);
454 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
462 out->message(out,
"cluster-options",
scheduler);
476 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pcmk_scheduler_t *",
477 "enum pcmk_pacemakerd_state",
"uint32_t",
"uint32_t")
483 uint32_t section_opts = va_arg(args, uint32_t);
484 uint32_t show_opts = va_arg(args, uint32_t);
487 const char *stack_s = get_cluster_stack(
scheduler);
491 out->message(out,
"cluster-stack", stack_s, pcmkd_state);
499 const char *dc_version_s = dc_version?
505 bool mixed_version = is_mixed_version(
scheduler);
509 dc_version_s, dc_name, mixed_version);
525 last_written, user, client, origin);
530 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
543 out->begin_list(out, NULL, NULL,
"Config Options");
544 out->message(out,
"cluster-options",
scheduler);
562 const char *node_host = NULL;
563 const char *node_id = NULL;
569 if (print_detail && pcmk__is_guest_or_bundle_node(node)) {
574 host_node = pcmk__current_node(launcher);
576 if (host_node && host_node->
details) {
579 if (node_host == NULL) {
592 name_len = strlen(node->
priv->
name) + 1;
594 name_len += strlen(node_host) + 1;
597 name_len += strlen(node_id) + 3;
602 strcpy(node_name, node->
priv->
name);
604 strcat(node_name,
"@");
605 strcat(node_name, node_host);
608 strcat(node_name,
" (");
609 strcat(node_name, node_id);
610 strcat(node_name,
")");
619 xmlNodePtr xml_node = NULL;
628 va_start(pairs, tag_name);
647 PCMK__OUTPUT_ARGS(
"ban",
"pcmk_node_t *",
"pcmk__location_t *",
"uint32_t")
652 uint32_t show_opts = va_arg(args, uint32_t);
657 location->
id, location->
rsc->
id,
667 PCMK__OUTPUT_ARGS(
"ban",
"pcmk_node_t *",
"pcmk__location_t *",
"uint32_t")
672 uint32_t show_opts = va_arg(args, uint32_t);
676 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
677 location->
id, location->
rsc->
id,
684 PCMK__OUTPUT_ARGS(
"ban",
"pcmk_node_t *",
"pcmk__location_t *",
"uint32_t")
689 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
692 char *weight_s = pcmk__itoa(pe_node->
assign->
score);
713 PCMK__OUTPUT_ARGS(
"ban-list",
"pcmk_scheduler_t *",
"const char *",
"GList *",
718 const char *prefix = va_arg(args,
const char *);
719 GList *only_rsc = va_arg(args, GList *);
720 uint32_t show_opts = va_arg(args, uint32_t);
721 bool print_spacer = va_arg(args,
int);
723 GList *gIter, *gIter2;
728 gIter != NULL; gIter = gIter->next) {
732 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
743 for (gIter2 = location->
nodes; gIter2 != NULL; gIter2 = gIter2->next) {
748 out->message(out,
"ban", node, location, show_opts);
757 PCMK__OUTPUT_ARGS(
"cluster-counts",
"unsigned int",
"int",
"int",
"int")
760 unsigned int nnodes = va_arg(args,
unsigned int);
761 int nresources = va_arg(args,
int);
762 int ndisabled = va_arg(args,
int);
763 int nblocked = va_arg(args,
int);
767 xmlNode *child = NULL;
773 if (ndisabled && nblocked) {
792 }
else if (ndisabled && !nblocked) {
805 }
else if (!ndisabled && nblocked) {
827 PCMK__OUTPUT_ARGS(
"cluster-counts",
"unsigned int",
"int",
"int",
"int")
830 unsigned int nnodes = va_arg(args,
unsigned int);
831 int nresources = va_arg(args,
int);
832 int ndisabled = va_arg(args,
int);
833 int nblocked = va_arg(args,
int);
835 out->list_item(out, NULL,
"%d node%s configured",
838 if (ndisabled && nblocked) {
839 out->list_item(out, NULL,
"%d resource instance%s configured " 840 "(%d DISABLED, %d BLOCKED from " 841 "further action due to failure)",
844 }
else if (ndisabled && !nblocked) {
845 out->list_item(out, NULL,
"%d resource instance%s configured " 848 }
else if (!ndisabled && nblocked) {
849 out->list_item(out, NULL,
"%d resource instance%s configured " 850 "(%d BLOCKED from further action " 854 out->list_item(out, NULL,
"%d resource instance%s configured",
861 PCMK__OUTPUT_ARGS(
"cluster-counts",
"unsigned int",
"int",
"int",
"int")
864 unsigned int nnodes = va_arg(args,
unsigned int);
865 int nresources = va_arg(args,
int);
866 int ndisabled = va_arg(args,
int);
867 int nblocked = va_arg(args,
int);
869 xmlNodePtr nodes_node = NULL;
870 xmlNodePtr resources_node = NULL;
879 s = pcmk__itoa(nnodes);
883 s = pcmk__itoa(nresources);
887 s = pcmk__itoa(ndisabled);
891 s = pcmk__itoa(nblocked);
898 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pcmk_node_t *",
"const char *",
"const char *",
903 const char *quorum = va_arg(args,
const char *);
904 const char *dc_version_s = va_arg(args,
const char *);
905 char *dc_name = va_arg(args,
char *);
906 bool mixed_version = va_arg(args,
int);
909 xmlNode *child = NULL;
917 dc_name, pcmk__s(dc_version_s,
"unknown"));
950 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pcmk_node_t *",
"const char *",
"const char *",
955 const char *quorum = va_arg(args,
const char *);
956 const char *dc_version_s = va_arg(args,
const char *);
957 char *dc_name = va_arg(args,
char *);
958 bool mixed_version = va_arg(args,
int);
961 out->list_item(out,
"Current DC",
962 "%s (version %s) - %spartition %s quorum",
963 dc_name, dc_version_s ? dc_version_s :
"unknown",
964 mixed_version ?
"MIXED-VERSION " :
"",
967 out->list_item(out,
"Current DC",
"NONE");
973 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pcmk_node_t *",
"const char *",
"const char *",
978 const char *quorum = va_arg(args,
const char *);
979 const char *dc_version_s = va_arg(args,
const char *);
980 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
981 bool mixed_version = va_arg(args,
int);
984 const char *with_quorum = pcmk__btoa(
crm_is_true(quorum));
985 const char *mixed_version_s = pcmk__btoa(mixed_version);
1004 PCMK__OUTPUT_ARGS(
"maint-mode",
"uint64_t")
1007 uint64_t
flags = va_arg(args, uint64_t);
1022 PCMK__OUTPUT_ARGS(
"cluster-options",
"pcmk_scheduler_t *")
1028 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1030 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1034 out->list_item(out, NULL,
"Cluster is symmetric");
1036 out->list_item(out, NULL,
"Cluster is asymmetric");
1041 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1045 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1049 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1050 "resources and stop all other resources");
1054 out->list_item(out, NULL,
"No quorum policy: Ignore");
1058 out->list_item(out, NULL,
1059 "No quorum policy: Fence nodes in partition");
1065 xmlNode *child = NULL;
1075 " (the cluster will not attempt to start, stop," 1076 " or recover services)");
1080 xmlNode *child = NULL;
1090 " (the cluster will keep all resources stopped)");
1093 out->list_item(out, NULL,
"Resource management: enabled");
1099 PCMK__OUTPUT_ARGS(
"cluster-options",
"pcmk_scheduler_t *")
1105 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
1107 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
1113 PCMK__OUTPUT_ARGS(
"cluster-options",
"pcmk_scheduler_t *")
1119 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1121 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1125 out->list_item(out, NULL,
"Cluster is symmetric");
1127 out->list_item(out, NULL,
"Cluster is asymmetric");
1132 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1136 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1140 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1141 "resources and stop all other resources");
1145 out->list_item(out, NULL,
"No quorum policy: Ignore");
1149 out->list_item(out, NULL,
1150 "No quorum policy: Fence nodes in partition");
1189 PCMK__OUTPUT_ARGS(
"cluster-options",
"pcmk_scheduler_t *")
1196 const char *symmetric_cluster =
1198 const char *no_quorum_policy =
1202 const char *stop_all_resources = pcmk__flag_text(
scheduler->
flags,
1204 char *stonith_timeout_ms_s =
1207 char *priority_fencing_delay_ms_s =
1217 stonith_timeout_ms_s,
1219 priority_fencing_delay_ms_s,
1221 free(stonith_timeout_ms_s);
1222 free(priority_fencing_delay_ms_s);
1227 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1230 const char *stack_s = va_arg(args,
const char *);
1235 xmlNode *child = NULL;
1257 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1260 const char *stack_s = va_arg(args,
const char *);
1265 out->list_item(out,
"Stack",
"%s (%s)",
1268 out->list_item(out,
"Stack",
"%s", stack_s);
1274 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1277 const char *stack_s = va_arg(args,
const char *);
1281 const char *state_s = NULL;
1295 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
1296 "const char *",
"const char *",
"const char *")
1299 const char *our_nodename = va_arg(args,
const char *);
1300 const char *last_written = va_arg(args,
const char *);
1301 const char *user = va_arg(args,
const char *);
1302 const char *client = va_arg(args,
const char *);
1303 const char *origin = va_arg(args,
const char *);
1307 xmlNode *child = NULL;
1309 char *time_s = NULL;
1320 if (our_nodename != NULL) {
1333 time_s = last_changed_string(last_written, user, client, origin);
1340 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
1341 "const char *",
"const char *",
"const char *")
1344 const char *our_nodename = va_arg(args,
const char *);
1345 const char *last_written = va_arg(args,
const char *);
1346 const char *user = va_arg(args,
const char *);
1347 const char *client = va_arg(args,
const char *);
1348 const char *origin = va_arg(args,
const char *);
1368 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
1369 "const char *",
"const char *",
"const char *")
1372 const char *our_nodename = va_arg(args,
const char *);
1373 const char *last_written = va_arg(args,
const char *);
1374 const char *user = va_arg(args,
const char *);
1375 const char *client = va_arg(args,
const char *);
1376 const char *origin = va_arg(args,
const char *);
1380 out->list_item(out,
"Last updated",
"%s%s%s",
1381 time_s, (our_nodename != NULL)?
" on " :
"",
1382 pcmk__s(our_nodename,
""));
1385 time_s = last_changed_string(last_written, user, client, origin);
1387 out->list_item(out,
"Last change",
" %s", time_s);
1407 failed_action_friendly(
pcmk__output_t *out,
const xmlNode *xml_op,
1408 const char *op_key,
const char *node_name,
int rc,
1409 int status,
const char *exit_reason,
1410 const char *exec_time)
1412 char *rsc_id = NULL;
1414 guint interval_ms = 0;
1415 time_t last_change_epoch = 0;
1416 GString *str = NULL;
1418 if (pcmk__str_empty(op_key)
1419 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1427 str = g_string_sized_new(256);
1431 if (interval_ms != 0) {
1435 pcmk__g_strcat(str, pcmk__readable_action(task, interval_ms),
" on ",
1440 if (!pcmk__str_empty(exit_reason)) {
1446 pcmk_exec_status_str(status), NULL);
1447 if (!pcmk__str_empty(exit_reason)) {
1450 g_string_append_c(str,
')');
1455 &last_change_epoch) ==
pcmk_ok) {
1461 if (!pcmk__str_empty(exec_time)) {
1462 int exec_time_ms = 0;
1465 && (exec_time_ms > 0)) {
1472 out->
list_item(out, NULL,
"%s", str->str);
1473 g_string_free(str, TRUE);
1492 failed_action_technical(
pcmk__output_t *out,
const xmlNode *xml_op,
1493 const char *op_key,
const char *node_name,
int rc,
1494 int status,
const char *exit_reason,
1495 const char *exec_time)
1500 const char *lrm_status = pcmk_exec_status_str(status);
1501 time_t last_change_epoch = 0;
1502 GString *str = NULL;
1504 if (pcmk__str_empty(op_key)) {
1505 op_key =
"unknown operation";
1507 if (pcmk__str_empty(exit_status)) {
1508 exit_status =
"unknown exit status";
1510 if (pcmk__str_empty(call_id)) {
1511 call_id =
"unknown";
1514 str = g_string_sized_new(256);
1516 g_string_append_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1517 op_key, node_name, exit_status, rc, call_id,
1520 if (!pcmk__str_empty(exit_reason)) {
1525 &last_change_epoch) ==
pcmk_ok) {
1530 "'", last_change_str,
"'", NULL);
1531 free(last_change_str);
1533 if (!pcmk__str_empty(queue_time)) {
1536 if (!pcmk__str_empty(exec_time)) {
1540 out->
list_item(out, NULL,
"%s", str->str);
1541 g_string_free(str, TRUE);
1544 PCMK__OUTPUT_ARGS(
"failed-action",
"xmlNode *",
"uint32_t")
1548 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1549 uint32_t show_opts = va_arg(args, uint32_t);
1551 const char *op_key = pcmk__xe_history_key(xml_op);
1564 if (pcmk__str_empty(node_name)) {
1565 node_name =
"unknown node";
1569 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1570 exit_reason, exec_time);
1572 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1573 exit_reason, exec_time);
1578 PCMK__OUTPUT_ARGS(
"failed-action",
"xmlNode *",
"uint32_t")
1581 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1582 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1584 const char *op_key = pcmk__xe_history_key(xml_op);
1590 const char *exitstatus = NULL;
1594 const char *status_s = NULL;
1597 gchar *exit_reason_esc = NULL;
1599 xmlNodePtr node = NULL;
1603 exit_reason = exit_reason_esc;
1613 rc_s = pcmk__itoa(rc);
1614 status_s = pcmk_exec_status_str(status);
1616 op_key_name, op_key,
1627 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1632 guint interval_ms = 0;
1633 char *interval_ms_s = NULL;
1650 free(interval_ms_s);
1654 g_free(exit_reason_esc);
1658 PCMK__OUTPUT_ARGS(
"failed-action-list",
"pcmk_scheduler_t *",
"GList *",
1659 "GList *",
"uint32_t",
"bool")
1663 GList *only_node = va_arg(args, GList *);
1664 GList *only_rsc = va_arg(args, GList *);
1665 uint32_t show_opts = va_arg(args, uint32_t);
1666 bool print_spacer = va_arg(args,
int);
1668 xmlNode *xml_op = NULL;
1691 if (!
parse_op_key(pcmk__xe_history_key(xml_op), &rsc, NULL, NULL)) {
1703 out->message(out,
"failed-action", xml_op, show_opts);
1714 xmlNode *child = NULL;
1738 " with active resources)");
1764 }
else if (health == 0) {
1772 const char *feature_set = get_node_feature_set(node);
1773 if (feature_set != NULL) {
1780 PCMK__OUTPUT_ARGS(
"node",
"pcmk_node_t *",
"uint32_t",
"bool",
1781 "GList *",
"GList *")
1785 uint32_t show_opts = va_arg(args, uint32_t);
1786 bool full = va_arg(args,
int);
1787 GList *only_node = va_arg(args, GList *);
1788 GList *only_rsc = va_arg(args, GList *);
1793 xmlNode *item_node = NULL;
1794 xmlNode *child = NULL;
1799 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1803 status_node(node, item_node, show_opts);
1807 out->begin_list(out, NULL, NULL,
"Resources");
1819 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1823 status_node(node, item_node, show_opts);
1831 out->message(out, (
const char *) rsc->
priv->
xml->name,
1832 show_opts, rsc, only_node, only_rsc);
1844 status_node(node, item_node, show_opts);
1847 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1867 return "UNCLEAN (online)";
1870 return "UNCLEAN (pending)";
1873 return "UNCLEAN (offline)";
1885 return "OFFLINE (standby)";
1889 return "standby (with active resources)";
1894 return "maintenance";
1896 return "OFFLINE (maintenance)";
1906 PCMK__OUTPUT_ARGS(
"node",
"pcmk_node_t *",
"uint32_t",
"bool",
"GList *",
1911 uint32_t show_opts = va_arg(args, uint32_t);
1912 bool full = va_arg(args,
int);
1913 GList *only_node = va_arg(args, GList *);
1914 GList *only_rsc = va_arg(args, GList *);
1918 GString *str = g_string_sized_new(64);
1922 if (pcmk__is_guest_or_bundle_node(node)) {
1923 g_string_append(str,
"GuestNode");
1924 }
else if (pcmk__is_remote_node(node)) {
1925 g_string_append(str,
"RemoteNode");
1927 g_string_append(str,
"Node");
1929 pcmk__g_strcat(str,
" ", node_name,
": ", node_text_status(node), NULL);
1932 g_string_append(str,
" (health is RED)");
1933 }
else if (health == 0) {
1934 g_string_append(str,
" (health is YELLOW)");
1937 const char *feature_set = get_node_feature_set(node);
1938 if (feature_set != NULL) {
1950 out->begin_list(out, NULL, NULL,
"%s", str->str);
1951 out->begin_list(out, NULL, NULL,
"Resources");
1962 GList *gIter2 = NULL;
1964 out->begin_list(out, NULL, NULL,
"%s", str->str);
1965 out->begin_list(out, NULL, NULL,
"Resources");
1971 out->message(out, (
const char *) rsc->
priv->
xml->name,
1972 show_opts, rsc, only_node, only_rsc);
1979 out->list_item(out, NULL,
"%s", str->str);
1982 g_string_free(str, TRUE);
1986 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
2004 health_text(
int health)
2008 }
else if (health == 0) {
2038 PCMK__OUTPUT_ARGS(
"node",
"pcmk_node_t *",
"uint32_t",
"bool",
"GList *",
2043 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
2044 bool full = va_arg(args,
int);
2045 GList *only_node = va_arg(args, GList *);
2046 GList *only_rsc = va_arg(args, GList *);
2050 const char *standby = pcmk__flag_text(node->
priv->
flags,
2052 const char *standby_onfail = pcmk__flag_text(node->
priv->
flags,
2058 const char *feature_set = get_node_feature_set(node);
2060 const char *expected_up = pcmk__flag_text(node->
priv->
flags,
2062 const bool is_dc = pcmk__same_node(node,
2065 char *resources_running = pcmk__itoa(length);
2066 const char *node_type = node_variant_text(node->
priv->
variant);
2088 free(resources_running);
2091 if (pcmk__is_guest_or_bundle_node(node)) {
2104 out->message(out, (
const char *) rsc->
priv->
xml->name,
2105 show_opts, rsc, only_node, only_rsc);
2119 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2122 const char *
name = va_arg(args,
const char *);
2123 const char *value = va_arg(args,
const char *);
2124 bool add_extra = va_arg(args,
int);
2125 int expected_score = va_arg(args,
int);
2130 if (value == NULL) {
2136 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
2137 }
else if (v < expected_score) {
2138 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
2140 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2143 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2149 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2152 const char *
name = va_arg(args,
const char *);
2153 const char *value = va_arg(args,
const char *);
2154 bool add_extra = va_arg(args,
int);
2155 int expected_score = va_arg(args,
int);
2160 xmlNode *child = NULL;
2162 if (value != NULL) {
2174 }
else if (v < expected_score) {
2178 "(connectivity is degraded -- expected %d)",
2182 out->list_item(out, NULL,
"%s: %s",
name, value);
2188 PCMK__OUTPUT_ARGS(
"node-and-op",
"pcmk_scheduler_t *",
"xmlNode *")
2192 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2195 gchar *node_str = NULL;
2196 char *last_change_str = NULL;
2200 time_t last_change = 0;
2208 const pcmk_node_t *node = pcmk__current_node(rsc);
2209 const char *target_role = g_hash_table_lookup(rsc->
priv->
meta,
2218 show_opts, target_role,
false);
2233 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
2234 node_str, pcmk__xe_history_key(xml_op),
2238 last_change_str ? last_change_str :
"",
2239 pcmk_exec_status_str(status));
2242 free(last_change_str);
2246 PCMK__OUTPUT_ARGS(
"node-and-op",
"pcmk_scheduler_t *",
"xmlNode *")
2250 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2256 const char *status_s = NULL;
2259 time_t last_change = 0;
2260 xmlNode *node = NULL;
2264 status_s = pcmk_exec_status_str(status);
2286 (has_provider? provider :
""),
2298 const char *last_rc_change =
pcmk__trim(ctime(&last_change));
2310 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2313 const char *
name = va_arg(args,
const char *);
2314 const char *value = va_arg(args,
const char *);
2315 bool add_extra = va_arg(args,
int);
2316 int expected_score = va_arg(args,
int);
2324 char *buf = pcmk__itoa(expected_score);
2332 PCMK__OUTPUT_ARGS(
"node-attribute-list",
"pcmk_scheduler_t *",
"uint32_t",
2333 "bool",
"GList *",
"GList *")
2337 uint32_t show_opts = va_arg(args, uint32_t);
2338 bool print_spacer = va_arg(args,
int);
2339 GList *only_node = va_arg(args, GList *);
2340 GList *only_rsc = va_arg(args, GList *);
2345 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
2348 GList *attr_list = NULL;
2349 GHashTableIter iter;
2356 g_hash_table_iter_init(&iter, node->
priv->
attrs);
2357 while (g_hash_table_iter_next (&iter, &key, NULL)) {
2358 attr_list = filter_attr_list(attr_list, key);
2361 if (attr_list == NULL) {
2367 g_list_free(attr_list);
2373 out->message(out,
"node", node, show_opts,
false, only_node, only_rsc);
2375 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
2376 const char *
name = aIter->data;
2377 const char *value = NULL;
2378 int expected_score = 0;
2379 bool add_extra =
false;
2387 out->message(out,
"node-attribute",
name, value, add_extra,
2391 g_list_free(attr_list);
2399 PCMK__OUTPUT_ARGS(
"node-capacity",
"const pcmk_node_t *",
"const char *")
2404 const char *comment = va_arg(args,
const char *);
2407 comment, pcmk__node_name(node));
2411 out->list_item(out, NULL,
"%s", dump_text);
2417 PCMK__OUTPUT_ARGS(
"node-capacity",
"const pcmk_node_t *",
"const char *")
2423 const char *comment = va_arg(args,
const char *);
2429 g_hash_table_foreach(node->
priv->
utilization, add_dump_node, xml_node);
2434 PCMK__OUTPUT_ARGS(
"node-history-list",
"pcmk_scheduler_t *",
"pcmk_node_t *",
2435 "xmlNode *",
"GList *",
"GList *",
"uint32_t",
"uint32_t")
2440 xmlNode *node_state = va_arg(args, xmlNode *);
2441 GList *only_node = va_arg(args, GList *);
2442 GList *only_rsc = va_arg(args, GList *);
2443 uint32_t section_opts = va_arg(args, uint32_t);
2444 uint32_t show_opts = va_arg(args, uint32_t);
2446 xmlNode *lrm_rsc = NULL;
2447 xmlNode *rsc_entry = NULL;
2463 if (rsc_id == NULL) {
2481 if (pcmk__is_group(
parent)) {
2493 time_t last_failure = 0;
2497 if (failcount <= 0) {
2503 out->message(out,
"node", node, show_opts,
false, only_node,
2507 out->message(out,
"resource-history", rsc, rsc_id,
false,
2508 failcount, last_failure,
false);
2510 GList *op_list = get_operation_list(rsc_entry);
2513 if (op_list == NULL) {
2522 out->message(out,
"node", node, show_opts,
false, only_node,
2526 out->message(out,
"resource-operation-list",
scheduler, rsc, node,
2527 op_list, show_opts);
2535 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2538 GList *nodes = va_arg(args, GList *);
2539 GList *only_node = va_arg(args, GList *);
2540 GList *only_rsc = va_arg(args, GList *);
2541 uint32_t show_opts = va_arg(args, uint32_t);
2542 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2546 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2556 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2563 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2566 GList *nodes = va_arg(args, GList *);
2567 GList *only_node = va_arg(args, GList *);
2568 GList *only_rsc = va_arg(args, GList *);
2569 uint32_t show_opts = va_arg(args, uint32_t);
2570 bool print_spacer = va_arg(args,
int);
2573 GString *online_nodes = NULL;
2574 GString *online_remote_nodes = NULL;
2575 GString *online_guest_nodes = NULL;
2576 GString *offline_nodes = NULL;
2577 GString *offline_remote_nodes = NULL;
2581 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2606 if (pcmk__is_guest_or_bundle_node(node)) {
2607 pcmk__add_word(&online_guest_nodes, 1024, node_name);
2609 }
else if (pcmk__is_remote_node(node)) {
2610 pcmk__add_word(&online_remote_nodes, 1024, node_name);
2613 pcmk__add_word(&online_nodes, 1024, node_name);
2620 if (pcmk__is_remote_node(node)) {
2621 pcmk__add_word(&offline_remote_nodes, 1024, node_name);
2623 }
else if (pcmk__is_guest_or_bundle_node(node)) {
2627 pcmk__add_word(&offline_nodes, 1024, node_name);
2634 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2639 if (online_nodes != NULL) {
2640 out->list_item(out,
"Online",
"[ %s ]",
2641 (
const char *) online_nodes->str);
2642 g_string_free(online_nodes, TRUE);
2644 if (offline_nodes != NULL) {
2645 out->list_item(out,
"OFFLINE",
"[ %s ]",
2646 (
const char *) offline_nodes->str);
2647 g_string_free(offline_nodes, TRUE);
2649 if (online_remote_nodes) {
2650 out->list_item(out,
"RemoteOnline",
"[ %s ]",
2651 (
const char *) online_remote_nodes->str);
2652 g_string_free(online_remote_nodes, TRUE);
2654 if (offline_remote_nodes) {
2655 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]",
2656 (
const char *) offline_remote_nodes->str);
2657 g_string_free(offline_remote_nodes, TRUE);
2659 if (online_guest_nodes != NULL) {
2660 out->list_item(out,
"GuestOnline",
"[ %s ]",
2661 (
const char *) online_guest_nodes->str);
2662 g_string_free(online_guest_nodes, TRUE);
2669 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2672 GList *nodes = va_arg(args, GList *);
2673 GList *only_node = va_arg(args, GList *);
2674 GList *only_rsc = va_arg(args, GList *);
2675 uint32_t show_opts = va_arg(args, uint32_t);
2676 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2683 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2691 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2698 PCMK__OUTPUT_ARGS(
"node-summary",
"pcmk_scheduler_t *",
"GList *",
"GList *",
2699 "uint32_t",
"uint32_t",
"bool")
2703 GList *only_node = va_arg(args, GList *);
2704 GList *only_rsc = va_arg(args, GList *);
2705 uint32_t section_opts = va_arg(args, uint32_t);
2706 uint32_t show_opts = va_arg(args, uint32_t);
2707 bool print_spacer = va_arg(args,
int);
2709 xmlNode *node_state = NULL;
2714 if (xmlChildElementCount(cib_status) == 0) {
2724 pcmk__xe_id(node_state));
2738 out->message(out,
"node-history-list",
scheduler, node, node_state,
2739 only_node, only_rsc, section_opts, show_opts);
2746 PCMK__OUTPUT_ARGS(
"node-weight",
"const pcmk_resource_t *",
"const char *",
2747 "const char *",
"const char *")
2752 const char *prefix = va_arg(args,
const char *);
2753 const char *
uname = va_arg(args,
const char *);
2754 const char *score = va_arg(args,
const char *);
2757 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2758 prefix, rsc->
id,
uname, score);
2760 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2766 PCMK__OUTPUT_ARGS(
"node-weight",
"const pcmk_resource_t *",
"const char *",
2767 "const char *",
"const char *")
2772 const char *prefix = va_arg(args,
const char *);
2773 const char *
uname = va_arg(args,
const char *);
2774 const char *score = va_arg(args,
const char *);
2789 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2792 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2793 const char *task = va_arg(args,
const char *);
2794 const char *interval_ms_s = va_arg(args,
const char *);
2795 int rc = va_arg(args,
int);
2796 uint32_t show_opts = va_arg(args, uint32_t);
2798 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2801 out->list_item(out, NULL,
"%s", buf);
2807 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2810 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2811 const char *task = va_arg(args,
const char *);
2812 const char *interval_ms_s = va_arg(args,
const char *);
2813 int rc = va_arg(args,
int);
2814 uint32_t show_opts = va_arg(args, uint32_t);
2817 char *rc_s = pcmk__itoa(rc);
2819 xmlNodePtr node = NULL;
2829 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2836 const char *value = NULL;
2840 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2863 PCMK__OUTPUT_ARGS(
"promotion-score",
"pcmk_resource_t *",
"pcmk_node_t *",
2870 const char *score = va_arg(args,
const char *);
2872 if (chosen == NULL) {
2873 out->list_item(out, NULL,
"%s promotion score (inactive): %s",
2874 child_rsc->
id, score);
2876 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2877 child_rsc->
id, pcmk__node_name(chosen), score);
2882 PCMK__OUTPUT_ARGS(
"promotion-score",
"pcmk_resource_t *",
"pcmk_node_t *",
2889 const char *score = va_arg(args,
const char *);
2903 PCMK__OUTPUT_ARGS(
"resource-config",
"const pcmk_resource_t *",
"bool")
2907 GString *xml_buf = g_string_sized_new(1024);
2908 bool raw = va_arg(args,
int);
2910 formatted_xml_buf(rsc, xml_buf, raw);
2914 g_string_free(xml_buf, TRUE);
2918 PCMK__OUTPUT_ARGS(
"resource-config",
"const pcmk_resource_t *",
"bool")
2922 return resource_config(out, args);
2925 PCMK__OUTPUT_ARGS(
"resource-history",
"pcmk_resource_t *",
"const char *",
2926 "bool",
"int",
"time_t",
"bool")
2930 const char *rsc_id = va_arg(args,
const char *);
2931 bool all = va_arg(args,
int);
2932 int failcount = va_arg(args,
int);
2933 time_t last_failure = va_arg(args, time_t);
2934 bool as_header = va_arg(args,
int);
2936 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2939 out->begin_list(out, NULL, NULL,
"%s", buf);
2941 out->list_item(out, NULL,
"%s", buf);
2948 PCMK__OUTPUT_ARGS(
"resource-history",
"pcmk_resource_t *",
"const char *",
2949 "bool",
"int",
"time_t",
"bool")
2953 const char *rsc_id = va_arg(args,
const char *);
2954 bool all = va_arg(args,
int);
2955 int failcount = va_arg(args,
int);
2956 time_t last_failure = va_arg(args, time_t);
2957 bool as_header = va_arg(args,
int);
2966 }
else if (all || failcount || last_failure > 0) {
2975 if (failcount > 0) {
2976 char *s = pcmk__itoa(failcount);
2982 if (last_failure > 0) {
3002 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
3004 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
3006 out->
begin_list(out, NULL, NULL,
"Active Resources");
3011 PCMK__OUTPUT_ARGS(
"resource-list",
"pcmk_scheduler_t *",
"uint32_t",
"bool",
3012 "GList *",
"GList *",
"bool")
3017 uint32_t show_opts = va_arg(args, uint32_t);
3018 bool print_summary = va_arg(args,
int);
3019 GList *only_node = va_arg(args, GList *);
3020 GList *only_rsc = va_arg(args, GList *);
3021 bool print_spacer = va_arg(args,
int);
3025 bool printed_header =
false;
3042 print_resource_header(out, show_opts);
3043 printed_header =
true;
3051 rsc_iter != NULL; rsc_iter = rsc_iter->next) {
3058 gboolean partially_active = rsc->
priv->
fns->
active(rsc, FALSE);
3072 && pcmk__is_primitive(rsc)) {
3085 if (!printed_header) {
3087 print_resource_header(out, show_opts);
3088 printed_header =
true;
3092 x = out->message(out, (
const char *) rsc->
priv->
xml->name,
3093 show_opts, rsc, only_node, only_rsc);
3100 if (!printed_header) {
3102 print_resource_header(out, show_opts);
3103 printed_header =
true;
3107 out->list_item(out, NULL,
"No inactive resources");
3109 out->list_item(out, NULL,
"No resources");
3111 out->list_item(out, NULL,
"No active resources");
3115 if (printed_header) {
3122 PCMK__OUTPUT_ARGS(
"resource-operation-list",
"pcmk_scheduler_t *",
3123 "pcmk_resource_t *",
"pcmk_node_t *",
"GList *",
"uint32_t")
3131 GList *op_list = va_arg(args, GList *);
3132 uint32_t show_opts = va_arg(args, uint32_t);
3134 GList *gIter = NULL;
3138 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
3139 xmlNode *xml_op = (xmlNode *) gIter->data;
3156 time_t last_failure = 0;
3161 failcount, last_failure,
true);
3166 out->message(out,
"op-history", xml_op, task, interval_ms_s,
3167 op_rc_i, show_opts);
3171 g_list_free(op_list);
3177 PCMK__OUTPUT_ARGS(
"resource-util",
"pcmk_resource_t *",
"pcmk_node_t *",
3184 const char *fn = va_arg(args,
const char *);
3187 fn, rsc->
id, pcmk__node_name(node));
3191 out->list_item(out, NULL,
"%s", dump_text);
3197 PCMK__OUTPUT_ARGS(
"resource-util",
"pcmk_resource_t *",
"pcmk_node_t *",
3205 const char *fn = va_arg(args,
const char *);
3207 xmlNodePtr xml_node = NULL;
3214 g_hash_table_foreach(rsc->
priv->
utilization, add_dump_node, xml_node);
3219 static inline const char *
3228 static inline const char *
3234 PCMK__OUTPUT_ARGS(
"ticket",
"pcmk__ticket_t *",
"bool",
"bool")
3238 bool raw = va_arg(args,
int);
3239 bool details = va_arg(args,
int);
3241 GString *detail_str = NULL;
3244 out->list_item(out, ticket->
id,
"%s", ticket->
id);
3248 if (details && g_hash_table_size(ticket->
state) > 0) {
3249 GHashTableIter iter;
3250 const char *
name = NULL;
3251 const char *value = NULL;
3252 bool already_added =
false;
3254 detail_str = g_string_sized_new(100);
3257 g_hash_table_iter_init(&iter, ticket->
state);
3258 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3259 if (already_added) {
3260 g_string_append_printf(detail_str,
", %s=",
name);
3262 g_string_append_printf(detail_str,
"%s=",
name);
3263 already_added =
true;
3267 char *epoch_str = NULL;
3294 if (detail_str == NULL) {
3297 out->list_item(out, NULL,
"%s\t%s%s last-granted=\"%s\"",
3298 ticket->
id, ticket_status(ticket),
3299 ticket_standby_text(ticket), pcmk__s(epoch_str,
""));
3302 out->list_item(out, NULL,
"%s\t%s%s %s",
3303 ticket->
id, ticket_status(ticket),
3304 ticket_standby_text(ticket), detail_str->str);
3307 out->list_item(out, NULL,
"%s\t%s%s%s", ticket->
id,
3308 ticket_status(ticket),
3309 ticket_standby_text(ticket),
3310 detail_str != NULL ? detail_str->str :
"");
3313 if (detail_str != NULL) {
3314 g_string_free(detail_str, TRUE);
3320 PCMK__OUTPUT_ARGS(
"ticket",
"pcmk__ticket_t *",
"bool",
"bool")
3324 bool raw G_GNUC_UNUSED = va_arg(args,
int);
3325 bool details G_GNUC_UNUSED = va_arg(args,
int);
3329 xmlNodePtr node = NULL;
3330 GHashTableIter iter;
3331 const char *
name = NULL;
3332 const char *value = NULL;
3347 g_hash_table_iter_init(&iter, ticket->
state);
3348 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3363 PCMK__OUTPUT_ARGS(
"ticket-list",
"GHashTable *",
"bool",
"bool",
"bool")
3366 GHashTable *tickets = va_arg(args, GHashTable *);
3367 bool print_spacer = va_arg(args,
int);
3368 bool raw = va_arg(args,
int);
3369 bool details = va_arg(args,
int);
3371 GHashTableIter iter;
3374 if (g_hash_table_size(tickets) == 0) {
3381 out->begin_list(out, NULL, NULL,
"Tickets");
3384 g_hash_table_iter_init(&iter, tickets);
3385 while (g_hash_table_iter_next(&iter, NULL, &value)) {
3387 out->message(out,
"ticket", ticket, raw, details);
3396 {
"ban",
"default", ban_text },
3397 {
"ban",
"html", ban_html },
3398 {
"ban",
"xml", ban_xml },
3399 {
"ban-list",
"default", ban_list },
3405 {
"cluster-counts",
"default", cluster_counts_text },
3406 {
"cluster-counts",
"html", cluster_counts_html },
3407 {
"cluster-counts",
"xml", cluster_counts_xml },
3408 {
"cluster-dc",
"default", cluster_dc_text },
3409 {
"cluster-dc",
"html", cluster_dc_html },
3410 {
"cluster-dc",
"xml", cluster_dc_xml },
3411 {
"cluster-options",
"default", cluster_options_text },
3412 {
"cluster-options",
"html", cluster_options_html },
3413 {
"cluster-options",
"log", cluster_options_log },
3414 {
"cluster-options",
"xml", cluster_options_xml },
3415 {
"cluster-summary",
"default", cluster_summary },
3416 {
"cluster-summary",
"html", cluster_summary_html },
3417 {
"cluster-stack",
"default", cluster_stack_text },
3418 {
"cluster-stack",
"html", cluster_stack_html },
3419 {
"cluster-stack",
"xml", cluster_stack_xml },
3420 {
"cluster-times",
"default", cluster_times_text },
3421 {
"cluster-times",
"html", cluster_times_html },
3422 {
"cluster-times",
"xml", cluster_times_xml },
3423 {
"failed-action",
"default", failed_action_default },
3424 {
"failed-action",
"xml", failed_action_xml },
3425 {
"failed-action-list",
"default", failed_action_list },
3428 {
"maint-mode",
"text", cluster_maint_mode_text },
3429 {
"node",
"default", node_text },
3430 {
"node",
"html", node_html },
3431 {
"node",
"xml", node_xml },
3432 {
"node-and-op",
"default", node_and_op },
3433 {
"node-and-op",
"xml", node_and_op_xml },
3434 {
"node-capacity",
"default", node_capacity },
3435 {
"node-capacity",
"xml", node_capacity_xml },
3436 {
"node-history-list",
"default", node_history_list },
3437 {
"node-list",
"default", node_list_text },
3438 {
"node-list",
"html", node_list_html },
3439 {
"node-list",
"xml", node_list_xml },
3440 {
"node-weight",
"default", node_weight },
3441 {
"node-weight",
"xml", node_weight_xml },
3442 {
"node-attribute",
"default", node_attribute_text },
3443 {
"node-attribute",
"html", node_attribute_html },
3444 {
"node-attribute",
"xml", node_attribute_xml },
3445 {
"node-attribute-list",
"default", node_attribute_list },
3446 {
"node-summary",
"default", node_summary },
3447 {
"op-history",
"default", op_history_text },
3448 {
"op-history",
"xml", op_history_xml },
3452 {
"promotion-score",
"default", promotion_score },
3453 {
"promotion-score",
"xml", promotion_score_xml },
3454 {
"resource-config",
"default", resource_config },
3455 {
"resource-config",
"text", resource_config_text },
3456 {
"resource-history",
"default", resource_history_text },
3457 {
"resource-history",
"xml", resource_history_xml },
3458 {
"resource-list",
"default", resource_list },
3459 {
"resource-operation-list",
"default", resource_operation_list },
3460 {
"resource-util",
"default", resource_util },
3461 {
"resource-util",
"xml", resource_util_xml },
3462 {
"ticket",
"default", ticket_default },
3463 {
"ticket",
"xml", ticket_xml },
3464 {
"ticket-list",
"default", ticket_list },
3466 { NULL, NULL, NULL }
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
#define PCMK__XA_OPERATION_KEY
#define CRM_CHECK(expr, failure_action)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr parent)
#define PCMK_XA_STONITH_TIMEOUT_MS
#define PCMK_XE_NODES_CONFIGURED
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
#define PCMK_XA_EXPECTED_UP
#define PCMK__XE_LRM_RESOURCES
char * pcmk__xml_escape(const char *text, enum pcmk__xml_escape_type type)
Do not recover resources from outside partition.
#define PCMK_XA_PACEMAKERD_STATE
Control output from tools.
void pcmk__register_messages(pcmk__output_t *out, const pcmk__message_entry_t *table)
#define PCMK_META_MIGRATION_THRESHOLD
gboolean(* active)(pcmk_resource_t *rsc, gboolean all)
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,...)
#define PCMK_XE_LAST_CHANGE
#define PCMK_XA_ID_AS_RESOURCE
void pcmk__xe_set_bool_attr(xmlNodePtr node, const char *name, bool value)
int pcmk__scan_min_int(const char *text, int *result, int minimum)
gchar * pcmk__native_output_string(const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, uint32_t show_opts, const char *target_role, bool show_nodes)
#define crm_time_log_timeofday
#define PCMK_XA_UPDATE_ORIGIN
enum pcmk_ipc_server type
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
#define PCMK_XE_PROMOTION_SCORE
#define PCMK_XA_STONITH_ENABLED
void pcmk__xml_string(const xmlNode *data, uint32_t options, GString *buffer, int depth)
gboolean(* is_filtered)(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
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_VALUE_GRANTED
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
bool pcmk__xml_needs_escape(const char *text, enum pcmk__xml_escape_type type)
#define PCMK_VALUE_STANDBY
int pe__group_default(pcmk__output_t *out, va_list args)
GList * location_constraints
#define PCMK_ACTION_MONITOR
#define PCMK_XA_EXIT_REASON
#define PCMK_XA_HAVE_QUORUM
#define PCMK_XA_LAST_FAILURE
xmlNodePtr pcmk__output_xml_create_parent(pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
pcmk__scheduler_private_t * priv
#define PCMK_VALUE_UNKNOWN
int pe__clone_default(pcmk__output_t *out, va_list args)
xmlNodePtr pcmk__output_xml_peek_parent(pcmk__output_t *out)
#define PCMK_XA_CIB_LAST_WRITTEN
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
Stop all resources in partition.
#define PCMK_XA_QUEUE_TIME
#define PCMK_XA_MIXED_VERSION
#define PCMK_VALUE_REVOKED
const char * rsc_printable_id(const pcmk_resource_t *rsc)
const pcmk__rsc_methods_t * fns
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 PCMK_XA_OPERATION
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
#define PCMK_XE_ATTRIBUTE
Include indentation and newlines.
int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
int pe__bundle_html(pcmk__output_t *out, va_list args)
enum pe_quorum_policy no_quorum_policy
pe_quorum_policy
Possible responses to loss of quorum.
void void void pcmk__formatted_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
#define PCMK_XA_EXITREASON
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 PCMK_XA_STOP_ALL_RESOURCES
pcmk__node_private_t * priv
#define PCMK__XE_LRM_RESOURCE
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define PCMK_XE_RESOURCE_HISTORY
const char * crm_exit_str(crm_exit_t exit_code)
#define CRM_ATTR_FEATURE_SET
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options)
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)
#define PCMK_XE_NODE_WEIGHT
#define PCMK_XA_FEATURE_SET
Used only to initialize variables.
pcmk_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
xmlNode * pcmk_find_cib_element(xmlNode *cib, const char *element_name)
Find an element in the CIB.
#define PCMK_XE_UTILIZATION
xmlNode * pcmk__html_create(xmlNode *parent, const char *name, const char *id, const char *class_name)
#define PCMK__VALUE_WARNING
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define PCMK_XA_DESCRIPTION
void void pcmk__xe_set_propv(xmlNodePtr node, va_list pairs)
#define PCMK_XA_UPDATE_USER
int pe__clone_xml(pcmk__output_t *out, va_list args)
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
#define PCMK_VALUE_MEMBER
bool pe__rsc_running_on_any(pcmk_resource_t *rsc, GList *node_list)
int pe__node_health(pcmk_node_t *node)
Demote promotable resources and stop all others.
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
pcmk__resource_private_t * priv
#define PCMK_VALUE_IGNORE
void pcmk__str_update(char **str, const char *value)
Wrappers for and extensions to libxml2.
const char * pe__resource_description(const pcmk_resource_t *rsc, uint32_t show_opts)
#define PCMK_META_TARGET_ROLE
Action completed, result is known.
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
void pcmk__xe_set_content(xmlNode *node, const char *format,...) G_GNUC_PRINTF(2
Act as if partition still holds quorum.
pcmk_scheduler_t * scheduler
Fence all nodes in partition.
#define crm_time_log_with_timezone
bool pcmk__str_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
const pcmk_node_t * pending_node
#define PCMK_XE_CURRENT_DC
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
#define PCMK__XA_PROMOTED_ONLY_LEGACY
bool pcmk_xe_mask_probe_failure(const xmlNode *xml_op)
Check whether an action history entry represents a maskable probe.
#define PCMK_XA_MAINTENANCE
int pe__resource_xml(pcmk__output_t *out, va_list args)
xmlNode * pcmk__xe_next(const xmlNode *node, const char *element_name)
#define PCMK__VALUE_HEALTH_RED
#define pcmk__assert(expr)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
#define PCMK_VALUE_ONLINE
#define PCMK_XA_FAIL_COUNT
#define PCMK_XA_EXEC_TIME
int pe__bundle_xml(pcmk__output_t *out, va_list args)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
#define PCMK_XA_MAINTENANCE_MODE
#define PCMK_XA_SYMMETRIC_CLUSTER
#define PCMK_META_INTERVAL
#define PCMK_XA_LAST_RC_CHANGE
#define PCMK_XE_RESOURCES_CONFIGURED
#define PCMK_XA_NO_QUORUM_POLICY
#define PCMK_ROLE_PROMOTED
pcmk_scheduler_t * scheduler
const char * pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state)
#define PCMK__XE_LRM_RSC_OP
char * pe__node_display_name(pcmk_node_t *node, bool print_detail)
enum pcmk__node_variant variant
void(*) void(* list_item)(pcmk__output_t *out, const char *name, const char *format,...) G_GNUC_PRINTF(3
char * pcmk__epoch2str(const time_t *source, uint32_t flags)
pcmk_resource_t * launcher
#define PCMK_XE_OPERATION
const char * pcmk__node_attr(const pcmk_node_t *node, const char *name, const char *target, enum pcmk__rsc_node node_type)
#define PCMK__XA_OP_STATUS
#define PCMK_META_ON_FAIL
int pe__group_xml(pcmk__output_t *out, va_list args)
This structure contains everything that makes up a single output formatter.
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
enum rsc_role_e role_filter
#define PCMK_XA_PROMOTED_ONLY
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
int pe__resource_html(pcmk__output_t *out, va_list args)
#define PCMK_XA_EXITSTATUS
#define PCMK__VALUE_HEALTH_YELLOW
gboolean crm_is_true(const char *s)
#define PCMK__XE_NODE_STATE
const char * pcmk__pcmkd_state_enum2friendly(enum pcmk_pacemakerd_state state)
#define pcmk__plural_s(i)
#define PCMK_XA_LAST_GRANTED
#define PCMK__VALUE_MAINT
#define PCMK_XE_CLUSTER_OPTIONS
#define PCMK_XE_LAST_UPDATE
#define PCMK_XA_PRIORITY_FENCING_DELAY_MS
const char * pcmk__readable_interval(guint interval_ms)
uint32_t pcmk_get_ra_caps(const char *standard)
Get capabilities of a resource agent standard.
char * pcmk__trim(char *str)
Location constraint object.
#define PCMK_XE_OPERATION_HISTORY
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
#define PCMK_VALUE_FREEZE
struct pcmk__node_details * details
#define PCMK_XA_WITH_QUORUM
#define pcmk__assert_alloc(nmemb, size)
#define PCMK_XA_RESOURCES_RUNNING
#define PCMK_VALUE_OFFLINE
void pe__register_messages(pcmk__output_t *out)
#define PCMK_XA_UPDATE_CLIENT
#define PCMK_XA_STANDBY_ONFAIL
#define PCMK_VALUE_YELLOW
#define PCMK_VALUE_REMOTE
#define PCMK_VALUE_DEMOTE
#define crm_time_log_date
#define PCMK_ACTION_NOTIFY
guint priority_fencing_ms
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)
struct pcmk__node_assignment * assign