24 const char * desc = NULL;
33 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \ 34 PCMK__NODE_ATTR_SHUTDOWN, PCMK_NODE_ATTR_TERMINATE, \ 35 PCMK_NODE_ATTR_STANDBY, "#", NULL } 38 compare_attribute(gconstpointer a, gconstpointer b)
42 rc = strcmp((
const char *)a, (
const char *)b);
63 add_extra_info(
const pcmk_node_t *node, GList *rsc_list,
69 for (gIter = rsc_list; gIter != NULL; gIter = gIter->next) {
72 const char *
name = NULL;
73 GHashTable *params = NULL;
95 int host_list_num = 0;
96 const char *hosts = g_hash_table_lookup(params,
"host_list");
97 const char *multiplier = g_hash_table_lookup(params,
"multiplier");
101 char **host_list = g_strsplit(hosts,
" ", 0);
102 host_list_num = g_strv_length(host_list);
103 g_strfreev(host_list);
106 if ((multiplier == NULL)
115 *expected_score = host_list_num * multiplier_i;
124 filter_attr_list(GList *attr_list,
char *
name)
132 for (i = 0; filt_str[i] != NULL; i++) {
133 if (g_str_has_prefix(
name, filt_str[i])) {
138 return g_list_insert_sorted(attr_list,
name, compare_attribute);
142 get_operation_list(xmlNode *rsc_entry) {
143 GList *op_list = NULL;
144 xmlNode *rsc_op = NULL;
147 rsc_op != NULL; rsc_op = pcmk__xe_next(rsc_op)) {
171 op_list = g_list_append(op_list, rsc_op);
180 add_dump_node(gpointer key, gpointer value, gpointer user_data)
182 xmlNodePtr node = user_data;
189 append_dump_text(gpointer key, gpointer value, gpointer user_data)
191 char **dump_text = user_data;
193 *dump_text, (
char *)key, (
char *)value);
196 *dump_text = new_text;
199 #define XPATH_STACK "//" PCMK_XE_NVPAIR \ 200 "[@" PCMK_XA_NAME "='" \ 201 PCMK_OPT_CLUSTER_INFRASTRUCTURE "']" 215 last_changed_string(
const char *last_written,
const char *user,
216 const char *client,
const char *origin) {
217 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
219 last_written ? last_written :
"",
222 client ?
" via " :
"",
223 client ? client :
"",
224 origin ?
" on " :
"",
225 origin ? origin :
"");
232 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
233 int rc,
bool print_timing) {
235 char *interval_str = NULL;
238 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
245 char *last_change_str = NULL;
246 char *exec_str = NULL;
247 char *queue_str = NULL;
249 const char *value = NULL;
260 pcmk__s(epoch_str,
""));
279 interval_str ? interval_str :
"",
280 last_change_str ? last_change_str :
"",
281 exec_str ? exec_str :
"",
282 queue_str ? queue_str :
"",
283 rc, services_ocf_exitcode_str(rc));
285 if (last_change_str) {
286 free(last_change_str);
298 interval_str ?
":" :
"",
299 interval_str ? interval_str :
"");
310 resource_history_string(
pcmk_resource_t *rsc,
const char *rsc_id,
bool all,
311 int failcount, time_t last_failure) {
316 }
else if (all || failcount || last_failure > 0) {
317 char *failcount_s = NULL;
318 char *lastfail_s = NULL;
324 failcount_s = strdup(
"");
326 if (last_failure > 0) {
335 lastfail_s? lastfail_s :
"");
359 && !pcmk__is_pacemaker_remote_node(node)) {
361 const char *feature_set = g_hash_table_lookup(node->
details->
attrs,
367 return pcmk__s(feature_set,
"<3.15.1");
375 const char *feature_set = NULL;
376 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
378 const char *node_feature_set = get_node_feature_set(node);
379 if (node_feature_set != NULL) {
380 if (feature_set == NULL) {
381 feature_set = node_feature_set;
382 }
else if (strcmp(feature_set, node_feature_set) != 0) {
391 formatted_xml_buf(
const pcmk_resource_t *rsc, GString *xml_buf,
bool raw)
393 if (raw && (rsc->
orig_xml != NULL)) {
400 #define XPATH_DC_VERSION "//" PCMK_XE_NVPAIR \ 401 "[@" PCMK_XA_NAME "='" PCMK_OPT_DC_VERSION "']" 404 "enum pcmk_pacemakerd_state",
"uint32_t",
"uint32_t")
410 uint32_t section_opts = va_arg(args, uint32_t);
411 uint32_t show_opts = va_arg(args, uint32_t);
414 const char *stack_s = get_cluster_stack(
scheduler);
418 out->message(out,
"cluster-stack", stack_s, pcmkd_state);
424 const char *dc_version_s = dc_version?
430 bool mixed_version = is_mixed_version(
scheduler);
434 dc_version_s, dc_name, mixed_version);
449 out->message(out,
"cluster-times",
455 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
462 out->message(out,
"cluster-options",
scheduler);
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);
524 out->message(out,
"cluster-times",
530 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
542 out->begin_list(out, NULL, NULL,
"Config Options");
543 out->message(out,
"cluster-options",
scheduler);
561 const char *node_host = NULL;
562 const char *node_id = NULL;
569 if (print_detail && pcmk__is_guest_or_bundle_node(node)) {
571 const pcmk_node_t *host_node = pcmk__current_node(container);
573 if (host_node && host_node->
details) {
576 if (node_host == NULL) {
589 name_len += strlen(node_host) + 1;
592 name_len += strlen(node_id) + 3;
599 strcat(node_name,
"@");
600 strcat(node_name, node_host);
603 strcat(node_name,
" (");
604 strcat(node_name, node_id);
605 strcat(node_name,
")");
614 xmlNodePtr xml_node = NULL;
623 va_start(pairs, tag_name);
637 #ifdef PCMK__COMPAT_2_0 651 uint32_t show_opts = va_arg(args, uint32_t);
656 location->
id, location->
rsc->
id,
671 uint32_t show_opts = va_arg(args, uint32_t);
675 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
676 location->
id, location->
rsc->
id,
688 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
691 char *weight_s = pcmk__itoa(pe_node->
weight);
717 const char *prefix = va_arg(args,
const char *);
718 GList *only_rsc = va_arg(args, GList *);
719 uint32_t show_opts = va_arg(args, uint32_t);
720 bool print_spacer = va_arg(args,
int);
722 GList *gIter, *gIter2;
727 gIter != NULL; gIter = gIter->next) {
731 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
742 for (gIter2 = location->
nodes; gIter2 != NULL; gIter2 = gIter2->next) {
747 out->message(out,
"ban", node, location, show_opts);
759 unsigned int nnodes = va_arg(args,
unsigned int);
760 int nresources = va_arg(args,
int);
761 int ndisabled = va_arg(args,
int);
762 int nblocked = va_arg(args,
int);
766 xmlNode *child = NULL;
772 if (ndisabled && nblocked) {
791 }
else if (ndisabled && !nblocked) {
804 }
else if (!ndisabled && nblocked) {
829 unsigned int nnodes = va_arg(args,
unsigned int);
830 int nresources = va_arg(args,
int);
831 int ndisabled = va_arg(args,
int);
832 int nblocked = va_arg(args,
int);
834 out->list_item(out, NULL,
"%d node%s configured",
837 if (ndisabled && nblocked) {
838 out->list_item(out, NULL,
"%d resource instance%s configured " 839 "(%d DISABLED, %d BLOCKED from " 840 "further action due to failure)",
843 }
else if (ndisabled && !nblocked) {
844 out->list_item(out, NULL,
"%d resource instance%s configured " 847 }
else if (!ndisabled && nblocked) {
848 out->list_item(out, NULL,
"%d resource instance%s configured " 849 "(%d BLOCKED from further action " 853 out->list_item(out, NULL,
"%d resource instance%s configured",
863 unsigned int nnodes = va_arg(args,
unsigned int);
864 int nresources = va_arg(args,
int);
865 int ndisabled = va_arg(args,
int);
866 int nblocked = va_arg(args,
int);
868 xmlNodePtr nodes_node = NULL;
869 xmlNodePtr resources_node = NULL;
878 s = pcmk__itoa(nnodes);
882 s = pcmk__itoa(nresources);
886 s = pcmk__itoa(ndisabled);
890 s = pcmk__itoa(nblocked);
902 const char *quorum = va_arg(args,
const char *);
903 const char *dc_version_s = va_arg(args,
const char *);
904 char *dc_name = va_arg(args,
char *);
905 bool mixed_version = va_arg(args,
int);
908 xmlNode *child = NULL;
916 dc_name, pcmk__s(dc_version_s,
"unknown"));
954 const char *quorum = va_arg(args,
const char *);
955 const char *dc_version_s = va_arg(args,
const char *);
956 char *dc_name = va_arg(args,
char *);
957 bool mixed_version = va_arg(args,
int);
960 out->list_item(out,
"Current DC",
961 "%s (version %s) - %spartition %s quorum",
962 dc_name, dc_version_s ? dc_version_s :
"unknown",
963 mixed_version ?
"MIXED-VERSION " :
"",
966 out->list_item(out,
"Current DC",
"NONE");
977 const char *quorum = va_arg(args,
const char *);
978 const char *dc_version_s = va_arg(args,
const char *);
979 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
980 bool mixed_version = va_arg(args,
int);
983 const char *with_quorum = pcmk__btoa(
crm_is_true(quorum));
984 const char *mixed_version_s = pcmk__btoa(mixed_version);
1006 unsigned long long flags = va_arg(args,
unsigned long long);
1027 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1029 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1033 out->list_item(out, NULL,
"Cluster is symmetric");
1035 out->list_item(out, NULL,
"Cluster is asymmetric");
1040 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1044 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1048 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1049 "resources and stop all other resources");
1053 out->list_item(out, NULL,
"No quorum policy: Ignore");
1057 out->list_item(out, NULL,
"No quorum policy: Suicide");
1063 xmlNode *child = NULL;
1073 " (the cluster will not attempt to start, stop," 1074 " or recover services)");
1078 xmlNode *child = NULL;
1088 " (the cluster will keep all resources stopped)");
1091 out->list_item(out, NULL,
"Resource management: enabled");
1103 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
1105 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
1117 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1119 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1123 out->list_item(out, NULL,
"Cluster is symmetric");
1125 out->list_item(out, NULL,
"Cluster is asymmetric");
1130 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1134 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1138 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1139 "resources and stop all other resources");
1143 out->list_item(out, NULL,
"No quorum policy: Ignore");
1147 out->list_item(out, NULL,
"No quorum policy: Suicide");
1193 const char *symmetric_cluster =
1195 const char *no_quorum_policy =
1199 const char *stop_all_resources = pcmk__flag_text(
scheduler->
flags,
1202 char *priority_fencing_delay_ms_s =
1212 stonith_timeout_ms_s,
1214 priority_fencing_delay_ms_s,
1216 free(stonith_timeout_ms_s);
1217 free(priority_fencing_delay_ms_s);
1222 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1225 const char *stack_s = va_arg(args,
const char *);
1230 xmlNode *child = NULL;
1252 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1255 const char *stack_s = va_arg(args,
const char *);
1260 out->list_item(out,
"Stack",
"%s (%s)",
1263 out->list_item(out,
"Stack",
"%s", stack_s);
1269 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1272 const char *stack_s = va_arg(args,
const char *);
1276 const char *state_s = NULL;
1291 "const char *",
"const char *",
"const char *")
1294 const char *our_nodename = va_arg(args,
const char *);
1295 const char *last_written = va_arg(args,
const char *);
1296 const char *user = va_arg(args,
const char *);
1297 const char *client = va_arg(args,
const char *);
1298 const char *origin = va_arg(args,
const char *);
1302 xmlNode *child = NULL;
1304 char *time_s = NULL;
1315 if (our_nodename != NULL) {
1328 time_s = last_changed_string(last_written, user, client, origin);
1336 "const char *",
"const char *",
"const char *")
1339 const char *our_nodename = va_arg(args,
const char *);
1340 const char *last_written = va_arg(args,
const char *);
1341 const char *user = va_arg(args,
const char *);
1342 const char *client = va_arg(args,
const char *);
1343 const char *origin = va_arg(args,
const char *);
1364 "const char *",
"const char *",
"const char *")
1367 const char *our_nodename = va_arg(args,
const char *);
1368 const char *last_written = va_arg(args,
const char *);
1369 const char *user = va_arg(args,
const char *);
1370 const char *client = va_arg(args,
const char *);
1371 const char *origin = va_arg(args,
const char *);
1375 out->list_item(out,
"Last updated",
"%s%s%s",
1376 time_s, (our_nodename != NULL)?
" on " :
"",
1377 pcmk__s(our_nodename,
""));
1380 time_s = last_changed_string(last_written, user, client, origin);
1382 out->list_item(out,
"Last change",
" %s", time_s);
1402 failed_action_friendly(
pcmk__output_t *out,
const xmlNode *xml_op,
1403 const char *op_key,
const char *node_name,
int rc,
1404 int status,
const char *exit_reason,
1405 const char *exec_time)
1407 char *rsc_id = NULL;
1409 guint interval_ms = 0;
1410 time_t last_change_epoch = 0;
1411 GString *str = NULL;
1413 if (pcmk__str_empty(op_key)
1414 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1422 str = g_string_sized_new(256);
1426 if (interval_ms != 0) {
1430 pcmk__g_strcat(str, pcmk__readable_action(task, interval_ms),
" on ",
1434 pcmk__g_strcat(str,
" returned '", services_ocf_exitcode_str(rc),
"'",
1436 if (!pcmk__str_empty(exit_reason)) {
1442 pcmk_exec_status_str(status), NULL);
1443 if (!pcmk__str_empty(exit_reason)) {
1446 g_string_append_c(str,
')');
1451 &last_change_epoch) ==
pcmk_ok) {
1457 if (!pcmk__str_empty(exec_time)) {
1458 int exec_time_ms = 0;
1461 && (exec_time_ms > 0)) {
1468 out->
list_item(out, NULL,
"%s", str->str);
1469 g_string_free(str, TRUE);
1488 failed_action_technical(
pcmk__output_t *out,
const xmlNode *xml_op,
1489 const char *op_key,
const char *node_name,
int rc,
1490 int status,
const char *exit_reason,
1491 const char *exec_time)
1495 const char *exit_status = services_ocf_exitcode_str(rc);
1496 const char *lrm_status = pcmk_exec_status_str(status);
1497 time_t last_change_epoch = 0;
1498 GString *str = NULL;
1500 if (pcmk__str_empty(op_key)) {
1501 op_key =
"unknown operation";
1503 if (pcmk__str_empty(exit_status)) {
1504 exit_status =
"unknown exit status";
1506 if (pcmk__str_empty(call_id)) {
1507 call_id =
"unknown";
1510 str = g_string_sized_new(256);
1512 g_string_append_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1513 op_key, node_name, exit_status, rc, call_id,
1516 if (!pcmk__str_empty(exit_reason)) {
1521 &last_change_epoch) ==
pcmk_ok) {
1526 "'", last_change_str,
"'", NULL);
1527 free(last_change_str);
1529 if (!pcmk__str_empty(queue_time)) {
1532 if (!pcmk__str_empty(exec_time)) {
1536 out->
list_item(out, NULL,
"%s", str->str);
1537 g_string_free(str, TRUE);
1544 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1545 uint32_t show_opts = va_arg(args, uint32_t);
1547 const char *op_key = pcmk__xe_history_key(xml_op);
1560 if (pcmk__str_empty(node_name)) {
1561 node_name =
"unknown node";
1565 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1566 exit_reason, exec_time);
1568 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1569 exit_reason, exec_time);
1577 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1578 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1580 const char *op_key = pcmk__xe_history_key(xml_op);
1586 const char *exitstatus = NULL;
1590 const char *status_s = NULL;
1593 gchar *exit_reason_esc = NULL;
1595 xmlNodePtr node = NULL;
1599 exit_reason = exit_reason_esc;
1608 exitstatus = services_ocf_exitcode_str(rc);
1609 rc_s = pcmk__itoa(rc);
1610 status_s = pcmk_exec_status_str(status);
1612 op_key_name, op_key,
1623 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1628 guint interval_ms = 0;
1629 char *interval_ms_s = NULL;
1646 free(interval_ms_s);
1650 g_free(exit_reason_esc);
1655 "GList *",
"uint32_t",
"bool")
1659 GList *only_node = va_arg(args, GList *);
1660 GList *only_rsc = va_arg(args, GList *);
1661 uint32_t show_opts = va_arg(args, uint32_t);
1662 bool print_spacer = va_arg(args,
int);
1664 xmlNode *xml_op = NULL;
1672 xml_op != NULL; xml_op = pcmk__xe_next(xml_op)) {
1686 if (!
parse_op_key(pcmk__xe_history_key(xml_op), &rsc, NULL, NULL)) {
1698 out->message(out,
"failed-action", xml_op, show_opts);
1709 xmlNode *child = NULL;
1729 " with active resources)");
1741 " (in standby, with active resources)");
1762 }
else if (health == 0) {
1770 const char *feature_set = get_node_feature_set(node);
1771 if (feature_set != NULL) {
1779 "GList *",
"GList *")
1783 uint32_t show_opts = va_arg(args, uint32_t);
1784 bool full = va_arg(args,
int);
1785 GList *only_node = va_arg(args, GList *);
1786 GList *only_rsc = va_arg(args, GList *);
1791 xmlNode *item_node = NULL;
1792 xmlNode *child = NULL;
1797 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1801 status_node(node, item_node, show_opts);
1805 out->begin_list(out, NULL, NULL,
"Resources");
1817 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1821 status_node(node, item_node, show_opts);
1828 out->message(out, pcmk__map_element_name(rsc->
xml), show_opts,
1829 rsc, only_node, only_rsc);
1841 status_node(node, item_node, show_opts);
1844 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1864 return "UNCLEAN (online)";
1867 return "UNCLEAN (pending)";
1870 return "UNCLEAN (offline)";
1882 return "standby (with active resources)";
1887 return "OFFLINE (standby)";
1892 return "maintenance";
1894 return "OFFLINE (maintenance)";
1909 uint32_t show_opts = va_arg(args, uint32_t);
1910 bool full = va_arg(args,
int);
1911 GList *only_node = va_arg(args, GList *);
1912 GList *only_rsc = va_arg(args, GList *);
1916 GString *str = g_string_sized_new(64);
1920 if (pcmk__is_guest_or_bundle_node(node)) {
1921 g_string_append(str,
"GuestNode");
1922 }
else if (pcmk__is_remote_node(node)) {
1923 g_string_append(str,
"RemoteNode");
1925 g_string_append(str,
"Node");
1927 pcmk__g_strcat(str,
" ", node_name,
": ", node_text_status(node), NULL);
1930 g_string_append(str,
" (health is RED)");
1931 }
else if (health == 0) {
1932 g_string_append(str,
" (health is YELLOW)");
1935 const char *feature_set = get_node_feature_set(node);
1936 if (feature_set != NULL) {
1948 out->begin_list(out, NULL, NULL,
"%s", str->str);
1949 out->begin_list(out, NULL, NULL,
"Resources");
1960 GList *gIter2 = NULL;
1962 out->begin_list(out, NULL, NULL,
"%s", str->str);
1963 out->begin_list(out, NULL, NULL,
"Resources");
1969 out->message(out, pcmk__map_element_name(rsc->
xml),
1970 show_opts, rsc, only_node, only_rsc);
1977 out->list_item(out, NULL,
"%s", str->str);
1980 g_string_free(str, TRUE);
1984 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
2002 health_text(
int health)
2006 }
else if (health == 0) {
2044 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
2045 bool full = va_arg(args,
int);
2046 GList *only_node = va_arg(args, GList *);
2047 GList *only_rsc = va_arg(args, GList *);
2057 const char *feature_set = get_node_feature_set(node);
2062 char *resources_running = pcmk__itoa(length);
2085 free(resources_running);
2088 if (pcmk__is_guest_or_bundle_node(node)) {
2101 out->message(out, pcmk__map_element_name(rsc->
xml), show_opts,
2102 rsc, only_node, only_rsc);
2116 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2119 const char *
name = va_arg(args,
const char *);
2120 const char *value = va_arg(args,
const char *);
2121 bool add_extra = va_arg(args,
int);
2122 int expected_score = va_arg(args,
int);
2127 if (value == NULL) {
2133 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
2134 }
else if (v < expected_score) {
2135 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
2137 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2140 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2146 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2149 const char *
name = va_arg(args,
const char *);
2150 const char *value = va_arg(args,
const char *);
2151 bool add_extra = va_arg(args,
int);
2152 int expected_score = va_arg(args,
int);
2157 xmlNode *child = NULL;
2159 if (value != NULL) {
2171 }
else if (v < expected_score) {
2175 "(connectivity is degraded -- expected %d)",
2179 out->list_item(out, NULL,
"%s: %s",
name, value);
2189 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2192 gchar *node_str = NULL;
2193 char *last_change_str = NULL;
2197 time_t last_change = 0;
2205 const pcmk_node_t *node = pcmk__current_node(rsc);
2206 const char *target_role = g_hash_table_lookup(rsc->
meta,
2215 show_opts, target_role,
false);
2230 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
2231 node_str, pcmk__xe_history_key(xml_op),
2235 last_change_str ? last_change_str :
"",
2236 pcmk_exec_status_str(status));
2239 free(last_change_str);
2247 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2253 const char *status_s = NULL;
2256 time_t last_change = 0;
2257 xmlNode *node = NULL;
2261 status_s = pcmk_exec_status_str(status);
2282 (has_provider? provider :
""),
2294 const char *last_rc_change =
pcmk__trim(ctime(&last_change));
2306 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2309 const char *
name = va_arg(args,
const char *);
2310 const char *value = va_arg(args,
const char *);
2311 bool add_extra = va_arg(args,
int);
2312 int expected_score = va_arg(args,
int);
2320 char *buf = pcmk__itoa(expected_score);
2329 "bool",
"GList *",
"GList *")
2333 uint32_t show_opts = va_arg(args, uint32_t);
2334 bool print_spacer = va_arg(args,
int);
2335 GList *only_node = va_arg(args, GList *);
2336 GList *only_rsc = va_arg(args, GList *);
2341 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
2344 GList *attr_list = NULL;
2345 GHashTableIter iter;
2353 while (g_hash_table_iter_next (&iter, &key, NULL)) {
2354 attr_list = filter_attr_list(attr_list, key);
2357 if (attr_list == NULL) {
2362 g_list_free(attr_list);
2368 out->message(out,
"node", node, show_opts,
false, only_node, only_rsc);
2370 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
2371 const char *
name = aIter->data;
2372 const char *value = NULL;
2373 int expected_score = 0;
2374 bool add_extra =
false;
2382 out->message(out,
"node-attribute",
name, value, add_extra,
2386 g_list_free(attr_list);
2399 const char *comment = va_arg(args,
const char *);
2402 comment, pcmk__node_name(node));
2405 out->list_item(out, NULL,
"%s", dump_text);
2417 const char *comment = va_arg(args,
const char *);
2429 "xmlNode *",
"GList *",
"GList *",
"uint32_t",
"uint32_t")
2434 xmlNode *node_state = va_arg(args, xmlNode *);
2435 GList *only_node = va_arg(args, GList *);
2436 GList *only_rsc = va_arg(args, GList *);
2437 uint32_t section_opts = va_arg(args, uint32_t);
2438 uint32_t show_opts = va_arg(args, uint32_t);
2440 xmlNode *lrm_rsc = NULL;
2441 xmlNode *rsc_entry = NULL;
2456 if (rsc_id == NULL) {
2474 if (pcmk__is_group(
parent)) {
2488 time_t last_failure = 0;
2492 if (failcount <= 0) {
2498 out->message(out,
"node", node, show_opts,
false, only_node,
2502 out->message(out,
"resource-history", rsc, rsc_id,
false,
2503 failcount, last_failure,
false);
2505 GList *op_list = get_operation_list(rsc_entry);
2508 if (op_list == NULL) {
2517 out->message(out,
"node", node, show_opts,
false, only_node,
2521 out->message(out,
"resource-operation-list",
scheduler, rsc, node,
2522 op_list, show_opts);
2530 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2533 GList *nodes = va_arg(args, GList *);
2534 GList *only_node = va_arg(args, GList *);
2535 GList *only_rsc = va_arg(args, GList *);
2536 uint32_t show_opts = va_arg(args, uint32_t);
2537 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2541 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2551 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2558 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2561 GList *nodes = va_arg(args, GList *);
2562 GList *only_node = va_arg(args, GList *);
2563 GList *only_rsc = va_arg(args, GList *);
2564 uint32_t show_opts = va_arg(args, uint32_t);
2565 bool print_spacer = va_arg(args,
int);
2568 GString *online_nodes = NULL;
2569 GString *online_remote_nodes = NULL;
2570 GString *online_guest_nodes = NULL;
2571 GString *offline_nodes = NULL;
2572 GString *offline_remote_nodes = NULL;
2576 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2599 if (pcmk__is_guest_or_bundle_node(node)) {
2600 pcmk__add_word(&online_guest_nodes, 1024, node_name);
2602 }
else if (pcmk__is_remote_node(node)) {
2603 pcmk__add_word(&online_remote_nodes, 1024, node_name);
2606 pcmk__add_word(&online_nodes, 1024, node_name);
2613 if (pcmk__is_remote_node(node)) {
2614 pcmk__add_word(&offline_remote_nodes, 1024, node_name);
2616 }
else if (pcmk__is_guest_or_bundle_node(node)) {
2620 pcmk__add_word(&offline_nodes, 1024, node_name);
2627 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2632 if (online_nodes != NULL) {
2633 out->list_item(out,
"Online",
"[ %s ]",
2634 (
const char *) online_nodes->str);
2635 g_string_free(online_nodes, TRUE);
2637 if (offline_nodes != NULL) {
2638 out->list_item(out,
"OFFLINE",
"[ %s ]",
2639 (
const char *) offline_nodes->str);
2640 g_string_free(offline_nodes, TRUE);
2642 if (online_remote_nodes) {
2643 out->list_item(out,
"RemoteOnline",
"[ %s ]",
2644 (
const char *) online_remote_nodes->str);
2645 g_string_free(online_remote_nodes, TRUE);
2647 if (offline_remote_nodes) {
2648 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]",
2649 (
const char *) offline_remote_nodes->str);
2650 g_string_free(offline_remote_nodes, TRUE);
2652 if (online_guest_nodes != NULL) {
2653 out->list_item(out,
"GuestOnline",
"[ %s ]",
2654 (
const char *) online_guest_nodes->str);
2655 g_string_free(online_guest_nodes, TRUE);
2662 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2665 GList *nodes = va_arg(args, GList *);
2666 GList *only_node = va_arg(args, GList *);
2667 GList *only_rsc = va_arg(args, GList *);
2668 uint32_t show_opts = va_arg(args, uint32_t);
2669 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2676 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2684 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2692 "uint32_t",
"uint32_t",
"bool")
2696 GList *only_node = va_arg(args, GList *);
2697 GList *only_rsc = va_arg(args, GList *);
2698 uint32_t section_opts = va_arg(args, uint32_t);
2699 uint32_t show_opts = va_arg(args, uint32_t);
2700 bool print_spacer = va_arg(args,
int);
2702 xmlNode *node_state = NULL;
2707 if (xmlChildElementCount(cib_status) == 0) {
2716 pcmk__xe_id(node_state));
2730 out->message(out,
"node-history-list",
scheduler, node, node_state,
2731 only_node, only_rsc, section_opts, show_opts);
2739 "const char *",
"const char *")
2744 const char *prefix = va_arg(args,
const char *);
2745 const char *
uname = va_arg(args,
const char *);
2746 const char *score = va_arg(args,
const char *);
2749 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2750 prefix, rsc->
id,
uname, score);
2752 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2759 "const char *",
"const char *")
2764 const char *prefix = va_arg(args,
const char *);
2765 const char *
uname = va_arg(args,
const char *);
2766 const char *score = va_arg(args,
const char *);
2781 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2784 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2785 const char *task = va_arg(args,
const char *);
2786 const char *interval_ms_s = va_arg(args,
const char *);
2787 int rc = va_arg(args,
int);
2788 uint32_t show_opts = va_arg(args, uint32_t);
2790 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2793 out->list_item(out, NULL,
"%s", buf);
2799 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2802 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2803 const char *task = va_arg(args,
const char *);
2804 const char *interval_ms_s = va_arg(args,
const char *);
2805 int rc = va_arg(args,
int);
2806 uint32_t show_opts = va_arg(args, uint32_t);
2809 char *rc_s = pcmk__itoa(rc);
2810 const char *rc_text = services_ocf_exitcode_str(rc);
2811 xmlNodePtr node = NULL;
2821 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2828 const char *value = NULL;
2832 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2862 const char *score = va_arg(args,
const char *);
2864 if (chosen == NULL) {
2865 out->list_item(out, NULL,
"%s promotion score (inactive): %s",
2866 child_rsc->
id, score);
2868 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2869 child_rsc->
id, pcmk__node_name(chosen), score);
2881 const char *score = va_arg(args,
const char *);
2899 GString *xml_buf = g_string_sized_new(1024);
2900 bool raw = va_arg(args,
int);
2902 formatted_xml_buf(rsc, xml_buf, raw);
2906 g_string_free(xml_buf, TRUE);
2914 return resource_config(out, args);
2918 "bool",
"int",
"time_t",
"bool")
2922 const char *rsc_id = va_arg(args,
const char *);
2923 bool all = va_arg(args,
int);
2924 int failcount = va_arg(args,
int);
2925 time_t last_failure = va_arg(args, time_t);
2926 bool as_header = va_arg(args,
int);
2928 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2931 out->begin_list(out, NULL, NULL,
"%s", buf);
2933 out->list_item(out, NULL,
"%s", buf);
2941 "bool",
"int",
"time_t",
"bool")
2945 const char *rsc_id = va_arg(args,
const char *);
2946 bool all = va_arg(args,
int);
2947 int failcount = va_arg(args,
int);
2948 time_t last_failure = va_arg(args, time_t);
2949 bool as_header = va_arg(args,
int);
2958 }
else if (all || failcount || last_failure > 0) {
2967 if (failcount > 0) {
2968 char *s = pcmk__itoa(failcount);
2974 if (last_failure > 0) {
2994 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2996 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2998 out->
begin_list(out, NULL, NULL,
"Active Resources");
3004 "GList *",
"GList *",
"bool")
3009 uint32_t show_opts = va_arg(args, uint32_t);
3010 bool print_summary = va_arg(args,
int);
3011 GList *only_node = va_arg(args, GList *);
3012 GList *only_rsc = va_arg(args, GList *);
3013 bool print_spacer = va_arg(args,
int);
3017 bool printed_header =
false;
3034 print_resource_header(out, show_opts);
3035 printed_header =
true;
3047 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
3048 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
3062 && pcmk__is_primitive(rsc)) {
3075 if (!printed_header) {
3077 print_resource_header(out, show_opts);
3078 printed_header =
true;
3082 x = out->message(out, pcmk__map_element_name(rsc->
xml), show_opts, rsc,
3083 only_node, only_rsc);
3090 if (!printed_header) {
3092 print_resource_header(out, show_opts);
3093 printed_header =
true;
3097 out->list_item(out, NULL,
"No inactive resources");
3099 out->list_item(out, NULL,
"No resources");
3101 out->list_item(out, NULL,
"No active resources");
3105 if (printed_header) {
3113 "pcmk_resource_t *",
"pcmk_node_t *",
"GList *",
"uint32_t")
3121 GList *op_list = va_arg(args, GList *);
3122 uint32_t show_opts = va_arg(args, uint32_t);
3124 GList *gIter = NULL;
3128 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
3129 xmlNode *xml_op = (xmlNode *) gIter->data;
3146 time_t last_failure = 0;
3151 failcount, last_failure,
true);
3156 out->message(out,
"op-history", xml_op, task, interval_ms_s,
3157 op_rc_i, show_opts);
3161 g_list_free(op_list);
3174 const char *fn = va_arg(args,
const char *);
3177 fn, rsc->
id, pcmk__node_name(node));
3179 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
3180 out->list_item(out, NULL,
"%s", dump_text);
3194 const char *fn = va_arg(args,
const char *);
3196 xmlNodePtr xml_node = NULL;
3203 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
3212 bool raw = va_arg(args,
int);
3213 bool details = va_arg(args,
int);
3215 GString *detail_str = NULL;
3218 out->list_item(out, ticket->
id,
"%s", ticket->
id);
3222 if (details && g_hash_table_size(ticket->
state) > 0) {
3223 GHashTableIter iter;
3224 const char *
name = NULL;
3225 const char *value = NULL;
3226 bool already_added =
false;
3228 detail_str = g_string_sized_new(100);
3231 g_hash_table_iter_init(&iter, ticket->
state);
3232 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3233 if (already_added) {
3234 g_string_append_printf(detail_str,
", %s=",
name);
3236 g_string_append_printf(detail_str,
"%s=",
name);
3237 already_added =
true;
3241 char *epoch_str = NULL;
3268 if (detail_str == NULL) {
3271 out->list_item(out, NULL,
"%s\t%s%s last-granted=\"%s\"",
3273 (ticket->
granted?
"granted" :
"revoked"),
3274 (ticket->
standby?
" [standby]" :
""),
3275 pcmk__s(epoch_str,
""));
3278 out->list_item(out, NULL,
"%s\t%s%s %s",
3280 (ticket->
granted?
"granted" :
"revoked"),
3281 (ticket->
standby?
" [standby]" :
""),
3285 out->list_item(out, NULL,
"%s\t%s%s%s", ticket->
id,
3286 ticket->
granted ?
"granted" :
"revoked",
3287 ticket->
standby ?
" [standby]" :
"",
3288 detail_str != NULL ? detail_str->str :
"");
3291 if (detail_str != NULL) {
3292 g_string_free(detail_str, TRUE);
3302 bool raw G_GNUC_UNUSED = va_arg(args,
int);
3303 bool details G_GNUC_UNUSED = va_arg(args,
int);
3305 const char *status = NULL;
3306 const char *standby = pcmk__btoa(ticket->
standby);
3308 xmlNodePtr node = NULL;
3309 GHashTableIter iter;
3310 const char *
name = NULL;
3311 const char *value = NULL;
3328 g_hash_table_iter_init(&iter, ticket->
state);
3329 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3347 GHashTable *tickets = va_arg(args, GHashTable *);
3348 bool print_spacer = va_arg(args,
int);
3349 bool raw = va_arg(args,
int);
3350 bool details = va_arg(args,
int);
3352 GHashTableIter iter;
3355 if (g_hash_table_size(tickets) == 0) {
3362 out->begin_list(out, NULL, NULL,
"Tickets");
3365 g_hash_table_iter_init(&iter, tickets);
3366 while (g_hash_table_iter_next(&iter, NULL, &value)) {
3368 out->message(out,
"ticket", ticket, raw, details);
3377 {
"ban",
"default", ban_text },
3378 {
"ban",
"html", ban_html },
3379 {
"ban",
"xml", ban_xml },
3380 {
"ban-list",
"default", ban_list },
3386 {
"cluster-counts",
"default", cluster_counts_text },
3387 {
"cluster-counts",
"html", cluster_counts_html },
3388 {
"cluster-counts",
"xml", cluster_counts_xml },
3389 {
"cluster-dc",
"default", cluster_dc_text },
3390 {
"cluster-dc",
"html", cluster_dc_html },
3391 {
"cluster-dc",
"xml", cluster_dc_xml },
3392 {
"cluster-options",
"default", cluster_options_text },
3393 {
"cluster-options",
"html", cluster_options_html },
3394 {
"cluster-options",
"log", cluster_options_log },
3395 {
"cluster-options",
"xml", cluster_options_xml },
3396 {
"cluster-summary",
"default", cluster_summary },
3397 {
"cluster-summary",
"html", cluster_summary_html },
3398 {
"cluster-stack",
"default", cluster_stack_text },
3399 {
"cluster-stack",
"html", cluster_stack_html },
3400 {
"cluster-stack",
"xml", cluster_stack_xml },
3401 {
"cluster-times",
"default", cluster_times_text },
3402 {
"cluster-times",
"html", cluster_times_html },
3403 {
"cluster-times",
"xml", cluster_times_xml },
3404 {
"failed-action",
"default", failed_action_default },
3405 {
"failed-action",
"xml", failed_action_xml },
3406 {
"failed-action-list",
"default", failed_action_list },
3409 {
"maint-mode",
"text", cluster_maint_mode_text },
3410 {
"node",
"default", node_text },
3411 {
"node",
"html", node_html },
3412 {
"node",
"xml", node_xml },
3413 {
"node-and-op",
"default", node_and_op },
3414 {
"node-and-op",
"xml", node_and_op_xml },
3415 {
"node-capacity",
"default", node_capacity },
3416 {
"node-capacity",
"xml", node_capacity_xml },
3417 {
"node-history-list",
"default", node_history_list },
3418 {
"node-list",
"default", node_list_text },
3419 {
"node-list",
"html", node_list_html },
3420 {
"node-list",
"xml", node_list_xml },
3421 {
"node-weight",
"default", node_weight },
3422 {
"node-weight",
"xml", node_weight_xml },
3423 {
"node-attribute",
"default", node_attribute_text },
3424 {
"node-attribute",
"html", node_attribute_html },
3425 {
"node-attribute",
"xml", node_attribute_xml },
3426 {
"node-attribute-list",
"default", node_attribute_list },
3427 {
"node-summary",
"default", node_summary },
3428 {
"op-history",
"default", op_history_text },
3429 {
"op-history",
"xml", op_history_xml },
3433 {
"promotion-score",
"default", promotion_score },
3434 {
"promotion-score",
"xml", promotion_score_xml },
3435 {
"resource-config",
"default", resource_config },
3436 {
"resource-config",
"text", resource_config_text },
3437 {
"resource-history",
"default", resource_history_text },
3438 {
"resource-history",
"xml", resource_history_xml },
3439 {
"resource-list",
"default", resource_list },
3440 {
"resource-operation-list",
"default", resource_operation_list },
3441 {
"resource-util",
"default", resource_util },
3442 {
"resource-util",
"xml", resource_util_xml },
3443 {
"ticket",
"default", ticket_default },
3444 {
"ticket",
"xml", ticket_xml },
3445 {
"ticket-list",
"default", ticket_list },
3447 { 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
enum pe_quorum_policy no_quorum_policy
#define PCMK_XE_NODES_CONFIGURED
#define PCMK_XA_EXPECTED_UP
#define PCMK__XE_LRM_RESOURCES
char * pcmk__xml_escape(const char *text, enum pcmk__xml_escape_type type)
#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
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
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
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)
PCMK__OUTPUT_ARGS("cluster-summary", "pcmk_scheduler_t *", "enum pcmk_pacemakerd_state", "uint32_t", "uint32_t")
#define PCMK_VALUE_GRANTED
int priority_fencing_delay
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)
#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
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
#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)
void pcmk__xe_set_bool_attr(xmlNodePtr node, const char *name, bool value)
#define PCMK_XA_QUEUE_TIME
void pcmk__xe_set_propv(xmlNodePtr node, va_list pairs)
#define PCMK_XA_MIXED_VERSION
#define PCMK_VALUE_REVOKED
enum crm_ais_msg_types type
const char * rsc_printable_id(const pcmk_resource_t *rsc)
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
pcmk_resource_t * container
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)
int pe__bundle_html(pcmk__output_t *out, va_list args)
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
void pcmk__xe_set_content(xmlNode *node, const char *format,...) G_GNUC_PRINTF(2
#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
#define PCMK__ROLE_PROMOTED_LEGACY
#define PCMK__XE_LRM_RESOURCE
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define PCMK_XE_RESOURCE_HISTORY
#define CRM_ATTR_FEATURE_SET
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options)
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.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
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__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
xmlNode * pcmk_find_cib_element(xmlNode *cib, const char *element_name)
Find an element in the CIB.
#define PCMK_XE_UTILIZATION
#define PCMK__VALUE_WARNING
bool pcmk_xe_mask_probe_failure(const xmlNode *xml_op)
Check whether an action history entry represents a maskable probe.
#define PCMK_XA_DESCRIPTION
#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)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
int pe__node_health(pcmk_node_t *node)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#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
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 crm_time_log_with_timezone
bool pcmk__str_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
#define PCMK_XE_CURRENT_DC
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
xmlNode * pcmk__html_create(xmlNode *parent, const char *name, const char *id, const char *class)
#define PCMK__XA_PROMOTED_ONLY_LEGACY
#define PCMK_VALUE_FENCE_LEGACY
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
#define PCMK_XA_MAINTENANCE
int pe__resource_xml(pcmk__output_t *out, va_list args)
#define PCMK__VALUE_HEALTH_RED
#define pcmk__assert(expr)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
#define PCMK_VALUE_ONLINE
#define PCMK_XA_FAIL_COUNT
#define PCMK_XA_EXEC_TIME
gboolean(* active)(pcmk_resource_t *rsc, gboolean all)
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)
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)
#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
#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
gboolean(* is_filtered)(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
#define PCMK__VALUE_MAINT
GList * placement_constraints
#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.
pcmk_node_t * pending_node
gboolean crm_is_true(const char *s)
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
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
#define PCMK_XA_WITH_QUORUM
#define pcmk__assert_alloc(nmemb, size)
#define PCMK_XA_RESOURCES_RUNNING
#define PCMK_VALUE_OFFLINE
xmlNode * pcmk__xe_next_same(const xmlNode *node)
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
pcmk_resource_t * remote_rsc
#define PCMK_ACTION_NOTIFY
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)
Where resource is running.