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;
568 if (print_detail && pcmk__is_guest_or_bundle_node(node)) {
570 const pcmk_node_t *host_node = pcmk__current_node(container);
572 if (host_node && host_node->
details) {
575 if (node_host == NULL) {
588 name_len += strlen(node_host) + 1;
591 name_len += strlen(node_id) + 3;
598 strcat(node_name,
"@");
599 strcat(node_name, node_host);
602 strcat(node_name,
" (");
603 strcat(node_name, node_id);
604 strcat(node_name,
")");
613 xmlNodePtr xml_node = NULL;
622 va_start(pairs, tag_name);
636 #ifdef PCMK__COMPAT_2_0 650 uint32_t show_opts = va_arg(args, uint32_t);
655 location->
id, location->
rsc->
id,
670 uint32_t show_opts = va_arg(args, uint32_t);
674 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
675 location->
id, location->
rsc->
id,
687 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
690 char *weight_s = pcmk__itoa(pe_node->
weight);
716 const char *prefix = va_arg(args,
const char *);
717 GList *only_rsc = va_arg(args, GList *);
718 uint32_t show_opts = va_arg(args, uint32_t);
719 bool print_spacer = va_arg(args,
int);
721 GList *gIter, *gIter2;
726 gIter != NULL; gIter = gIter->next) {
730 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
741 for (gIter2 = location->
nodes; gIter2 != NULL; gIter2 = gIter2->next) {
746 out->message(out,
"ban", node, location, show_opts);
758 unsigned int nnodes = va_arg(args,
unsigned int);
759 int nresources = va_arg(args,
int);
760 int ndisabled = va_arg(args,
int);
761 int nblocked = va_arg(args,
int);
765 xmlNode *child = NULL;
771 if (ndisabled && nblocked) {
790 }
else if (ndisabled && !nblocked) {
803 }
else if (!ndisabled && nblocked) {
828 unsigned int nnodes = va_arg(args,
unsigned int);
829 int nresources = va_arg(args,
int);
830 int ndisabled = va_arg(args,
int);
831 int nblocked = va_arg(args,
int);
833 out->list_item(out, NULL,
"%d node%s configured",
836 if (ndisabled && nblocked) {
837 out->list_item(out, NULL,
"%d resource instance%s configured " 838 "(%d DISABLED, %d BLOCKED from " 839 "further action due to failure)",
842 }
else if (ndisabled && !nblocked) {
843 out->list_item(out, NULL,
"%d resource instance%s configured " 846 }
else if (!ndisabled && nblocked) {
847 out->list_item(out, NULL,
"%d resource instance%s configured " 848 "(%d BLOCKED from further action " 852 out->list_item(out, NULL,
"%d resource instance%s configured",
862 unsigned int nnodes = va_arg(args,
unsigned int);
863 int nresources = va_arg(args,
int);
864 int ndisabled = va_arg(args,
int);
865 int nblocked = va_arg(args,
int);
867 xmlNodePtr nodes_node = NULL;
868 xmlNodePtr resources_node = NULL;
877 s = pcmk__itoa(nnodes);
881 s = pcmk__itoa(nresources);
885 s = pcmk__itoa(ndisabled);
889 s = pcmk__itoa(nblocked);
901 const char *quorum = va_arg(args,
const char *);
902 const char *dc_version_s = va_arg(args,
const char *);
903 char *dc_name = va_arg(args,
char *);
904 bool mixed_version = va_arg(args,
int);
907 xmlNode *child = NULL;
915 dc_name, pcmk__s(dc_version_s,
"unknown"));
953 const char *quorum = va_arg(args,
const char *);
954 const char *dc_version_s = va_arg(args,
const char *);
955 char *dc_name = va_arg(args,
char *);
956 bool mixed_version = va_arg(args,
int);
959 out->list_item(out,
"Current DC",
960 "%s (version %s) - %spartition %s quorum",
961 dc_name, dc_version_s ? dc_version_s :
"unknown",
962 mixed_version ?
"MIXED-VERSION " :
"",
965 out->list_item(out,
"Current DC",
"NONE");
976 const char *quorum = va_arg(args,
const char *);
977 const char *dc_version_s = va_arg(args,
const char *);
978 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
979 bool mixed_version = va_arg(args,
int);
982 const char *with_quorum = pcmk__btoa(
crm_is_true(quorum));
983 const char *mixed_version_s = pcmk__btoa(mixed_version);
1005 unsigned long long flags = va_arg(args,
unsigned long long);
1026 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1028 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1032 out->list_item(out, NULL,
"Cluster is symmetric");
1034 out->list_item(out, NULL,
"Cluster is asymmetric");
1039 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1043 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1047 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1048 "resources and stop all other resources");
1052 out->list_item(out, NULL,
"No quorum policy: Ignore");
1056 out->list_item(out, NULL,
"No quorum policy: Suicide");
1062 xmlNode *child = NULL;
1072 " (the cluster will not attempt to start, stop," 1073 " or recover services)");
1077 xmlNode *child = NULL;
1087 " (the cluster will keep all resources stopped)");
1090 out->list_item(out, NULL,
"Resource management: enabled");
1102 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
1104 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
1116 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1118 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1122 out->list_item(out, NULL,
"Cluster is symmetric");
1124 out->list_item(out, NULL,
"Cluster is asymmetric");
1129 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1133 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1137 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1138 "resources and stop all other resources");
1142 out->list_item(out, NULL,
"No quorum policy: Ignore");
1146 out->list_item(out, NULL,
"No quorum policy: Suicide");
1192 const char *symmetric_cluster =
1194 const char *no_quorum_policy =
1198 const char *stop_all_resources = pcmk__flag_text(
scheduler->
flags,
1201 char *priority_fencing_delay_ms_s =
1211 stonith_timeout_ms_s,
1213 priority_fencing_delay_ms_s,
1215 free(stonith_timeout_ms_s);
1216 free(priority_fencing_delay_ms_s);
1221 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1224 const char *stack_s = va_arg(args,
const char *);
1229 xmlNode *child = NULL;
1251 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1254 const char *stack_s = va_arg(args,
const char *);
1259 out->list_item(out,
"Stack",
"%s (%s)",
1262 out->list_item(out,
"Stack",
"%s", stack_s);
1268 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1271 const char *stack_s = va_arg(args,
const char *);
1275 const char *state_s = NULL;
1290 "const char *",
"const char *",
"const char *")
1293 const char *our_nodename = va_arg(args,
const char *);
1294 const char *last_written = va_arg(args,
const char *);
1295 const char *user = va_arg(args,
const char *);
1296 const char *client = va_arg(args,
const char *);
1297 const char *origin = va_arg(args,
const char *);
1301 xmlNode *child = NULL;
1303 char *time_s = NULL;
1314 if (our_nodename != NULL) {
1327 time_s = last_changed_string(last_written, user, client, origin);
1335 "const char *",
"const char *",
"const char *")
1338 const char *our_nodename = va_arg(args,
const char *);
1339 const char *last_written = va_arg(args,
const char *);
1340 const char *user = va_arg(args,
const char *);
1341 const char *client = va_arg(args,
const char *);
1342 const char *origin = va_arg(args,
const char *);
1363 "const char *",
"const char *",
"const char *")
1366 const char *our_nodename = va_arg(args,
const char *);
1367 const char *last_written = va_arg(args,
const char *);
1368 const char *user = va_arg(args,
const char *);
1369 const char *client = va_arg(args,
const char *);
1370 const char *origin = va_arg(args,
const char *);
1374 out->list_item(out,
"Last updated",
"%s%s%s",
1375 time_s, (our_nodename != NULL)?
" on " :
"",
1376 pcmk__s(our_nodename,
""));
1379 time_s = last_changed_string(last_written, user, client, origin);
1381 out->list_item(out,
"Last change",
" %s", time_s);
1401 failed_action_friendly(
pcmk__output_t *out,
const xmlNode *xml_op,
1402 const char *op_key,
const char *node_name,
int rc,
1403 int status,
const char *exit_reason,
1404 const char *exec_time)
1406 char *rsc_id = NULL;
1408 guint interval_ms = 0;
1409 time_t last_change_epoch = 0;
1410 GString *str = NULL;
1412 if (pcmk__str_empty(op_key)
1413 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1419 CRM_ASSERT((rsc_id != NULL) && (task != NULL));
1421 str = g_string_sized_new(256);
1425 if (interval_ms != 0) {
1429 pcmk__g_strcat(str, pcmk__readable_action(task, interval_ms),
" on ",
1433 pcmk__g_strcat(str,
" returned '", services_ocf_exitcode_str(rc),
"'",
1435 if (!pcmk__str_empty(exit_reason)) {
1441 pcmk_exec_status_str(status), NULL);
1442 if (!pcmk__str_empty(exit_reason)) {
1445 g_string_append_c(str,
')');
1450 &last_change_epoch) ==
pcmk_ok) {
1456 if (!pcmk__str_empty(exec_time)) {
1457 int exec_time_ms = 0;
1460 && (exec_time_ms > 0)) {
1467 out->
list_item(out, NULL,
"%s", str->str);
1468 g_string_free(str, TRUE);
1487 failed_action_technical(
pcmk__output_t *out,
const xmlNode *xml_op,
1488 const char *op_key,
const char *node_name,
int rc,
1489 int status,
const char *exit_reason,
1490 const char *exec_time)
1494 const char *exit_status = services_ocf_exitcode_str(rc);
1495 const char *lrm_status = pcmk_exec_status_str(status);
1496 time_t last_change_epoch = 0;
1497 GString *str = NULL;
1499 if (pcmk__str_empty(op_key)) {
1500 op_key =
"unknown operation";
1502 if (pcmk__str_empty(exit_status)) {
1503 exit_status =
"unknown exit status";
1505 if (pcmk__str_empty(call_id)) {
1506 call_id =
"unknown";
1509 str = g_string_sized_new(256);
1511 g_string_append_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1512 op_key, node_name, exit_status, rc, call_id,
1515 if (!pcmk__str_empty(exit_reason)) {
1520 &last_change_epoch) ==
pcmk_ok) {
1525 "'", last_change_str,
"'", NULL);
1526 free(last_change_str);
1528 if (!pcmk__str_empty(queue_time)) {
1531 if (!pcmk__str_empty(exec_time)) {
1535 out->
list_item(out, NULL,
"%s", str->str);
1536 g_string_free(str, TRUE);
1543 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1544 uint32_t show_opts = va_arg(args, uint32_t);
1546 const char *op_key = pcmk__xe_history_key(xml_op);
1559 if (pcmk__str_empty(node_name)) {
1560 node_name =
"unknown node";
1564 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1565 exit_reason, exec_time);
1567 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1568 exit_reason, exec_time);
1576 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1577 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1579 const char *op_key = pcmk__xe_history_key(xml_op);
1585 const char *exitstatus = NULL;
1589 const char *status_s = NULL;
1592 gchar *exit_reason_esc = NULL;
1594 xmlNodePtr node = NULL;
1598 exit_reason = exit_reason_esc;
1607 exitstatus = services_ocf_exitcode_str(rc);
1608 rc_s = pcmk__itoa(rc);
1609 status_s = pcmk_exec_status_str(status);
1611 op_key_name, op_key,
1622 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1627 guint interval_ms = 0;
1628 char *interval_ms_s = NULL;
1645 free(interval_ms_s);
1649 g_free(exit_reason_esc);
1654 "GList *",
"uint32_t",
"bool")
1658 GList *only_node = va_arg(args, GList *);
1659 GList *only_rsc = va_arg(args, GList *);
1660 uint32_t show_opts = va_arg(args, uint32_t);
1661 bool print_spacer = va_arg(args,
int);
1663 xmlNode *xml_op = NULL;
1671 xml_op != NULL; xml_op = pcmk__xe_next(xml_op)) {
1685 if (!
parse_op_key(pcmk__xe_history_key(xml_op), &rsc, NULL, NULL)) {
1697 out->message(out,
"failed-action", xml_op, show_opts);
1708 xmlNode *child = NULL;
1728 " with active resources)");
1740 " (in standby, with active resources)");
1761 }
else if (health == 0) {
1769 const char *feature_set = get_node_feature_set(node);
1770 if (feature_set != NULL) {
1778 "GList *",
"GList *")
1782 uint32_t show_opts = va_arg(args, uint32_t);
1783 bool full = va_arg(args,
int);
1784 GList *only_node = va_arg(args, GList *);
1785 GList *only_rsc = va_arg(args, GList *);
1790 xmlNode *item_node = NULL;
1791 xmlNode *child = NULL;
1796 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1800 status_node(node, item_node, show_opts);
1804 out->begin_list(out, NULL, NULL,
"Resources");
1816 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1820 status_node(node, item_node, show_opts);
1827 out->message(out, pcmk__map_element_name(rsc->
xml), show_opts,
1828 rsc, only_node, only_rsc);
1840 status_node(node, item_node, show_opts);
1843 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1863 return "UNCLEAN (online)";
1866 return "UNCLEAN (pending)";
1869 return "UNCLEAN (offline)";
1881 return "standby (with active resources)";
1886 return "OFFLINE (standby)";
1891 return "maintenance";
1893 return "OFFLINE (maintenance)";
1908 uint32_t show_opts = va_arg(args, uint32_t);
1909 bool full = va_arg(args,
int);
1910 GList *only_node = va_arg(args, GList *);
1911 GList *only_rsc = va_arg(args, GList *);
1915 GString *str = g_string_sized_new(64);
1919 if (pcmk__is_guest_or_bundle_node(node)) {
1920 g_string_append(str,
"GuestNode");
1921 }
else if (pcmk__is_remote_node(node)) {
1922 g_string_append(str,
"RemoteNode");
1924 g_string_append(str,
"Node");
1926 pcmk__g_strcat(str,
" ", node_name,
": ", node_text_status(node), NULL);
1929 g_string_append(str,
" (health is RED)");
1930 }
else if (health == 0) {
1931 g_string_append(str,
" (health is YELLOW)");
1934 const char *feature_set = get_node_feature_set(node);
1935 if (feature_set != NULL) {
1947 out->begin_list(out, NULL, NULL,
"%s", str->str);
1948 out->begin_list(out, NULL, NULL,
"Resources");
1959 GList *gIter2 = NULL;
1961 out->begin_list(out, NULL, NULL,
"%s", str->str);
1962 out->begin_list(out, NULL, NULL,
"Resources");
1968 out->message(out, pcmk__map_element_name(rsc->
xml),
1969 show_opts, rsc, only_node, only_rsc);
1976 out->list_item(out, NULL,
"%s", str->str);
1979 g_string_free(str, TRUE);
1983 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
2001 health_text(
int health)
2005 }
else if (health == 0) {
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 *);
2056 const char *feature_set = get_node_feature_set(node);
2061 char *resources_running = pcmk__itoa(length);
2084 free(resources_running);
2087 if (pcmk__is_guest_or_bundle_node(node)) {
2100 out->message(out, pcmk__map_element_name(rsc->
xml), show_opts,
2101 rsc, only_node, only_rsc);
2115 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2118 const char *
name = va_arg(args,
const char *);
2119 const char *value = va_arg(args,
const char *);
2120 bool add_extra = va_arg(args,
int);
2121 int expected_score = va_arg(args,
int);
2126 if (value == NULL) {
2132 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
2133 }
else if (v < expected_score) {
2134 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
2136 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2139 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
2145 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2148 const char *
name = va_arg(args,
const char *);
2149 const char *value = va_arg(args,
const char *);
2150 bool add_extra = va_arg(args,
int);
2151 int expected_score = va_arg(args,
int);
2156 xmlNode *child = NULL;
2158 if (value != NULL) {
2170 }
else if (v < expected_score) {
2174 "(connectivity is degraded -- expected %d)",
2178 out->list_item(out, NULL,
"%s: %s",
name, value);
2188 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2191 gchar *node_str = NULL;
2192 char *last_change_str = NULL;
2196 time_t last_change = 0;
2204 const pcmk_node_t *node = pcmk__current_node(rsc);
2205 const char *target_role = g_hash_table_lookup(rsc->
meta,
2214 show_opts, target_role,
false);
2229 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
2230 node_str, pcmk__xe_history_key(xml_op),
2234 last_change_str ? last_change_str :
"",
2235 pcmk_exec_status_str(status));
2238 free(last_change_str);
2246 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2252 const char *status_s = NULL;
2255 time_t last_change = 0;
2256 xmlNode *node = NULL;
2260 status_s = pcmk_exec_status_str(status);
2281 (has_provider? provider :
""),
2293 const char *last_rc_change =
pcmk__trim(ctime(&last_change));
2305 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2308 const char *
name = va_arg(args,
const char *);
2309 const char *value = va_arg(args,
const char *);
2310 bool add_extra = va_arg(args,
int);
2311 int expected_score = va_arg(args,
int);
2319 char *buf = pcmk__itoa(expected_score);
2328 "bool",
"GList *",
"GList *")
2332 uint32_t show_opts = va_arg(args, uint32_t);
2333 bool print_spacer = va_arg(args,
int);
2334 GList *only_node = va_arg(args, GList *);
2335 GList *only_rsc = va_arg(args, GList *);
2340 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
2343 GList *attr_list = NULL;
2344 GHashTableIter iter;
2352 while (g_hash_table_iter_next (&iter, &key, NULL)) {
2353 attr_list = filter_attr_list(attr_list, key);
2356 if (attr_list == NULL) {
2361 g_list_free(attr_list);
2367 out->message(out,
"node", node, show_opts,
false, only_node, only_rsc);
2369 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
2370 const char *
name = aIter->data;
2371 const char *value = NULL;
2372 int expected_score = 0;
2373 bool add_extra =
false;
2381 out->message(out,
"node-attribute",
name, value, add_extra,
2385 g_list_free(attr_list);
2398 const char *comment = va_arg(args,
const char *);
2401 comment, pcmk__node_name(node));
2404 out->list_item(out, NULL,
"%s", dump_text);
2416 const char *comment = va_arg(args,
const char *);
2428 "xmlNode *",
"GList *",
"GList *",
"uint32_t",
"uint32_t")
2433 xmlNode *node_state = va_arg(args, xmlNode *);
2434 GList *only_node = va_arg(args, GList *);
2435 GList *only_rsc = va_arg(args, GList *);
2436 uint32_t section_opts = va_arg(args, uint32_t);
2437 uint32_t show_opts = va_arg(args, uint32_t);
2439 xmlNode *lrm_rsc = NULL;
2440 xmlNode *rsc_entry = NULL;
2463 if (pcmk__is_group(
parent)) {
2477 time_t last_failure = 0;
2481 if (failcount <= 0) {
2487 out->message(out,
"node", node, show_opts,
false, only_node,
2491 out->message(out,
"resource-history", rsc, rsc_id,
false,
2492 failcount, last_failure,
false);
2494 GList *op_list = get_operation_list(rsc_entry);
2497 if (op_list == NULL) {
2506 out->message(out,
"node", node, show_opts,
false, only_node,
2510 out->message(out,
"resource-operation-list",
scheduler, rsc, node,
2511 op_list, show_opts);
2519 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2522 GList *nodes = va_arg(args, GList *);
2523 GList *only_node = va_arg(args, GList *);
2524 GList *only_rsc = va_arg(args, GList *);
2525 uint32_t show_opts = va_arg(args, uint32_t);
2526 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2530 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2540 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2547 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2550 GList *nodes = va_arg(args, GList *);
2551 GList *only_node = va_arg(args, GList *);
2552 GList *only_rsc = va_arg(args, GList *);
2553 uint32_t show_opts = va_arg(args, uint32_t);
2554 bool print_spacer = va_arg(args,
int);
2557 GString *online_nodes = NULL;
2558 GString *online_remote_nodes = NULL;
2559 GString *online_guest_nodes = NULL;
2560 GString *offline_nodes = NULL;
2561 GString *offline_remote_nodes = NULL;
2565 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2588 if (pcmk__is_guest_or_bundle_node(node)) {
2589 pcmk__add_word(&online_guest_nodes, 1024, node_name);
2591 }
else if (pcmk__is_remote_node(node)) {
2592 pcmk__add_word(&online_remote_nodes, 1024, node_name);
2595 pcmk__add_word(&online_nodes, 1024, node_name);
2602 if (pcmk__is_remote_node(node)) {
2603 pcmk__add_word(&offline_remote_nodes, 1024, node_name);
2605 }
else if (pcmk__is_guest_or_bundle_node(node)) {
2609 pcmk__add_word(&offline_nodes, 1024, node_name);
2616 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2621 if (online_nodes != NULL) {
2622 out->list_item(out,
"Online",
"[ %s ]",
2623 (
const char *) online_nodes->str);
2624 g_string_free(online_nodes, TRUE);
2626 if (offline_nodes != NULL) {
2627 out->list_item(out,
"OFFLINE",
"[ %s ]",
2628 (
const char *) offline_nodes->str);
2629 g_string_free(offline_nodes, TRUE);
2631 if (online_remote_nodes) {
2632 out->list_item(out,
"RemoteOnline",
"[ %s ]",
2633 (
const char *) online_remote_nodes->str);
2634 g_string_free(online_remote_nodes, TRUE);
2636 if (offline_remote_nodes) {
2637 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]",
2638 (
const char *) offline_remote_nodes->str);
2639 g_string_free(offline_remote_nodes, TRUE);
2641 if (online_guest_nodes != NULL) {
2642 out->list_item(out,
"GuestOnline",
"[ %s ]",
2643 (
const char *) online_guest_nodes->str);
2644 g_string_free(online_guest_nodes, TRUE);
2651 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2654 GList *nodes = va_arg(args, GList *);
2655 GList *only_node = va_arg(args, GList *);
2656 GList *only_rsc = va_arg(args, GList *);
2657 uint32_t show_opts = va_arg(args, uint32_t);
2658 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2665 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2673 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2681 "uint32_t",
"uint32_t",
"bool")
2685 GList *only_node = va_arg(args, GList *);
2686 GList *only_rsc = va_arg(args, GList *);
2687 uint32_t section_opts = va_arg(args, uint32_t);
2688 uint32_t show_opts = va_arg(args, uint32_t);
2689 bool print_spacer = va_arg(args,
int);
2691 xmlNode *node_state = NULL;
2696 if (xmlChildElementCount(cib_status) == 0) {
2705 pcmk__xe_id(node_state));
2719 out->message(out,
"node-history-list",
scheduler, node, node_state,
2720 only_node, only_rsc, section_opts, show_opts);
2728 "const char *",
"const char *")
2733 const char *prefix = va_arg(args,
const char *);
2734 const char *
uname = va_arg(args,
const char *);
2735 const char *score = va_arg(args,
const char *);
2738 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2739 prefix, rsc->
id,
uname, score);
2741 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2748 "const char *",
"const char *")
2753 const char *prefix = va_arg(args,
const char *);
2754 const char *
uname = va_arg(args,
const char *);
2755 const char *score = va_arg(args,
const char *);
2770 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2773 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2774 const char *task = va_arg(args,
const char *);
2775 const char *interval_ms_s = va_arg(args,
const char *);
2776 int rc = va_arg(args,
int);
2777 uint32_t show_opts = va_arg(args, uint32_t);
2779 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2782 out->list_item(out, NULL,
"%s", buf);
2788 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNode *",
"const char *",
"const char *",
"int",
"uint32_t")
2791 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2792 const char *task = va_arg(args,
const char *);
2793 const char *interval_ms_s = va_arg(args,
const char *);
2794 int rc = va_arg(args,
int);
2795 uint32_t show_opts = va_arg(args, uint32_t);
2798 char *rc_s = pcmk__itoa(rc);
2799 const char *rc_text = services_ocf_exitcode_str(rc);
2800 xmlNodePtr node = NULL;
2810 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2817 const char *value = NULL;
2821 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2851 const char *score = va_arg(args,
const char *);
2853 if (chosen == NULL) {
2854 out->list_item(out, NULL,
"%s promotion score (inactive): %s",
2855 child_rsc->
id, score);
2857 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2858 child_rsc->
id, pcmk__node_name(chosen), score);
2870 const char *score = va_arg(args,
const char *);
2888 GString *xml_buf = g_string_sized_new(1024);
2889 bool raw = va_arg(args,
int);
2891 formatted_xml_buf(rsc, xml_buf, raw);
2895 g_string_free(xml_buf, TRUE);
2903 return resource_config(out, args);
2907 "bool",
"int",
"time_t",
"bool")
2911 const char *rsc_id = va_arg(args,
const char *);
2912 bool all = va_arg(args,
int);
2913 int failcount = va_arg(args,
int);
2914 time_t last_failure = va_arg(args, time_t);
2915 bool as_header = va_arg(args,
int);
2917 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2920 out->begin_list(out, NULL, NULL,
"%s", buf);
2922 out->list_item(out, NULL,
"%s", buf);
2930 "bool",
"int",
"time_t",
"bool")
2934 const char *rsc_id = va_arg(args,
const char *);
2935 bool all = va_arg(args,
int);
2936 int failcount = va_arg(args,
int);
2937 time_t last_failure = va_arg(args, time_t);
2938 bool as_header = va_arg(args,
int);
2947 }
else if (all || failcount || last_failure > 0) {
2956 if (failcount > 0) {
2957 char *s = pcmk__itoa(failcount);
2963 if (last_failure > 0) {
2983 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2985 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2987 out->
begin_list(out, NULL, NULL,
"Active Resources");
2993 "GList *",
"GList *",
"bool")
2998 uint32_t show_opts = va_arg(args, uint32_t);
2999 bool print_summary = va_arg(args,
int);
3000 GList *only_node = va_arg(args, GList *);
3001 GList *only_rsc = va_arg(args, GList *);
3002 bool print_spacer = va_arg(args,
int);
3006 bool printed_header =
false;
3023 print_resource_header(out, show_opts);
3024 printed_header =
true;
3036 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
3037 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
3051 && pcmk__is_primitive(rsc)) {
3064 if (!printed_header) {
3066 print_resource_header(out, show_opts);
3067 printed_header =
true;
3071 x = out->message(out, pcmk__map_element_name(rsc->
xml), show_opts, rsc,
3072 only_node, only_rsc);
3079 if (!printed_header) {
3081 print_resource_header(out, show_opts);
3082 printed_header =
true;
3086 out->list_item(out, NULL,
"No inactive resources");
3088 out->list_item(out, NULL,
"No resources");
3090 out->list_item(out, NULL,
"No active resources");
3094 if (printed_header) {
3102 "pcmk_resource_t *",
"pcmk_node_t *",
"GList *",
"uint32_t")
3110 GList *op_list = va_arg(args, GList *);
3111 uint32_t show_opts = va_arg(args, uint32_t);
3113 GList *gIter = NULL;
3117 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
3118 xmlNode *xml_op = (xmlNode *) gIter->data;
3135 time_t last_failure = 0;
3140 failcount, last_failure,
true);
3145 out->message(out,
"op-history", xml_op, task, interval_ms_s,
3146 op_rc_i, show_opts);
3150 g_list_free(op_list);
3163 const char *fn = va_arg(args,
const char *);
3166 fn, rsc->
id, pcmk__node_name(node));
3168 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
3169 out->list_item(out, NULL,
"%s", dump_text);
3183 const char *fn = va_arg(args,
const char *);
3185 xmlNodePtr xml_node = NULL;
3192 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
3201 bool raw = va_arg(args,
int);
3202 bool details = va_arg(args,
int);
3204 GString *detail_str = NULL;
3207 out->list_item(out, ticket->
id,
"%s", ticket->
id);
3211 if (details && g_hash_table_size(ticket->
state) > 0) {
3212 GHashTableIter iter;
3213 const char *
name = NULL;
3214 const char *value = NULL;
3215 bool already_added =
false;
3217 detail_str = g_string_sized_new(100);
3220 g_hash_table_iter_init(&iter, ticket->
state);
3221 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3222 if (already_added) {
3223 g_string_append_printf(detail_str,
", %s=",
name);
3225 g_string_append_printf(detail_str,
"%s=",
name);
3226 already_added =
true;
3230 char *epoch_str = NULL;
3257 if (detail_str == NULL) {
3260 out->list_item(out, NULL,
"%s\t%s%s last-granted=\"%s\"",
3262 (ticket->
granted?
"granted" :
"revoked"),
3263 (ticket->
standby?
" [standby]" :
""),
3264 pcmk__s(epoch_str,
""));
3267 out->list_item(out, NULL,
"%s\t%s%s %s",
3269 (ticket->
granted?
"granted" :
"revoked"),
3270 (ticket->
standby?
" [standby]" :
""),
3274 out->list_item(out, NULL,
"%s\t%s%s%s", ticket->
id,
3275 ticket->
granted ?
"granted" :
"revoked",
3276 ticket->
standby ?
" [standby]" :
"",
3277 detail_str != NULL ? detail_str->str :
"");
3280 if (detail_str != NULL) {
3281 g_string_free(detail_str, TRUE);
3291 bool raw G_GNUC_UNUSED = va_arg(args,
int);
3292 bool details G_GNUC_UNUSED = va_arg(args,
int);
3294 const char *status = NULL;
3295 const char *standby = pcmk__btoa(ticket->
standby);
3297 xmlNodePtr node = NULL;
3298 GHashTableIter iter;
3299 const char *
name = NULL;
3300 const char *value = NULL;
3317 g_hash_table_iter_init(&iter, ticket->
state);
3318 while (g_hash_table_iter_next(&iter, (
void **) &
name, (
void **) &value)) {
3336 GHashTable *tickets = va_arg(args, GHashTable *);
3337 bool print_spacer = va_arg(args,
int);
3338 bool raw = va_arg(args,
int);
3339 bool details = va_arg(args,
int);
3341 GHashTableIter iter;
3344 if (g_hash_table_size(tickets) == 0) {
3351 out->begin_list(out, NULL, NULL,
"Tickets");
3354 g_hash_table_iter_init(&iter, tickets);
3355 while (g_hash_table_iter_next(&iter, NULL, &value)) {
3357 out->message(out,
"ticket", ticket, raw, details);
3366 {
"ban",
"default", ban_text },
3367 {
"ban",
"html", ban_html },
3368 {
"ban",
"xml", ban_xml },
3369 {
"ban-list",
"default", ban_list },
3375 {
"cluster-counts",
"default", cluster_counts_text },
3376 {
"cluster-counts",
"html", cluster_counts_html },
3377 {
"cluster-counts",
"xml", cluster_counts_xml },
3378 {
"cluster-dc",
"default", cluster_dc_text },
3379 {
"cluster-dc",
"html", cluster_dc_html },
3380 {
"cluster-dc",
"xml", cluster_dc_xml },
3381 {
"cluster-options",
"default", cluster_options_text },
3382 {
"cluster-options",
"html", cluster_options_html },
3383 {
"cluster-options",
"log", cluster_options_log },
3384 {
"cluster-options",
"xml", cluster_options_xml },
3385 {
"cluster-summary",
"default", cluster_summary },
3386 {
"cluster-summary",
"html", cluster_summary_html },
3387 {
"cluster-stack",
"default", cluster_stack_text },
3388 {
"cluster-stack",
"html", cluster_stack_html },
3389 {
"cluster-stack",
"xml", cluster_stack_xml },
3390 {
"cluster-times",
"default", cluster_times_text },
3391 {
"cluster-times",
"html", cluster_times_html },
3392 {
"cluster-times",
"xml", cluster_times_xml },
3393 {
"failed-action",
"default", failed_action_default },
3394 {
"failed-action",
"xml", failed_action_xml },
3395 {
"failed-action-list",
"default", failed_action_list },
3398 {
"maint-mode",
"text", cluster_maint_mode_text },
3399 {
"node",
"default", node_text },
3400 {
"node",
"html", node_html },
3401 {
"node",
"xml", node_xml },
3402 {
"node-and-op",
"default", node_and_op },
3403 {
"node-and-op",
"xml", node_and_op_xml },
3404 {
"node-capacity",
"default", node_capacity },
3405 {
"node-capacity",
"xml", node_capacity_xml },
3406 {
"node-history-list",
"default", node_history_list },
3407 {
"node-list",
"default", node_list_text },
3408 {
"node-list",
"html", node_list_html },
3409 {
"node-list",
"xml", node_list_xml },
3410 {
"node-weight",
"default", node_weight },
3411 {
"node-weight",
"xml", node_weight_xml },
3412 {
"node-attribute",
"default", node_attribute_text },
3413 {
"node-attribute",
"html", node_attribute_html },
3414 {
"node-attribute",
"xml", node_attribute_xml },
3415 {
"node-attribute-list",
"default", node_attribute_list },
3416 {
"node-summary",
"default", node_summary },
3417 {
"op-history",
"default", op_history_text },
3418 {
"op-history",
"xml", op_history_xml },
3422 {
"promotion-score",
"default", promotion_score },
3423 {
"promotion-score",
"xml", promotion_score_xml },
3424 {
"resource-config",
"default", resource_config },
3425 {
"resource-config",
"text", resource_config_text },
3426 {
"resource-history",
"default", resource_history_text },
3427 {
"resource-history",
"xml", resource_history_xml },
3428 {
"resource-list",
"default", resource_list },
3429 {
"resource-operation-list",
"default", resource_operation_list },
3430 {
"resource-util",
"default", resource_util },
3431 {
"resource-util",
"xml", resource_util_xml },
3432 {
"ticket",
"default", ticket_default },
3433 {
"ticket",
"xml", ticket_xml },
3434 {
"ticket-list",
"default", ticket_list },
3436 { 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
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
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id_rh)
#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__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.