24 const char * desc = NULL;
33 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \ 34 "shutdown", PCMK_NODE_ATTR_TERMINATE, "standby", "#", \ 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) {
71 const char *
type = g_hash_table_lookup(rsc->
meta,
"type");
72 const char *
name = NULL;
73 GHashTable *params = NULL;
87 name = g_hash_table_lookup(params,
"name");
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;
146 for (rsc_op = pcmk__xe_first_child(rsc_entry); rsc_op != NULL;
147 rsc_op = pcmk__xe_next(rsc_op)) {
170 op_list = g_list_append(op_list, rsc_op);
179 add_dump_node(gpointer key, gpointer value, gpointer user_data)
181 xmlNodePtr node = user_data;
186 append_dump_text(gpointer key, gpointer value, gpointer user_data)
188 char **dump_text = user_data;
190 *dump_text, (
char *)key, (
char *)value);
193 *dump_text = new_text;
199 xmlNode *stack =
get_xpath_object(
"//nvpair[@name='cluster-infrastructure']",
205 last_changed_string(
const char *last_written,
const char *user,
206 const char *client,
const char *origin) {
207 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
209 last_written ? last_written :
"",
212 client ?
" via " :
"",
213 client ? client :
"",
214 origin ?
" on " :
"",
215 origin ? origin :
"");
222 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
223 int rc,
bool print_timing) {
225 char *interval_str = NULL;
228 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
235 char *last_change_str = NULL;
236 char *exec_str = NULL;
237 char *queue_str = NULL;
239 const char *value = NULL;
249 pcmk__s(epoch_str,
""));
268 interval_str ? interval_str :
"",
269 last_change_str ? last_change_str :
"",
270 exec_str ? exec_str :
"",
271 queue_str ? queue_str :
"",
272 rc, services_ocf_exitcode_str(rc));
274 if (last_change_str) {
275 free(last_change_str);
287 interval_str ?
":" :
"",
288 interval_str ? interval_str :
"");
299 resource_history_string(
pcmk_resource_t *rsc,
const char *rsc_id,
bool all,
300 int failcount, time_t last_failure) {
305 }
else if (all || failcount || last_failure > 0) {
306 char *failcount_s = NULL;
307 char *lastfail_s = NULL;
313 failcount_s = strdup(
"");
315 if (last_failure > 0) {
324 lastfail_s? lastfail_s :
"");
350 const char *feature_set = g_hash_table_lookup(node->
details->
attrs,
356 return pcmk__s(feature_set,
"<3.15.1");
364 const char *feature_set = NULL;
365 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
367 const char *node_feature_set = get_node_feature_set(node);
368 if (node_feature_set != NULL) {
369 if (feature_set == NULL) {
370 feature_set = node_feature_set;
371 }
else if (strcmp(feature_set, node_feature_set) != 0) {
390 "enum pcmk_pacemakerd_state",
"uint32_t",
"uint32_t")
396 uint32_t section_opts = va_arg(args, uint32_t);
397 uint32_t show_opts = va_arg(args, uint32_t);
400 const char *stack_s = get_cluster_stack(
scheduler);
404 out->message(out,
"cluster-stack", stack_s, pcmkd_state);
410 const char *dc_version_s = dc_version?
416 bool mixed_version = is_mixed_version(
scheduler);
420 dc_version_s, dc_name, mixed_version);
435 out->message(out,
"cluster-times",
441 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
448 out->message(out,
"cluster-options",
scheduler);
463 "enum pcmk_pacemakerd_state",
"uint32_t",
"uint32_t")
469 uint32_t section_opts = va_arg(args, uint32_t);
470 uint32_t show_opts = va_arg(args, uint32_t);
473 const char *stack_s = get_cluster_stack(
scheduler);
477 out->message(out,
"cluster-stack", stack_s, pcmkd_state);
485 const char *dc_version_s = dc_version?
491 bool mixed_version = is_mixed_version(
scheduler);
495 dc_version_s, dc_name, mixed_version);
510 out->message(out,
"cluster-times",
516 out->message(out,
"cluster-counts", g_list_length(
scheduler->
nodes),
528 out->begin_list(out, NULL, NULL,
"Config Options");
529 out->message(out,
"cluster-options",
scheduler);
547 const char *node_host = NULL;
548 const char *node_id = NULL;
556 const pcmk_node_t *host_node = pe__current_node(container);
558 if (host_node && host_node->
details) {
561 if (node_host == NULL) {
574 name_len += strlen(node_host) + 1;
577 name_len += strlen(node_id) + 3;
581 node_name = malloc(name_len);
585 strcat(node_name,
"@");
586 strcat(node_name, node_host);
589 strcat(node_name,
" (");
590 strcat(node_name, node_id);
591 strcat(node_name,
")");
598 ,
size_t pairs_count, ...)
600 xmlNodePtr xml_node = NULL;
609 va_start(args, pairs_count);
610 while(pairs_count--) {
611 const char *param_name = va_arg(args,
const char *);
612 const char *param_value = va_arg(args,
const char *);
613 if (param_name && param_value) {
629 #ifdef PCMK__COMPAT_2_0 643 uint32_t show_opts = va_arg(args, uint32_t);
663 uint32_t show_opts = va_arg(args, uint32_t);
667 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
680 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
683 char *weight_s = pcmk__itoa(pe_node->
weight);
690 "promoted-only", promoted_only,
697 "master_only", promoted_only,
709 const char *prefix = va_arg(args,
const char *);
710 GList *only_rsc = va_arg(args, GList *);
711 uint32_t show_opts = va_arg(args, uint32_t);
712 bool print_spacer = va_arg(args,
int);
714 GList *gIter, *gIter2;
719 gIter != NULL; gIter = gIter->next) {
723 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
734 for (gIter2 = location->
node_list_rh; gIter2 != NULL; gIter2 = gIter2->next) {
739 out->message(out,
"ban", node, location, show_opts);
751 unsigned int nnodes = va_arg(args,
unsigned int);
752 int nresources = va_arg(args,
int);
753 int ndisabled = va_arg(args,
int);
754 int nblocked = va_arg(args,
int);
765 if (ndisabled && nblocked) {
780 " from further action due to failure)");
781 }
else if (ndisabled && !nblocked) {
790 }
else if (!ndisabled && nblocked) {
799 " from further action due to failure)");
813 unsigned int nnodes = va_arg(args,
unsigned int);
814 int nresources = va_arg(args,
int);
815 int ndisabled = va_arg(args,
int);
816 int nblocked = va_arg(args,
int);
818 out->list_item(out, NULL,
"%d node%s configured",
821 if (ndisabled && nblocked) {
822 out->list_item(out, NULL,
"%d resource instance%s configured " 823 "(%d DISABLED, %d BLOCKED from " 824 "further action due to failure)",
827 }
else if (ndisabled && !nblocked) {
828 out->list_item(out, NULL,
"%d resource instance%s configured " 831 }
else if (!ndisabled && nblocked) {
832 out->list_item(out, NULL,
"%d resource instance%s configured " 833 "(%d BLOCKED from further action " 837 out->list_item(out, NULL,
"%d resource instance%s configured",
847 unsigned int nnodes = va_arg(args,
unsigned int);
848 int nresources = va_arg(args,
int);
849 int ndisabled = va_arg(args,
int);
850 int nblocked = va_arg(args,
int);
855 char *s = pcmk__itoa(nnodes);
859 s = pcmk__itoa(nresources);
863 s = pcmk__itoa(ndisabled);
867 s = pcmk__itoa(nblocked);
879 const char *quorum = va_arg(args,
const char *);
880 const char *dc_version_s = va_arg(args,
const char *);
881 char *dc_name = va_arg(args,
char *);
882 bool mixed_version = va_arg(args,
int);
890 dc_version_s ? dc_version_s :
"unknown");
917 const char *quorum = va_arg(args,
const char *);
918 const char *dc_version_s = va_arg(args,
const char *);
919 char *dc_name = va_arg(args,
char *);
920 bool mixed_version = va_arg(args,
int);
923 out->list_item(out,
"Current DC",
924 "%s (version %s) - %spartition %s quorum",
925 dc_name, dc_version_s ? dc_version_s :
"unknown",
926 mixed_version ?
"MIXED-VERSION " :
"",
929 out->list_item(out,
"Current DC",
"NONE");
940 const char *quorum = va_arg(args,
const char *);
941 const char *dc_version_s = va_arg(args,
const char *);
942 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
943 bool mixed_version = va_arg(args,
int);
948 "version", dc_version_s ? dc_version_s :
"",
952 "mixed_version", pcmk__btoa(mixed_version),
966 unsigned long long flags = va_arg(args,
unsigned long long);
987 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
989 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
993 out->list_item(out, NULL,
"Cluster is symmetric");
995 out->list_item(out, NULL,
"Cluster is asymmetric");
1000 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1004 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1008 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1009 "resources and stop all other resources");
1013 out->list_item(out, NULL,
"No quorum policy: Ignore");
1017 out->list_item(out, NULL,
"No quorum policy: Suicide");
1027 " (the cluster will not attempt to start, stop, or recover services)");
1034 " (the cluster will keep all resources stopped)");
1036 out->list_item(out, NULL,
"Resource management: enabled");
1048 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
1050 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
1062 out->list_item(out, NULL,
"STONITH of failed nodes enabled");
1064 out->list_item(out, NULL,
"STONITH of failed nodes disabled");
1068 out->list_item(out, NULL,
"Cluster is symmetric");
1070 out->list_item(out, NULL,
"Cluster is asymmetric");
1075 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1079 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1083 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1084 "resources and stop all other resources");
1088 out->list_item(out, NULL,
"No quorum policy: Ignore");
1092 out->list_item(out, NULL,
"No quorum policy: Suicide");
1099 #define bv(flag) pcmk__btoa(pcmk_is_set(scheduler->flags, (flag))) 1106 const char *no_quorum_policy = NULL;
1112 no_quorum_policy =
"freeze";
1116 no_quorum_policy =
"stop";
1120 no_quorum_policy =
"demote";
1124 no_quorum_policy =
"ignore";
1128 no_quorum_policy =
"suicide";
1135 "symmetric-cluster",
1137 "no-quorum-policy", no_quorum_policy,
1141 "stonith-timeout-ms", stonith_timeout_str,
1142 "priority-fencing-delay-ms", priority_fencing_delay_str,
1144 free(stonith_timeout_str);
1145 free(priority_fencing_delay_str);
1150 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1153 const char *stack_s = va_arg(args,
const char *);
1171 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1174 const char *stack_s = va_arg(args,
const char *);
1179 out->list_item(out,
"Stack",
"%s (%s)",
1182 out->list_item(out,
"Stack",
"%s", stack_s);
1188 PCMK__OUTPUT_ARGS(
"cluster-stack",
"const char *",
"enum pcmk_pacemakerd_state")
1191 const char *stack_s = va_arg(args,
const char *);
1195 const char *state_s = NULL;
1203 "pacemakerd-state", state_s,
1210 "const char *",
"const char *",
"const char *")
1213 const char *our_nodename = va_arg(args,
const char *);
1214 const char *last_written = va_arg(args,
const char *);
1215 const char *user = va_arg(args,
const char *);
1216 const char *client = va_arg(args,
const char *);
1217 const char *origin = va_arg(args,
const char *);
1227 if (our_nodename != NULL) {
1233 time_s = last_changed_string(last_written, user, client, origin);
1243 "const char *",
"const char *",
"const char *")
1246 const char *our_nodename = va_arg(args,
const char *);
1247 const char *last_written = va_arg(args,
const char *);
1248 const char *user = va_arg(args,
const char *);
1249 const char *client = va_arg(args,
const char *);
1250 const char *origin = va_arg(args,
const char *);
1256 "origin", our_nodename,
1260 "time", last_written ? last_written :
"",
1261 "user", user ? user :
"",
1262 "client", client ? client :
"",
1263 "origin", origin ? origin :
"",
1271 "const char *",
"const char *",
"const char *")
1274 const char *our_nodename = va_arg(args,
const char *);
1275 const char *last_written = va_arg(args,
const char *);
1276 const char *user = va_arg(args,
const char *);
1277 const char *client = va_arg(args,
const char *);
1278 const char *origin = va_arg(args,
const char *);
1282 out->list_item(out,
"Last updated",
"%s%s%s",
1283 time_s, (our_nodename != NULL)?
" on " :
"",
1284 pcmk__s(our_nodename,
""));
1287 time_s = last_changed_string(last_written, user, client, origin);
1289 out->list_item(out,
"Last change",
" %s", time_s);
1309 failed_action_friendly(
pcmk__output_t *out,
const xmlNode *xml_op,
1310 const char *op_key,
const char *node_name,
int rc,
1311 int status,
const char *exit_reason,
1312 const char *exec_time)
1314 char *rsc_id = NULL;
1316 guint interval_ms = 0;
1317 time_t last_change_epoch = 0;
1318 GString *str = NULL;
1320 if (pcmk__str_empty(op_key)
1321 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1322 rsc_id = strdup(
"unknown resource");
1323 task = strdup(
"unknown action");
1326 CRM_ASSERT((rsc_id != NULL) && (task != NULL));
1328 str = g_string_sized_new(256);
1332 if (interval_ms != 0) {
1336 pcmk__g_strcat(str, pcmk__readable_action(task, interval_ms),
" on ",
1340 pcmk__g_strcat(str,
" returned '", services_ocf_exitcode_str(rc),
"'",
1342 if (!pcmk__str_empty(exit_reason)) {
1348 pcmk_exec_status_str(status), NULL);
1349 if (!pcmk__str_empty(exit_reason)) {
1352 g_string_append_c(str,
')');
1357 &last_change_epoch) ==
pcmk_ok) {
1363 if (!pcmk__str_empty(exec_time)) {
1364 int exec_time_ms = 0;
1367 && (exec_time_ms > 0)) {
1374 out->
list_item(out, NULL,
"%s", str->str);
1375 g_string_free(str, TRUE);
1394 failed_action_technical(
pcmk__output_t *out,
const xmlNode *xml_op,
1395 const char *op_key,
const char *node_name,
int rc,
1396 int status,
const char *exit_reason,
1397 const char *exec_time)
1401 const char *exit_status = services_ocf_exitcode_str(rc);
1402 const char *lrm_status = pcmk_exec_status_str(status);
1403 time_t last_change_epoch = 0;
1404 GString *str = NULL;
1406 if (pcmk__str_empty(op_key)) {
1407 op_key =
"unknown operation";
1409 if (pcmk__str_empty(exit_status)) {
1410 exit_status =
"unknown exit status";
1412 if (pcmk__str_empty(call_id)) {
1413 call_id =
"unknown";
1416 str = g_string_sized_new(256);
1418 g_string_append_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1419 op_key, node_name, exit_status, rc, call_id,
1422 if (!pcmk__str_empty(exit_reason)) {
1427 &last_change_epoch) ==
pcmk_ok) {
1432 "'", last_change_str,
"'", NULL);
1433 free(last_change_str);
1435 if (!pcmk__str_empty(queue_time)) {
1438 if (!pcmk__str_empty(exec_time)) {
1442 out->
list_item(out, NULL,
"%s", str->str);
1443 g_string_free(str, TRUE);
1450 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1451 uint32_t show_opts = va_arg(args, uint32_t);
1453 const char *op_key = pe__xe_history_key(xml_op);
1467 if (pcmk__str_empty(node_name)) {
1468 node_name =
"unknown node";
1472 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1473 exit_reason, exec_time);
1475 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1476 exit_reason, exec_time);
1484 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1485 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1487 const char *op_key = pe__xe_history_key(xml_op);
1488 const char *op_key_name =
"op_key";
1495 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
1496 xmlNodePtr node = NULL;
1502 rc_s = pcmk__itoa(rc);
1507 op_key_name, op_key,
1509 "exitstatus", services_ocf_exitcode_str(rc),
1510 "exitreason", pcmk__s(reason_s,
""),
1513 "status", pcmk_exec_status_str(status),
1518 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1519 guint interval_ms = 0;
1520 char *interval_ms_s = NULL;
1532 "interval", interval_ms_s,
1536 free(interval_ms_s);
1545 "GList *",
"uint32_t",
"bool")
1549 GList *only_node = va_arg(args, GList *);
1550 GList *only_rsc = va_arg(args, GList *);
1551 uint32_t show_opts = va_arg(args, uint32_t);
1552 bool print_spacer = va_arg(args,
int);
1554 xmlNode *xml_op = NULL;
1561 for (xml_op = pcmk__xml_first_child(
scheduler->
failed); xml_op != NULL;
1562 xml_op = pcmk__xml_next(xml_op)) {
1574 if (!
parse_op_key(pe__xe_history_key(xml_op), &rsc, NULL, NULL)) {
1586 out->message(out,
"failed-action", xml_op, show_opts);
1608 " (in standby due to on-fail," 1609 " with active resources)");
1612 " (in standby due to on-fail)");
1615 " (in standby, with active resources)");
1623 " (in maintenance mode)");
1629 " (health is RED)");
1630 }
else if (health == 0) {
1632 " (health is YELLOW)");
1637 const char *feature_set = get_node_feature_set(node);
1638 if (feature_set != NULL) {
1647 "GList *",
"GList *")
1651 uint32_t show_opts = va_arg(args, uint32_t);
1652 bool full = va_arg(args,
int);
1653 GList *only_node = va_arg(args, GList *);
1654 GList *only_rsc = va_arg(args, GList *);
1659 xmlNodePtr item_node;
1664 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1667 status_node(node, item_node, show_opts);
1671 out->begin_list(out, NULL, NULL,
"Resources");
1683 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1686 status_node(node, item_node, show_opts);
1693 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1694 rsc, only_node, only_rsc);
1706 status_node(node, item_node, show_opts);
1711 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1731 return "UNCLEAN (online)";
1734 return "UNCLEAN (pending)";
1737 return "UNCLEAN (offline)";
1744 return "standby (on-fail)";
1749 return "standby (with active resources)";
1754 return "OFFLINE (standby)";
1759 return "maintenance";
1761 return "OFFLINE (maintenance)";
1776 uint32_t show_opts = va_arg(args, uint32_t);
1777 bool full = va_arg(args,
int);
1778 GList *only_node = va_arg(args, GList *);
1779 GList *only_rsc = va_arg(args, GList *);
1783 GString *str = g_string_sized_new(64);
1788 g_string_append(str,
"GuestNode");
1790 g_string_append(str,
"RemoteNode");
1792 g_string_append(str,
"Node");
1794 pcmk__g_strcat(str,
" ", node_name,
": ", node_text_status(node), NULL);
1797 g_string_append(str,
" (health is RED)");
1798 }
else if (health == 0) {
1799 g_string_append(str,
" (health is YELLOW)");
1802 const char *feature_set = get_node_feature_set(node);
1803 if (feature_set != NULL) {
1815 out->begin_list(out, NULL, NULL,
"%s", str->str);
1816 out->begin_list(out, NULL, NULL,
"Resources");
1827 GList *gIter2 = NULL;
1829 out->begin_list(out, NULL, NULL,
"%s", str->str);
1830 out->begin_list(out, NULL, NULL,
"Resources");
1836 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1837 rsc, only_node, only_rsc);
1844 out->list_item(out, NULL,
"%s", str->str);
1847 g_string_free(str, TRUE);
1851 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1863 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1864 bool full = va_arg(args,
int);
1865 GList *only_node = va_arg(args, GList *);
1866 GList *only_rsc = va_arg(args, GList *);
1872 const char *health_s = NULL;
1873 const char *feature_set;
1889 }
else if (health == 0) {
1890 health_s =
"yellow";
1895 feature_set = get_node_feature_set(node);
1907 "feature_set", feature_set,
1911 "resources_running", length_s,
1926 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1927 rsc, only_node, only_rsc);
1943 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
1946 const char *
name = va_arg(args,
const char *);
1947 const char *value = va_arg(args,
const char *);
1948 bool add_extra = va_arg(args,
int);
1949 int expected_score = va_arg(args,
int);
1954 if (value == NULL) {
1960 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
1961 }
else if (v < expected_score) {
1962 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
1964 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1967 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1973 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
1976 const char *
name = va_arg(args,
const char *);
1977 const char *value = va_arg(args,
const char *);
1978 bool add_extra = va_arg(args,
int);
1979 int expected_score = va_arg(args,
int);
1986 if (value == NULL) {
1997 }
else if (v < expected_score) {
1998 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
2003 out->list_item(out, NULL,
"%s: %s",
name, value);
2013 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2016 gchar *node_str = NULL;
2017 char *last_change_str = NULL;
2021 time_t last_change = 0;
2038 show_opts, target_role,
false);
2051 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
2052 node_str, pe__xe_history_key(xml_op),
2056 last_change_str ? last_change_str :
"",
2057 pcmk_exec_status_str(status));
2060 free(last_change_str);
2068 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2073 time_t last_change = 0;
2074 xmlNode *node = NULL;
2079 "op", pe__xe_history_key(xml_op),
2083 "status", pcmk_exec_status_str(status),
2091 char *agent_tuple = NULL;
2098 "agent", agent_tuple,
2114 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
2117 const char *
name = va_arg(args,
const char *);
2118 const char *value = va_arg(args,
const char *);
2119 bool add_extra = va_arg(args,
int);
2120 int expected_score = va_arg(args,
int);
2128 char *buf = pcmk__itoa(expected_score);
2137 "bool",
"GList *",
"GList *")
2141 uint32_t show_opts = va_arg(args, uint32_t);
2142 bool print_spacer = va_arg(args,
int);
2143 GList *only_node = va_arg(args, GList *);
2144 GList *only_rsc = va_arg(args, GList *);
2149 for (GList *gIter =
scheduler->
nodes; gIter != NULL; gIter = gIter->next) {
2152 GList *attr_list = NULL;
2153 GHashTableIter iter;
2161 while (g_hash_table_iter_next (&iter, &key, NULL)) {
2162 attr_list = filter_attr_list(attr_list, key);
2165 if (attr_list == NULL) {
2170 g_list_free(attr_list);
2176 out->message(out,
"node", node, show_opts,
false, only_node, only_rsc);
2178 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
2179 const char *
name = aIter->data;
2180 const char *value = NULL;
2181 int expected_score = 0;
2182 bool add_extra =
false;
2190 out->message(out,
"node-attribute",
name, value, add_extra,
2194 g_list_free(attr_list);
2207 const char *comment = va_arg(args,
const char *);
2210 comment, pe__node_name(node));
2213 out->list_item(out, NULL,
"%s", dump_text);
2224 const char *comment = va_arg(args,
const char *);
2236 "xmlNodePtr",
"GList *",
"GList *",
"uint32_t",
"uint32_t")
2241 xmlNode *node_state = va_arg(args, xmlNode *);
2242 GList *only_node = va_arg(args, GList *);
2243 GList *only_rsc = va_arg(args, GList *);
2244 uint32_t section_opts = va_arg(args, uint32_t);
2245 uint32_t show_opts = va_arg(args, uint32_t);
2247 xmlNode *lrm_rsc = NULL;
2248 xmlNode *rsc_entry = NULL;
2283 time_t last_failure = 0;
2287 if (failcount <= 0) {
2293 out->message(out,
"node", node, show_opts,
false, only_node,
2297 out->message(out,
"resource-history", rsc, rsc_id,
false,
2298 failcount, last_failure,
false);
2300 GList *op_list = get_operation_list(rsc_entry);
2304 if (op_list == NULL) {
2310 out->message(out,
"node", node, show_opts,
false, only_node,
2314 out->message(out,
"resource-operation-list",
scheduler, rsc, node,
2315 op_list, show_opts);
2323 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2326 GList *nodes = va_arg(args, GList *);
2327 GList *only_node = va_arg(args, GList *);
2328 GList *only_rsc = va_arg(args, GList *);
2329 uint32_t show_opts = va_arg(args, uint32_t);
2330 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2334 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2344 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2351 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2354 GList *nodes = va_arg(args, GList *);
2355 GList *only_node = va_arg(args, GList *);
2356 GList *only_rsc = va_arg(args, GList *);
2357 uint32_t show_opts = va_arg(args, uint32_t);
2358 bool print_spacer = va_arg(args,
int);
2361 GString *online_nodes = NULL;
2362 GString *online_remote_nodes = NULL;
2363 GString *online_guest_nodes = NULL;
2364 GString *offline_nodes = NULL;
2365 GString *offline_remote_nodes = NULL;
2369 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2393 pcmk__add_word(&online_guest_nodes, 1024, node_name);
2396 pcmk__add_word(&online_remote_nodes, 1024, node_name);
2399 pcmk__add_word(&online_nodes, 1024, node_name);
2407 pcmk__add_word(&offline_remote_nodes, 1024, node_name);
2413 pcmk__add_word(&offline_nodes, 1024, node_name);
2420 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2425 if (online_nodes != NULL) {
2426 out->list_item(out,
"Online",
"[ %s ]",
2427 (
const char *) online_nodes->str);
2428 g_string_free(online_nodes, TRUE);
2430 if (offline_nodes != NULL) {
2431 out->list_item(out,
"OFFLINE",
"[ %s ]",
2432 (
const char *) offline_nodes->str);
2433 g_string_free(offline_nodes, TRUE);
2435 if (online_remote_nodes) {
2436 out->list_item(out,
"RemoteOnline",
"[ %s ]",
2437 (
const char *) online_remote_nodes->str);
2438 g_string_free(online_remote_nodes, TRUE);
2440 if (offline_remote_nodes) {
2441 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]",
2442 (
const char *) offline_remote_nodes->str);
2443 g_string_free(offline_remote_nodes, TRUE);
2445 if (online_guest_nodes != NULL) {
2446 out->list_item(out,
"GuestOnline",
"[ %s ]",
2447 (
const char *) online_guest_nodes->str);
2448 g_string_free(online_guest_nodes, TRUE);
2455 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2458 GList *nodes = va_arg(args, GList *);
2459 GList *only_node = va_arg(args, GList *);
2460 GList *only_rsc = va_arg(args, GList *);
2461 uint32_t show_opts = va_arg(args, uint32_t);
2462 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2464 out->begin_list(out, NULL, NULL,
"nodes");
2465 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2473 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2481 "uint32_t",
"uint32_t",
"bool")
2485 GList *only_node = va_arg(args, GList *);
2486 GList *only_rsc = va_arg(args, GList *);
2487 uint32_t section_opts = va_arg(args, uint32_t);
2488 uint32_t show_opts = va_arg(args, uint32_t);
2489 bool print_spacer = va_arg(args,
int);
2491 xmlNode *node_state = NULL;
2496 if (xmlChildElementCount(cib_status) == 0) {
2516 out->message(out,
"node-history-list",
scheduler, node, node_state,
2517 only_node, only_rsc, section_opts, show_opts);
2525 "const char *",
"const char *")
2530 const char *prefix = va_arg(args,
const char *);
2531 const char *
uname = va_arg(args,
const char *);
2532 const char *score = va_arg(args,
const char *);
2535 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2536 prefix, rsc->
id,
uname, score);
2538 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2545 "const char *",
"const char *")
2550 const char *prefix = va_arg(args,
const char *);
2551 const char *
uname = va_arg(args,
const char *);
2552 const char *score = va_arg(args,
const char *);
2567 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2570 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2571 const char *task = va_arg(args,
const char *);
2572 const char *interval_ms_s = va_arg(args,
const char *);
2573 int rc = va_arg(args,
int);
2574 uint32_t show_opts = va_arg(args, uint32_t);
2576 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2579 out->list_item(out, NULL,
"%s", buf);
2585 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2588 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2589 const char *task = va_arg(args,
const char *);
2590 const char *interval_ms_s = va_arg(args,
const char *);
2591 int rc = va_arg(args,
int);
2592 uint32_t show_opts = va_arg(args, uint32_t);
2594 char *rc_s = pcmk__itoa(rc);
2599 "rc_text", services_ocf_exitcode_str(rc),
2603 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2610 const char *value = NULL;
2614 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2644 const char *score = va_arg(args,
const char *);
2646 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2660 const char *score = va_arg(args,
const char *);
2663 "id", child_rsc->
id,
2678 bool raw = va_arg(args,
int);
2680 char *rsc_xml = formatted_xml_buf(rsc, raw);
2682 out->output_xml(out,
"xml", rsc_xml);
2692 bool raw = va_arg(args,
int);
2694 char *rsc_xml = formatted_xml_buf(rsc, raw);
2697 out->output_xml(out,
"xml", rsc_xml);
2704 "bool",
"int",
"time_t",
"bool")
2708 const char *rsc_id = va_arg(args,
const char *);
2709 bool all = va_arg(args,
int);
2710 int failcount = va_arg(args,
int);
2711 time_t last_failure = va_arg(args, time_t);
2712 bool as_header = va_arg(args,
int);
2714 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2717 out->begin_list(out, NULL, NULL,
"%s", buf);
2719 out->list_item(out, NULL,
"%s", buf);
2727 "bool",
"int",
"time_t",
"bool")
2731 const char *rsc_id = va_arg(args,
const char *);
2732 bool all = va_arg(args,
int);
2733 int failcount = va_arg(args,
int);
2734 time_t last_failure = va_arg(args, time_t);
2735 bool as_header = va_arg(args,
int);
2743 }
else if (all || failcount || last_failure > 0) {
2747 "migration-threshold", migration_s,
2751 if (failcount > 0) {
2752 char *s = pcmk__itoa(failcount);
2758 if (last_failure > 0) {
2778 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2780 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2782 out->
begin_list(out, NULL, NULL,
"Active Resources");
2788 "GList *",
"GList *",
"bool")
2793 uint32_t show_opts = va_arg(args, uint32_t);
2794 bool print_summary = va_arg(args,
int);
2795 GList *only_node = va_arg(args, GList *);
2796 GList *only_rsc = va_arg(args, GList *);
2797 bool print_spacer = va_arg(args,
int);
2801 bool printed_header =
false;
2818 print_resource_header(out, show_opts);
2819 printed_header =
true;
2831 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
2832 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
2859 if (!printed_header) {
2861 print_resource_header(out, show_opts);
2862 printed_header =
true;
2866 x = out->message(out, crm_map_element_name(rsc->
xml), show_opts, rsc,
2867 only_node, only_rsc);
2874 if (!printed_header) {
2876 print_resource_header(out, show_opts);
2877 printed_header =
true;
2881 out->list_item(out, NULL,
"No inactive resources");
2883 out->list_item(out, NULL,
"No resources");
2885 out->list_item(out, NULL,
"No active resources");
2889 if (printed_header) {
2897 "pcmk_resource_t *",
"pcmk_node_t *",
"GList *",
"uint32_t")
2905 GList *op_list = va_arg(args, GList *);
2906 uint32_t show_opts = va_arg(args, uint32_t);
2908 GList *gIter = NULL;
2912 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
2913 xmlNode *xml_op = (xmlNode *) gIter->data;
2930 time_t last_failure = 0;
2935 failcount, last_failure,
true);
2940 out->message(out,
"op-history", xml_op, task, interval_ms_s,
2941 op_rc_i, show_opts);
2945 g_list_free(op_list);
2958 const char *fn = va_arg(args,
const char *);
2961 fn, rsc->
id, pe__node_name(node));
2963 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
2964 out->list_item(out, NULL,
"%s", dump_text);
2977 const char *fn = va_arg(args,
const char *);
2980 "resource", rsc->
id,
2984 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
2997 out->list_item(out, NULL,
"%s:\t%s%s %s=\"%s\"", ticket->
id,
2998 ticket->
granted ?
"granted" :
"revoked",
2999 ticket->
standby ?
" [standby]" :
"",
3000 "last-granted", pcmk__s(epoch_str,
""));
3003 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
3004 ticket->
granted ?
"granted" :
"revoked",
3005 ticket->
standby ?
" [standby]" :
"");
3019 out->list_item(out, ticket->
id,
"%s%s %s=\"%s\"",
3020 ticket->
granted ?
"granted" :
"revoked",
3021 ticket->
standby ?
" [standby]" :
"",
3022 "last-granted", pcmk__s(epoch_str,
""));
3025 out->list_item(out, ticket->
id,
"%s%s",
3026 ticket->
granted ?
"granted" :
"revoked",
3027 ticket->
standby ?
" [standby]" :
"");
3038 xmlNodePtr node = NULL;
3042 "status", ticket->
granted ?
"granted" :
"revoked",
3043 "standby", pcmk__btoa(ticket->
standby),
3060 bool print_spacer = va_arg(args,
int);
3062 GHashTableIter iter;
3063 gpointer key, value;
3072 out->begin_list(out, NULL, NULL,
"Tickets");
3076 while (g_hash_table_iter_next(&iter, &key, &value)) {
3078 out->message(out,
"ticket", ticket);
3087 {
"ban",
"default", ban_text },
3088 {
"ban",
"html", ban_html },
3089 {
"ban",
"xml", ban_xml },
3090 {
"ban-list",
"default", ban_list },
3096 {
"cluster-counts",
"default", cluster_counts_text },
3097 {
"cluster-counts",
"html", cluster_counts_html },
3098 {
"cluster-counts",
"xml", cluster_counts_xml },
3099 {
"cluster-dc",
"default", cluster_dc_text },
3100 {
"cluster-dc",
"html", cluster_dc_html },
3101 {
"cluster-dc",
"xml", cluster_dc_xml },
3102 {
"cluster-options",
"default", cluster_options_text },
3103 {
"cluster-options",
"html", cluster_options_html },
3104 {
"cluster-options",
"log", cluster_options_log },
3105 {
"cluster-options",
"xml", cluster_options_xml },
3106 {
"cluster-summary",
"default", cluster_summary },
3107 {
"cluster-summary",
"html", cluster_summary_html },
3108 {
"cluster-stack",
"default", cluster_stack_text },
3109 {
"cluster-stack",
"html", cluster_stack_html },
3110 {
"cluster-stack",
"xml", cluster_stack_xml },
3111 {
"cluster-times",
"default", cluster_times_text },
3112 {
"cluster-times",
"html", cluster_times_html },
3113 {
"cluster-times",
"xml", cluster_times_xml },
3114 {
"failed-action",
"default", failed_action_default },
3115 {
"failed-action",
"xml", failed_action_xml },
3116 {
"failed-action-list",
"default", failed_action_list },
3119 {
"maint-mode",
"text", cluster_maint_mode_text },
3120 {
"node",
"default", node_text },
3121 {
"node",
"html", node_html },
3122 {
"node",
"xml", node_xml },
3123 {
"node-and-op",
"default", node_and_op },
3124 {
"node-and-op",
"xml", node_and_op_xml },
3125 {
"node-capacity",
"default", node_capacity },
3126 {
"node-capacity",
"xml", node_capacity_xml },
3127 {
"node-history-list",
"default", node_history_list },
3128 {
"node-list",
"default", node_list_text },
3129 {
"node-list",
"html", node_list_html },
3130 {
"node-list",
"xml", node_list_xml },
3131 {
"node-weight",
"default", node_weight },
3132 {
"node-weight",
"xml", node_weight_xml },
3133 {
"node-attribute",
"default", node_attribute_text },
3134 {
"node-attribute",
"html", node_attribute_html },
3135 {
"node-attribute",
"xml", node_attribute_xml },
3136 {
"node-attribute-list",
"default", node_attribute_list },
3137 {
"node-summary",
"default", node_summary },
3138 {
"op-history",
"default", op_history_text },
3139 {
"op-history",
"xml", op_history_xml },
3143 {
"promotion-score",
"default", promotion_score },
3144 {
"promotion-score",
"xml", promotion_score_xml },
3145 {
"resource-config",
"default", resource_config },
3146 {
"resource-config",
"text", resource_config_text },
3147 {
"resource-history",
"default", resource_history_text },
3148 {
"resource-history",
"xml", resource_history_xml },
3149 {
"resource-list",
"default", resource_list },
3150 {
"resource-operation-list",
"default", resource_operation_list },
3151 {
"resource-util",
"default", resource_util },
3152 {
"resource-util",
"xml", resource_util_xml },
3153 {
"ticket",
"default", ticket_text },
3154 {
"ticket",
"html", ticket_html },
3155 {
"ticket",
"xml", ticket_xml },
3156 {
"ticket-list",
"default", ticket_list },
3158 { NULL, NULL, NULL }
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
#define CRM_CHECK(expr, failure_action)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr parent)
#define XML_RSC_OP_LAST_CHANGE
#define XML_ATTR_UPDATE_ORIG
enum rsc_role_e role_filter
xmlNode * orig_xml
Original resource configuration, if using template.
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
#define XML_ATTR_UPDATE_CLIENT
xmlNode * failed
History entries of failed actions.
GHashTable * attrs
Node attributes.
node_type
Possible node types.
Control output from tools.
void pcmk__register_messages(pcmk__output_t *out, const pcmk__message_entry_t *table)
const char * pe_node_attribute_raw(const pcmk_node_t *node, const char *name)
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
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
Whether cluster is symmetric (via symmetric-cluster property)
PCMK__OUTPUT_ARGS("cluster-summary", "pcmk_scheduler_t *", "enum pcmk_pacemakerd_state", "uint32_t", "uint32_t")
GList * children
Resource's child resources, if any.
gboolean standby
Whether ticket is temporarily suspended.
int priority_fencing_delay
Priority fencing delay.
xmlNode * first_named_child(const xmlNode *parent, const char *name)
xmlNode * xml
Resource configuration (possibly expanded from template)
xmlNode * pcmk_create_html_node(xmlNode *parent, const char *element_name, const char *id, const char *class_name, const char *text)
#define XML_ATTR_UPDATE_USER
int pe__group_default(pcmk__output_t *out, va_list args)
xmlNode * find_xml_node(const xmlNode *root, const char *search_path, gboolean must_find)
#define PCMK_ACTION_MONITOR
GHashTable * meta
Resource's meta-attributes.
#define XML_RSC_OP_T_EXEC
#define XML_LRM_TAG_RESOURCE
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name, size_t pairs_count,...)
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.
int pe__clone_default(pcmk__output_t *out, va_list args)
xmlNodePtr pcmk__output_xml_peek_parent(pcmk__output_t *out)
gboolean pending
Whether controller membership is pending.
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
void pcmk__xe_set_bool_attr(xmlNodePtr node, const char *name, bool value)
enum crm_ais_msg_types type
const char * rsc_printable_id(const pcmk_resource_t *rsc)
int migration_threshold
Migration threshold.
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
Resource containing this one, if any.
int pe__resource_text(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_T_QUEUE
Implementation of pcmk_scheduler_t.
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
#define PCMK__LAST_FAILURE_PREFIX
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)
int ninstances
Total number of resource instances.
void void void pcmk__formatted_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
GList * resources
Resources in cluster.
#define PCMK__ROLE_PROMOTED
int stonith_timeout
Value of stonith-timeout property.
GList * nodes
Nodes in cluster.
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)
gboolean is_dc
Whether node is cluster's DC.
#define XML_LRM_ATTR_TASK_KEY
#define PCMK__ROLE_PROMOTED_LEGACY
#define XML_LRM_ATTR_TASK
int weight
Node score for a given resource.
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)
Implementation of pcmk_resource_t.
int pe__bundle_text(pcmk__output_t *out, va_list args)
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.
#define XML_CIB_TAG_STATE
xmlNode * pcmk_find_cib_element(xmlNode *cib, const char *element_name)
Find an element in the CIB.
xmlNode * pcmk_create_xml_text_node(xmlNode *parent, const char *name, const char *content)
bool pcmk_xe_mask_probe_failure(const xmlNode *xml_op)
int pe__clone_xml(pcmk__output_t *out, va_list args)
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
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.
int blocked_resources
Number of blocked resources in cluster.
struct pe_node_shared_s * details
Basic node information.
#define XML_AGENT_ATTR_PROVIDER
#define XML_ATTR_HAVE_QUORUM
unsigned long long flags
Group of enum pcmk_rsc_flags.
const char * uname
Node name in cluster.
const char * pe__resource_description(const pcmk_resource_t *rsc, uint32_t show_opts)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
Action completed, result is known.
Ticket constraint object.
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 PCMK__FAIL_COUNT_PREFIX
time_t last_granted
When cluster was last granted the ticket.
GHashTable * utilization
Resource's utilization attributes.
#define XML_RSC_ATTR_TARGET_ROLE
gboolean standby
Whether in standby mode.
#define XML_LRM_ATTR_EXIT_REASON
gboolean expected_up
Whether expected join state is member.
#define crm_time_log_with_timezone
Implementation of pcmk_node_t.
enum pe_obj_types variant
Resource variant.
gboolean granted
Whether cluster has been granted the ticket.
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
const char * id
Node ID at the cluster layer.
char * id
XML ID of ticket constraint or state.
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
int pe__resource_xml(pcmk__output_t *out, va_list args)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
GList * running_rsc
List of resources active on node.
bool pe__is_guest_node(const pcmk_node_t *node)
gboolean(* active)(pcmk_resource_t *rsc, gboolean all)
Check whether a resource is active.
int pe__bundle_xml(pcmk__output_t *out, va_list args)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
pcmk_rsc_methods_t * fns
Resource object methods.
Whether to stop all resources (via stop-all-resources property)
Whether fencing is enabled (via stonith-enabled property)
#define XML_LRM_TAG_RESOURCES
pcmk_scheduler_t * scheduler
const char * pcmk_pacemakerd_api_daemon_state_enum2text(enum pcmk_pacemakerd_state state)
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
int disabled_resources
Number of disabled resources in cluster.
char * pcmk__epoch2str(const time_t *source, uint32_t flags)
#define XML_CIB_ATTR_WRITTEN
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)
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_ATTR_CALLID
#define XML_NVPAIR_ATTR_VALUE
GHashTable * utilization
Node utilization attributes.
gboolean shutdown
Whether shutting down.
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
#define XML_LRM_ATTR_OPSTATUS
bool pe__is_remote_node(const pcmk_node_t *node)
int pe__resource_html(pcmk__output_t *out, va_list args)
const char * pcmk__pcmkd_state_enum2friendly(enum pcmk_pacemakerd_state state)
#define pcmk__plural_s(i)
gboolean(* is_filtered)(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Check whether a given resource is in a list of resources.
gboolean maintenance
Whether in maintenance mode.
GList * placement_constraints
Location constraints.
char * dump_xml_formatted(const xmlNode *xml)
#define XML_CIB_TAG_STATUS
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
Node on which pending_task is happening.
gboolean crm_is_true(const char *s)
char * pcmk__trim(char *str)
#define XML_LRM_TAG_RSC_OP
GHashTable * pe_rsc_params(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Get a table of resource parameters.
unsigned long long flags
Group of enum pcmk_scheduler_flags.
char * crm_xml_escape(const char *text)
Replace special characters with their XML escape sequences.
gboolean standby_onfail
Whether in standby mode due to on-fail.
gboolean unclean
Whether node requires fencing.
Whether cluster is in maintenance mode (via maintenance-mode property)
void pe__register_messages(pcmk__output_t *out)
Whether resource has been removed from the configuration.
enum node_type type
Node variant.
#define crm_time_log_date
pcmk_node_t * dc_node
Node object for DC.
gboolean online
Whether online.
pcmk_resource_t * remote_rsc
Remote connection resource for node, if it is a Pacemaker Remote node.
#define PCMK_ACTION_NOTIFY
#define XML_AGENT_ATTR_CLASS
char * id
Resource ID in configuration.
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.