19 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \ 20 "shutdown", "terminate", "standby", "#", NULL } 23 compare_attribute(gconstpointer a, gconstpointer b)
27 rc = strcmp((
const char *)a, (
const char *)b);
48 const char *attrname,
int *expected_score)
52 for (gIter = rsc_list; gIter != NULL; gIter = gIter->next) {
54 const char *
type = g_hash_table_lookup(rsc->
meta,
"type");
55 const char *
name = NULL;
56 GHashTable *params = NULL;
70 name = g_hash_table_lookup(params,
"name");
78 int host_list_num = 0;
79 const char *hosts = g_hash_table_lookup(params,
"host_list");
80 const char *multiplier = g_hash_table_lookup(params,
"multiplier");
84 char **host_list = g_strsplit(hosts,
" ", 0);
85 host_list_num = g_strv_length(host_list);
86 g_strfreev(host_list);
89 if ((multiplier == NULL)
98 *expected_score = host_list_num * multiplier_i;
107 filter_attr_list(GList *attr_list,
char *
name)
115 for (i = 0; filt_str[i] != NULL; i++) {
116 if (g_str_has_prefix(
name, filt_str[i])) {
121 return g_list_insert_sorted(attr_list,
name, compare_attribute);
125 get_operation_list(xmlNode *rsc_entry) {
126 GList *op_list = NULL;
127 xmlNode *rsc_op = NULL;
129 for (rsc_op = pcmk__xe_first_child(rsc_entry); rsc_op != NULL;
130 rsc_op = pcmk__xe_next(rsc_op)) {
151 op_list = g_list_append(op_list, rsc_op);
160 add_dump_node(gpointer key, gpointer value, gpointer user_data)
162 xmlNodePtr node = user_data;
167 append_dump_text(gpointer key, gpointer value, gpointer user_data)
169 char **dump_text = user_data;
171 *dump_text, (
char *)key, (
char *)value);
174 *dump_text = new_text;
180 xmlNode *stack =
get_xpath_object(
"//nvpair[@name='cluster-infrastructure']",
186 last_changed_string(
const char *last_written,
const char *user,
187 const char *client,
const char *origin) {
188 if (last_written != NULL || user != NULL || client != NULL || origin != NULL) {
190 last_written ? last_written :
"",
193 client ?
" via " :
"",
194 client ? client :
"",
195 origin ?
" on " :
"",
196 origin ? origin :
"");
203 op_history_string(xmlNode *xml_op,
const char *task,
const char *interval_ms_s,
204 int rc,
bool print_timing) {
206 char *interval_str = NULL;
209 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
216 char *last_change_str = NULL;
217 char *exec_str = NULL;
218 char *queue_str = NULL;
220 const char *value = NULL;
247 interval_str ? interval_str :
"",
248 last_change_str ? last_change_str :
"",
249 exec_str ? exec_str :
"",
250 queue_str ? queue_str :
"",
251 rc, services_ocf_exitcode_str(rc));
253 if (last_change_str) {
254 free(last_change_str);
266 interval_str ?
":" :
"",
267 interval_str ? interval_str :
"");
278 resource_history_string(
pe_resource_t *rsc,
const char *rsc_id,
bool all,
279 int failcount, time_t last_failure) {
284 }
else if (all || failcount || last_failure > 0) {
285 char *failcount_s = NULL;
286 char *lastfail_s = NULL;
292 failcount_s = strdup(
"");
294 if (last_failure > 0) {
302 lastfail_s? lastfail_s :
"");
314 const char *feature_set = NULL;
321 if (feature_set == NULL) {
322 feature_set =
"<3.15.1";
330 const char *feature_set = NULL;
331 for (GList *gIter =
data_set->
nodes; gIter != NULL; gIter = gIter->next) {
333 const char *node_feature_set = get_node_feature_set(node);
334 if (node_feature_set != NULL) {
335 if (feature_set == NULL) {
336 feature_set = node_feature_set;
337 }
else if (strcmp(feature_set, node_feature_set) != 0) {
355 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"uint32_t",
"uint32_t")
359 uint32_t section_opts = va_arg(args, uint32_t);
360 uint32_t show_opts = va_arg(args, uint32_t);
363 const char *stack_s = get_cluster_stack(
data_set);
367 out->message(out,
"cluster-stack", stack_s);
373 const char *dc_version_s = dc_version?
378 bool mixed_version = is_mixed_version(
data_set);
382 dc_version_s, dc_name, mixed_version);
393 out->message(out,
"cluster-times", last_written, user, client, origin);
398 out->message(out,
"cluster-counts", g_list_length(
data_set->
nodes),
405 out->message(out,
"cluster-options",
data_set);
419 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"uint32_t",
"uint32_t")
423 uint32_t section_opts = va_arg(args, uint32_t);
424 uint32_t show_opts = va_arg(args, uint32_t);
427 const char *stack_s = get_cluster_stack(
data_set);
431 out->message(out,
"cluster-stack", stack_s);
438 const char *dc_version_s = dc_version?
443 bool mixed_version = is_mixed_version(
data_set);
447 dc_version_s, dc_name, mixed_version);
458 out->message(out,
"cluster-times", last_written, user, client, origin);
463 out->message(out,
"cluster-counts", g_list_length(
data_set->
nodes),
475 out->begin_list(out, NULL, NULL,
"Config Options");
476 out->message(out,
"cluster-options",
data_set);
494 const char *node_host = NULL;
495 const char *node_id = NULL;
503 const pe_node_t *host_node = pe__current_node(container);
505 if (host_node && host_node->
details) {
508 if (node_host == NULL) {
521 name_len += strlen(node_host) + 1;
524 name_len += strlen(node_id) + 3;
528 node_name = malloc(name_len);
532 strcat(node_name,
"@");
533 strcat(node_name, node_host);
536 strcat(node_name,
" (");
537 strcat(node_name, node_id);
538 strcat(node_name,
")");
545 ,
size_t pairs_count, ...)
547 xmlNodePtr xml_node = NULL;
556 : xmlNewChild(xml_node, NULL, (
pcmkXmlStr) tag_name, NULL);
558 va_start(args, pairs_count);
559 while(pairs_count--) {
560 const char *param_name = va_arg(args,
const char *);
561 const char *param_value = va_arg(args,
const char *);
562 if (param_name && param_value) {
578 #ifdef PCMK__COMPAT_2_0 592 uint32_t show_opts = va_arg(args, uint32_t);
612 uint32_t show_opts = va_arg(args, uint32_t);
616 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
629 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
632 char *weight_s = pcmk__itoa(pe_node->
weight);
639 "promoted-only", promoted_only,
646 "master_only", promoted_only,
658 const char *prefix = va_arg(args,
const char *);
659 GList *only_rsc = va_arg(args, GList *);
660 uint32_t show_opts = va_arg(args, uint32_t);
661 bool print_spacer = va_arg(args,
int);
663 GList *gIter, *gIter2;
670 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
679 for (gIter2 = location->
node_list_rh; gIter2 != NULL; gIter2 = gIter2->next) {
684 out->message(out,
"ban", node, location, show_opts);
696 unsigned int nnodes = va_arg(args,
unsigned int);
697 int nresources = va_arg(args,
int);
698 int ndisabled = va_arg(args,
int);
699 int nblocked = va_arg(args,
int);
710 if (ndisabled && nblocked) {
725 " from further action due to failure)");
726 }
else if (ndisabled && !nblocked) {
735 }
else if (!ndisabled && nblocked) {
744 " from further action due to failure)");
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);
763 out->list_item(out, NULL,
"%d node%s configured",
766 if (ndisabled && nblocked) {
767 out->list_item(out, NULL,
"%d resource instance%s configured " 768 "(%d DISABLED, %d BLOCKED from " 769 "further action due to failure)",
772 }
else if (ndisabled && !nblocked) {
773 out->list_item(out, NULL,
"%d resource instance%s configured " 776 }
else if (!ndisabled && nblocked) {
777 out->list_item(out, NULL,
"%d resource instance%s configured " 778 "(%d BLOCKED from further action " 782 out->list_item(out, NULL,
"%d resource instance%s configured",
792 unsigned int nnodes = va_arg(args,
unsigned int);
793 int nresources = va_arg(args,
int);
794 int ndisabled = va_arg(args,
int);
795 int nblocked = va_arg(args,
int);
800 char *s = pcmk__itoa(nnodes);
804 s = pcmk__itoa(nresources);
808 s = pcmk__itoa(ndisabled);
812 s = pcmk__itoa(nblocked);
824 const char *quorum = va_arg(args,
const char *);
825 const char *dc_version_s = va_arg(args,
const char *);
826 char *dc_name = va_arg(args,
char *);
827 bool mixed_version = va_arg(args,
int);
835 dc_version_s ? dc_version_s :
"unknown");
862 const char *quorum = va_arg(args,
const char *);
863 const char *dc_version_s = va_arg(args,
const char *);
864 char *dc_name = va_arg(args,
char *);
865 bool mixed_version = va_arg(args,
int);
868 out->list_item(out,
"Current DC",
869 "%s (version %s) - %spartition %s quorum",
870 dc_name, dc_version_s ? dc_version_s :
"unknown",
871 mixed_version ?
"MIXED-VERSION " :
"",
874 out->list_item(out,
"Current DC",
"NONE");
885 const char *quorum = va_arg(args,
const char *);
886 const char *dc_version_s = va_arg(args,
const char *);
887 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
888 bool mixed_version = va_arg(args,
int);
893 "version", dc_version_s ? dc_version_s :
"",
897 "mixed_version", pcmk__btoa(mixed_version),
911 unsigned long long flags = va_arg(args,
unsigned long long);
931 out->list_item(out, NULL,
"STONITH of failed nodes %s",
934 out->list_item(out, NULL,
"Cluster is %s",
939 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
943 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
947 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 948 "resources and stop all other resources");
952 out->list_item(out, NULL,
"No quorum policy: Ignore");
956 out->list_item(out, NULL,
"No quorum policy: Suicide");
966 " (the cluster will not attempt to start, stop, or recover services)");
973 " (the cluster will keep all resources stopped)");
975 out->list_item(out, NULL,
"Resource management: enabled");
987 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
989 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
1000 out->list_item(out, NULL,
"STONITH of failed nodes %s",
1003 out->list_item(out, NULL,
"Cluster is %s",
1008 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
1012 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
1016 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 1017 "resources and stop all other resources");
1021 out->list_item(out, NULL,
"No quorum policy: Ignore");
1025 out->list_item(out, NULL,
"No quorum policy: Suicide");
1037 const char *no_quorum_policy = NULL;
1043 no_quorum_policy =
"freeze";
1047 no_quorum_policy =
"stop";
1051 no_quorum_policy =
"demote";
1055 no_quorum_policy =
"ignore";
1059 no_quorum_policy =
"suicide";
1066 "no-quorum-policy", no_quorum_policy,
1069 "stonith-timeout-ms", stonith_timeout_str,
1070 "priority-fencing-delay-ms", priority_fencing_delay_str,
1072 free(stonith_timeout_str);
1073 free(priority_fencing_delay_str);
1081 const char *stack_s = va_arg(args,
const char *);
1094 const char *stack_s = va_arg(args,
const char *);
1096 out->list_item(out,
"Stack",
"%s", stack_s);
1103 const char *stack_s = va_arg(args,
const char *);
1112 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1115 const char *last_written = va_arg(args,
const char *);
1116 const char *user = va_arg(args,
const char *);
1117 const char *client = va_arg(args,
const char *);
1118 const char *origin = va_arg(args,
const char *);
1123 char *buf = last_changed_string(last_written, user, client, origin);
1136 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1139 const char *last_written = va_arg(args,
const char *);
1140 const char *user = va_arg(args,
const char *);
1141 const char *client = va_arg(args,
const char *);
1142 const char *origin = va_arg(args,
const char *);
1148 "time", last_written ? last_written :
"",
1149 "user", user ? user :
"",
1150 "client", client ? client :
"",
1151 "origin", origin ? origin :
"",
1157 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1160 const char *last_written = va_arg(args,
const char *);
1161 const char *user = va_arg(args,
const char *);
1162 const char *client = va_arg(args,
const char *);
1163 const char *origin = va_arg(args,
const char *);
1165 char *buf = last_changed_string(last_written, user, client, origin);
1168 out->list_item(out,
"Last change",
" %s", buf);
1180 const char *op_key,
const char *node_name,
int rc,
1181 int status,
const char *exit_reason,
1182 const char *exec_time)
1184 char *rsc_id = NULL;
1186 guint interval_ms = 0;
1187 const char *last_change_str = NULL;
1188 time_t last_change_epoch = 0;
1189 GString *str = NULL;
1191 if (pcmk__str_empty(op_key)
1192 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1193 rsc_id = strdup(
"unknown resource");
1194 task = strdup(
"unknown action");
1197 CRM_ASSERT((rsc_id != NULL) && (task != NULL));
1199 str = g_string_sized_new(256);
1203 if (interval_ms != 0) {
1207 pcmk__g_strcat(str, crm_action_str(task, interval_ms),
" on ", node_name,
1211 pcmk__g_strcat(str,
" returned '", services_ocf_exitcode_str(rc),
"'",
1213 if (!pcmk__str_empty(exit_reason)) {
1219 pcmk_exec_status_str(status), NULL);
1220 if (!pcmk__str_empty(exit_reason)) {
1223 g_string_append_c(str,
')');
1228 &last_change_epoch) ==
pcmk_ok) {
1230 if (last_change_str != NULL) {
1234 if (!pcmk__str_empty(exec_time)) {
1235 int exec_time_ms = 0;
1238 && (exec_time_ms > 0)) {
1245 out->
list_item(out, NULL,
"%s", str->str);
1246 g_string_free(str, TRUE);
1257 const char *op_key,
const char *node_name,
int rc,
1258 int status,
const char *exit_reason,
1259 const char *exec_time)
1263 const char *exit_status = services_ocf_exitcode_str(rc);
1264 const char *lrm_status = pcmk_exec_status_str(status);
1265 const char *last_change_str = NULL;
1266 time_t last_change_epoch = 0;
1267 GString *str = NULL;
1269 if (pcmk__str_empty(op_key)) {
1270 op_key =
"unknown operation";
1272 if (pcmk__str_empty(exit_status)) {
1273 exit_status =
"unknown exit status";
1275 if (pcmk__str_empty(call_id)) {
1276 call_id =
"unknown";
1279 str = g_string_sized_new(256);
1281 g_string_append_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1282 op_key, node_name, exit_status, rc, call_id,
1285 if (!pcmk__str_empty(exit_reason)) {
1290 &last_change_epoch) ==
pcmk_ok) {
1292 if (last_change_str != NULL) {
1295 "'", last_change_str,
"'", NULL);
1298 if (!pcmk__str_empty(queue_time)) {
1301 if (!pcmk__str_empty(exec_time)) {
1305 out->
list_item(out, NULL,
"%s", str->str);
1306 g_string_free(str, TRUE);
1313 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1314 uint32_t show_opts = va_arg(args, uint32_t);
1330 if (pcmk__str_empty(op_key)) {
1331 op_key =
ID(xml_op);
1333 if (pcmk__str_empty(node_name)) {
1334 node_name =
"unknown node";
1338 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1339 exit_reason, exec_time);
1341 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1342 exit_reason, exec_time);
1350 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1351 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1360 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
1361 xmlNodePtr node = NULL;
1367 rc_s = pcmk__itoa(rc);
1369 (op_key == NULL)?
"id" :
"op_key",
1370 (op_key == NULL)?
ID(xml_op) : op_key,
1372 "exitstatus", services_ocf_exitcode_str(rc),
1373 "exitreason", pcmk__s(reason_s,
""),
1376 "status", pcmk_exec_status_str(status),
1381 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1382 guint interval_ms = 0;
1385 char *rc_change = NULL;
1388 s = pcmk__itoa(interval_ms);
1410 "GList *",
"uint32_t",
"bool")
1414 GList *only_node = va_arg(args, GList *);
1415 GList *only_rsc = va_arg(args, GList *);
1416 uint32_t show_opts = va_arg(args, uint32_t);
1417 bool print_spacer = va_arg(args,
int);
1419 xmlNode *xml_op = NULL;
1422 const char *
id = NULL;
1428 for (xml_op = pcmk__xml_first_child(
data_set->
failed); xml_op != NULL;
1429 xml_op = pcmk__xml_next(xml_op)) {
1454 out->message(out,
"failed-action", xml_op, show_opts);
1476 " (in standby due to on-fail," 1477 " with active resources)");
1480 " (in standby due to on-fail)");
1483 " (in standby, with active resources)");
1491 " (in maintenance mode)");
1497 " (health is RED)");
1498 }
else if (health == 0) {
1500 " (health is YELLOW)");
1505 const char *feature_set = get_node_feature_set(node);
1506 if (feature_set != NULL) {
1515 "GList *",
"GList *")
1519 uint32_t show_opts = va_arg(args, uint32_t);
1520 bool full = va_arg(args,
int);
1521 GList *only_node = va_arg(args, GList *);
1522 GList *only_rsc = va_arg(args, GList *);
1527 xmlNodePtr item_node;
1532 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1535 status_node(node, item_node, show_opts);
1539 out->begin_list(out, NULL, NULL,
"Resources");
1551 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1554 status_node(node, item_node, show_opts);
1561 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1562 rsc, only_node, only_rsc);
1574 status_node(node, item_node, show_opts);
1579 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1599 return "UNCLEAN (online)";
1602 return "UNCLEAN (pending)";
1605 return "UNCLEAN (offline)";
1612 return "standby (on-fail)";
1617 return "standby (with active resources)";
1622 return "OFFLINE (standby)";
1627 return "maintenance";
1629 return "OFFLINE (maintenance)";
1639 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"uint32_t",
"bool",
"GList *",
"GList *")
1643 uint32_t show_opts = va_arg(args, uint32_t);
1644 bool full = va_arg(args,
int);
1645 GList *only_node = va_arg(args, GList *);
1646 GList *only_rsc = va_arg(args, GList *);
1650 GString *str = g_string_sized_new(64);
1655 g_string_append(str,
"GuestNode");
1657 g_string_append(str,
"RemoteNode");
1659 g_string_append(str,
"Node");
1661 pcmk__g_strcat(str,
" ", node_name,
": ", node_text_status(node), NULL);
1664 g_string_append(str,
" (health is RED)");
1665 }
else if (health == 0) {
1666 g_string_append(str,
" (health is YELLOW)");
1669 const char *feature_set = get_node_feature_set(node);
1670 if (feature_set != NULL) {
1682 out->begin_list(out, NULL, NULL,
"%s", str->str);
1683 out->begin_list(out, NULL, NULL,
"Resources");
1694 GList *gIter2 = NULL;
1696 out->begin_list(out, NULL, NULL,
"%s", str->str);
1697 out->begin_list(out, NULL, NULL,
"Resources");
1703 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1704 rsc, only_node, only_rsc);
1711 out->list_item(out, NULL,
"%s", str->str);
1714 g_string_free(str, TRUE);
1718 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1725 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"uint32_t",
"bool",
"GList *",
"GList *")
1729 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1730 bool full = va_arg(args,
int);
1731 GList *only_node = va_arg(args, GList *);
1732 GList *only_rsc = va_arg(args, GList *);
1738 const char *health_s = NULL;
1739 const char *feature_set;
1755 }
else if (health == 0) {
1756 health_s =
"yellow";
1761 feature_set = get_node_feature_set(node);
1773 "feature_set", feature_set,
1777 "resources_running", length_s,
1792 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1793 rsc, only_node, only_rsc);
1809 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
1812 const char *
name = va_arg(args,
const char *);
1813 const char *value = va_arg(args,
const char *);
1814 bool add_extra = va_arg(args,
int);
1815 int expected_score = va_arg(args,
int);
1820 if (value == NULL) {
1826 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
1827 }
else if (v < expected_score) {
1828 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
1830 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1833 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1839 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
1842 const char *
name = va_arg(args,
const char *);
1843 const char *value = va_arg(args,
const char *);
1844 bool add_extra = va_arg(args,
int);
1845 int expected_score = va_arg(args,
int);
1852 if (value == NULL) {
1863 }
else if (v < expected_score) {
1864 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
1869 out->list_item(out, NULL,
"%s: %s",
name, value);
1879 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1882 gchar *node_str = NULL;
1883 char *last_change_str = NULL;
1888 time_t last_change = 0;
1896 pe_node_t *node = pe__current_node(rsc);
1905 show_opts, target_role,
false);
1918 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
1919 node_str, op_key ? op_key :
ID(xml_op),
1923 last_change_str ? last_change_str :
"",
1924 pcmk_exec_status_str(status));
1927 free(last_change_str);
1935 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1941 time_t last_change = 0;
1942 xmlNode *node = NULL;
1947 "op", op_key ? op_key :
ID(xml_op),
1951 "status", pcmk_exec_status_str(status),
1959 char *agent_tuple = NULL;
1966 "agent", agent_tuple,
1982 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"bool",
"int")
1985 const char *
name = va_arg(args,
const char *);
1986 const char *value = va_arg(args,
const char *);
1987 bool add_extra = va_arg(args,
int);
1988 int expected_score = va_arg(args,
int);
1996 char *buf = pcmk__itoa(expected_score);
2005 "bool",
"GList *",
"GList *")
2009 uint32_t show_opts = va_arg(args, uint32_t);
2010 bool print_spacer = va_arg(args,
int);
2011 GList *only_node = va_arg(args, GList *);
2012 GList *only_rsc = va_arg(args, GList *);
2017 for (GList *gIter =
data_set->
nodes; gIter != NULL; gIter = gIter->next) {
2020 GList *attr_list = NULL;
2021 GHashTableIter iter;
2029 while (g_hash_table_iter_next (&iter, &key, NULL)) {
2030 attr_list = filter_attr_list(attr_list, key);
2033 if (attr_list == NULL) {
2038 g_list_free(attr_list);
2044 out->message(out,
"node", node, show_opts,
false, only_node, only_rsc);
2046 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
2047 const char *
name = aIter->data;
2048 const char *value = NULL;
2049 int expected_score = 0;
2050 bool add_extra =
false;
2058 out->message(out,
"node-attribute",
name, value, add_extra,
2062 g_list_free(attr_list);
2075 const char *comment = va_arg(args,
const char *);
2078 comment, pe__node_name(node));
2081 out->list_item(out, NULL,
"%s", dump_text);
2092 const char *comment = va_arg(args,
const char *);
2104 "GList *",
"GList *",
"uint32_t",
"uint32_t")
2109 xmlNode *node_state = va_arg(args, xmlNode *);
2110 GList *only_node = va_arg(args, GList *);
2111 GList *only_rsc = va_arg(args, GList *);
2112 uint32_t section_opts = va_arg(args, uint32_t);
2113 uint32_t show_opts = va_arg(args, uint32_t);
2115 xmlNode *lrm_rsc = NULL;
2116 xmlNode *rsc_entry = NULL;
2148 time_t last_failure = 0;
2152 if (failcount <= 0) {
2158 out->message(out,
"node", node, show_opts,
false, only_node,
2162 out->message(out,
"resource-history", rsc, rsc_id,
false,
2163 failcount, last_failure,
false);
2165 GList *op_list = get_operation_list(rsc_entry);
2169 if (op_list == NULL) {
2175 out->message(out,
"node", node, show_opts,
false, only_node,
2179 out->message(out,
"resource-operation-list",
data_set, rsc, node,
2180 op_list, show_opts);
2188 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2191 GList *nodes = va_arg(args, GList *);
2192 GList *only_node = va_arg(args, GList *);
2193 GList *only_rsc = va_arg(args, GList *);
2194 uint32_t show_opts = va_arg(args, uint32_t);
2195 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2199 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2209 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2216 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2219 GList *nodes = va_arg(args, GList *);
2220 GList *only_node = va_arg(args, GList *);
2221 GList *only_rsc = va_arg(args, GList *);
2222 uint32_t show_opts = va_arg(args, uint32_t);
2223 bool print_spacer = va_arg(args,
int);
2226 GString *online_nodes = NULL;
2227 GString *online_remote_nodes = NULL;
2228 GString *online_guest_nodes = NULL;
2229 GString *offline_nodes = NULL;
2230 GString *offline_remote_nodes = NULL;
2234 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2258 pcmk__add_word(&online_guest_nodes, 1024, node_name);
2261 pcmk__add_word(&online_remote_nodes, 1024, node_name);
2264 pcmk__add_word(&online_nodes, 1024, node_name);
2272 pcmk__add_word(&offline_remote_nodes, 1024, node_name);
2278 pcmk__add_word(&offline_nodes, 1024, node_name);
2285 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2290 if (online_nodes != NULL) {
2291 out->list_item(out,
"Online",
"[ %s ]",
2292 (
const char *) online_nodes->str);
2293 g_string_free(online_nodes, TRUE);
2295 if (offline_nodes != NULL) {
2296 out->list_item(out,
"OFFLINE",
"[ %s ]",
2297 (
const char *) offline_nodes->str);
2298 g_string_free(offline_nodes, TRUE);
2300 if (online_remote_nodes) {
2301 out->list_item(out,
"RemoteOnline",
"[ %s ]",
2302 (
const char *) online_remote_nodes->str);
2303 g_string_free(online_remote_nodes, TRUE);
2305 if (offline_remote_nodes) {
2306 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]",
2307 (
const char *) offline_remote_nodes->str);
2308 g_string_free(offline_remote_nodes, TRUE);
2310 if (online_guest_nodes != NULL) {
2311 out->list_item(out,
"GuestOnline",
"[ %s ]",
2312 (
const char *) online_guest_nodes->str);
2313 g_string_free(online_guest_nodes, TRUE);
2320 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"bool")
2323 GList *nodes = va_arg(args, GList *);
2324 GList *only_node = va_arg(args, GList *);
2325 GList *only_rsc = va_arg(args, GList *);
2326 uint32_t show_opts = va_arg(args, uint32_t);
2327 bool print_spacer G_GNUC_UNUSED = va_arg(args,
int);
2329 out->begin_list(out, NULL, NULL,
"nodes");
2330 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2338 out->message(out,
"node", node, show_opts,
true, only_node, only_rsc);
2346 "uint32_t",
"uint32_t",
"bool")
2350 GList *only_node = va_arg(args, GList *);
2351 GList *only_rsc = va_arg(args, GList *);
2352 uint32_t section_opts = va_arg(args, uint32_t);
2353 uint32_t show_opts = va_arg(args, uint32_t);
2354 bool print_spacer = va_arg(args,
int);
2356 xmlNode *node_state = NULL;
2361 if (xmlChildElementCount(cib_status) == 0) {
2381 out->message(out,
"node-history-list",
data_set, node, node_state,
2382 only_node, only_rsc, section_opts, show_opts);
2389 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"const char *")
2394 const char *prefix = va_arg(args,
const char *);
2395 const char *
uname = va_arg(args,
const char *);
2396 const char *score = va_arg(args,
const char *);
2399 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2400 prefix, rsc->
id,
uname, score);
2402 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2408 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"const char *")
2413 const char *prefix = va_arg(args,
const char *);
2414 const char *
uname = va_arg(args,
const char *);
2415 const char *score = va_arg(args,
const char *);
2430 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2433 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2434 const char *task = va_arg(args,
const char *);
2435 const char *interval_ms_s = va_arg(args,
const char *);
2436 int rc = va_arg(args,
int);
2437 uint32_t show_opts = va_arg(args, uint32_t);
2439 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2442 out->list_item(out, NULL,
"%s", buf);
2448 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2451 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2452 const char *task = va_arg(args,
const char *);
2453 const char *interval_ms_s = va_arg(args,
const char *);
2454 int rc = va_arg(args,
int);
2455 uint32_t show_opts = va_arg(args, uint32_t);
2457 char *rc_s = pcmk__itoa(rc);
2462 "rc_text", services_ocf_exitcode_str(rc),
2466 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2473 const char *value = NULL;
2477 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2498 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2504 const char *score = va_arg(args,
const char *);
2506 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2513 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2519 const char *score = va_arg(args,
const char *);
2522 "id", child_rsc->
id,
2537 bool raw = va_arg(args,
int);
2539 char *rsc_xml = formatted_xml_buf(rsc, raw);
2541 out->output_xml(out,
"xml", rsc_xml);
2551 bool raw = va_arg(args,
int);
2553 char *rsc_xml = formatted_xml_buf(rsc, raw);
2556 out->output_xml(out,
"xml", rsc_xml);
2562 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"bool",
"int",
"time_t",
"bool")
2566 const char *rsc_id = va_arg(args,
const char *);
2567 bool all = va_arg(args,
int);
2568 int failcount = va_arg(args,
int);
2569 time_t last_failure = va_arg(args, time_t);
2570 bool as_header = va_arg(args,
int);
2572 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2575 out->begin_list(out, NULL, NULL,
"%s", buf);
2577 out->list_item(out, NULL,
"%s", buf);
2584 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"bool",
"int",
"time_t",
"bool")
2588 const char *rsc_id = va_arg(args,
const char *);
2589 bool all = va_arg(args,
int);
2590 int failcount = va_arg(args,
int);
2591 time_t last_failure = va_arg(args, time_t);
2592 bool as_header = va_arg(args,
int);
2600 }
else if (all || failcount || last_failure > 0) {
2604 "migration-threshold", migration_s,
2608 if (failcount > 0) {
2609 char *s = pcmk__itoa(failcount);
2615 if (last_failure > 0) {
2632 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2634 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2636 out->
begin_list(out, NULL, NULL,
"Active Resources");
2642 "GList *",
"GList *",
"bool")
2647 uint32_t show_opts = va_arg(args, uint32_t);
2648 bool print_summary = va_arg(args,
int);
2649 GList *only_node = va_arg(args, GList *);
2650 GList *only_rsc = va_arg(args, GList *);
2651 bool print_spacer = va_arg(args,
int);
2655 bool printed_header =
false;
2671 print_resource_header(out, show_opts);
2672 printed_header =
true;
2679 for (rsc_iter =
data_set->
resources; rsc_iter != NULL; rsc_iter = rsc_iter->next) {
2684 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
2685 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
2711 if (!printed_header) {
2713 print_resource_header(out, show_opts);
2714 printed_header =
true;
2718 x = out->message(out, crm_map_element_name(rsc->
xml), show_opts, rsc,
2719 only_node, only_rsc);
2726 if (!printed_header) {
2728 print_resource_header(out, show_opts);
2729 printed_header =
true;
2733 out->list_item(out, NULL,
"No inactive resources");
2735 out->list_item(out, NULL,
"No resources");
2737 out->list_item(out, NULL,
"No active resources");
2741 if (printed_header) {
2749 "pe_node_t *",
"GList *",
"uint32_t")
2756 GList *op_list = va_arg(args, GList *);
2757 uint32_t show_opts = va_arg(args, uint32_t);
2759 GList *gIter = NULL;
2763 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
2764 xmlNode *xml_op = (xmlNode *) gIter->data;
2781 time_t last_failure = 0;
2786 failcount, last_failure,
true);
2791 out->message(out,
"op-history", xml_op, task, interval_ms_s,
2792 op_rc_i, show_opts);
2796 g_list_free(op_list);
2802 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2808 const char *fn = va_arg(args,
const char *);
2811 fn, rsc->
id, pe__node_name(node));
2813 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
2814 out->list_item(out, NULL,
"%s", dump_text);
2820 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2826 const char *fn = va_arg(args,
const char *);
2829 "resource", rsc->
id,
2833 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
2847 out->list_item(out, NULL,
"%s:\t%s%s %s", ticket->
id,
2848 ticket->
granted ?
"granted" :
"revoked",
2849 ticket->
standby ?
" [standby]" :
"",
2853 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
2854 ticket->
granted ?
"granted" :
"revoked",
2855 ticket->
standby ?
" [standby]" :
"");
2870 out->list_item(out, ticket->
id,
"%s%s %s",
2871 ticket->
granted ?
"granted" :
"revoked",
2872 ticket->
standby ?
" [standby]" :
"",
2876 out->list_item(out, ticket->
id,
"%s%s",
2877 ticket->
granted ?
"granted" :
"revoked",
2878 ticket->
standby ?
" [standby]" :
"");
2889 xmlNodePtr node = NULL;
2893 "status", ticket->
granted ?
"granted" :
"revoked",
2894 "standby", pcmk__btoa(ticket->
standby),
2908 bool print_spacer = va_arg(args,
int);
2910 GHashTableIter iter;
2911 gpointer key, value;
2920 out->begin_list(out, NULL, NULL,
"Tickets");
2924 while (g_hash_table_iter_next(&iter, &key, &value)) {
2926 out->message(out,
"ticket", ticket);
2935 {
"ban",
"default", ban_text },
2936 {
"ban",
"html", ban_html },
2937 {
"ban",
"xml", ban_xml },
2938 {
"ban-list",
"default", ban_list },
2944 {
"cluster-counts",
"default", cluster_counts_text },
2945 {
"cluster-counts",
"html", cluster_counts_html },
2946 {
"cluster-counts",
"xml", cluster_counts_xml },
2947 {
"cluster-dc",
"default", cluster_dc_text },
2948 {
"cluster-dc",
"html", cluster_dc_html },
2949 {
"cluster-dc",
"xml", cluster_dc_xml },
2950 {
"cluster-options",
"default", cluster_options_text },
2951 {
"cluster-options",
"html", cluster_options_html },
2952 {
"cluster-options",
"log", cluster_options_log },
2953 {
"cluster-options",
"xml", cluster_options_xml },
2954 {
"cluster-summary",
"default", cluster_summary },
2955 {
"cluster-summary",
"html", cluster_summary_html },
2956 {
"cluster-stack",
"default", cluster_stack_text },
2957 {
"cluster-stack",
"html", cluster_stack_html },
2958 {
"cluster-stack",
"xml", cluster_stack_xml },
2959 {
"cluster-times",
"default", cluster_times_text },
2960 {
"cluster-times",
"html", cluster_times_html },
2961 {
"cluster-times",
"xml", cluster_times_xml },
2962 {
"failed-action",
"default", failed_action_default },
2963 {
"failed-action",
"xml", failed_action_xml },
2964 {
"failed-action-list",
"default", failed_action_list },
2967 {
"maint-mode",
"text", cluster_maint_mode_text },
2968 {
"node",
"default", node_text },
2969 {
"node",
"html", node_html },
2970 {
"node",
"xml", node_xml },
2971 {
"node-and-op",
"default", node_and_op },
2972 {
"node-and-op",
"xml", node_and_op_xml },
2973 {
"node-capacity",
"default", node_capacity },
2974 {
"node-capacity",
"xml", node_capacity_xml },
2975 {
"node-history-list",
"default", node_history_list },
2976 {
"node-list",
"default", node_list_text },
2977 {
"node-list",
"html", node_list_html },
2978 {
"node-list",
"xml", node_list_xml },
2979 {
"node-weight",
"default", node_weight },
2980 {
"node-weight",
"xml", node_weight_xml },
2981 {
"node-attribute",
"default", node_attribute_text },
2982 {
"node-attribute",
"html", node_attribute_html },
2983 {
"node-attribute",
"xml", node_attribute_xml },
2984 {
"node-attribute-list",
"default", node_attribute_list },
2985 {
"node-summary",
"default", node_summary },
2986 {
"op-history",
"default", op_history_text },
2987 {
"op-history",
"xml", op_history_xml },
2991 {
"promotion-score",
"default", promotion_score },
2992 {
"promotion-score",
"xml", promotion_score_xml },
2993 {
"resource-config",
"default", resource_config },
2994 {
"resource-config",
"text", resource_config_text },
2995 {
"resource-history",
"default", resource_history_text },
2996 {
"resource-history",
"xml", resource_history_xml },
2997 {
"resource-list",
"default", resource_list },
2998 {
"resource-operation-list",
"default", resource_operation_list },
2999 {
"resource-util",
"default", resource_util },
3000 {
"resource-util",
"xml", resource_util_xml },
3001 {
"ticket",
"default", ticket_text },
3002 {
"ticket",
"html", ticket_html },
3003 {
"ticket",
"xml", ticket_xml },
3004 {
"ticket-list",
"default", ticket_list },
3006 { NULL, NULL, NULL }
crm_time_t * crm_time_new_undefined(void)
Allocate memory for an uninitialized time object.
int pe__node_health(pe_node_t *node)
#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
enum pe_quorum_policy no_quorum_policy
PCMK__OUTPUT_ARGS("ban-list", "pe_working_set_t *", "const char *", "GList *", "uint32_t", "bool")
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
#define XML_ATTR_UPDATE_CLIENT
bool pe__is_guest_or_remote_node(const pe_node_t *node)
Control output from tools.
void pcmk__register_messages(pcmk__output_t *out, const pcmk__message_entry_t *table)
int pcmk__scan_min_int(const char *text, int *result, int minimum)
#define crm_time_log_timeofday
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
struct crm_time_s crm_time_t
#define pe_flag_symmetric_cluster
int priority_fencing_delay
xmlNode * first_named_child(const xmlNode *parent, const char *name)
#define pe_flag_maintenance_mode
xmlNode * pcmk_create_html_node(xmlNode *parent, const char *element_name, const char *id, const char *class_name, const char *text)
#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)
pe_resource_t * remote_rsc
#define CRMD_ACTION_NOTIFY
#define XML_RSC_OP_T_EXEC
resource_object_functions_t * fns
#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)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define RSC_ROLE_PROMOTED_LEGACY_S
void pcmk__xe_set_bool_attr(xmlNodePtr node, const char *name, bool value)
pe_resource_t * pe_find_resource(GList *rsc_list, const char *id_rh)
enum crm_ais_msg_types type
bool pe__rsc_running_on_any(pe_resource_t *rsc, GList *node_list)
xmlNodePtr pcmk__output_create_html_node(pcmk__output_t *out, const char *element_name, const char *id, const char *class_name, const char *text)
int pe__resource_text(pcmk__output_t *out, va_list args)
#define XML_RSC_OP_T_QUEUE
char * pcmk__format_named_time(const char *name, time_t epoch_time)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
#define PCMK__LAST_FAILURE_PREFIX
int pe__bundle_html(pcmk__output_t *out, va_list args)
void void void pcmk__formatted_printf(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
#define pe_flag_stop_everything
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 XML_LRM_ATTR_TASK_KEY
bool pe__is_remote_node(const pe_node_t *node)
#define XML_LRM_ATTR_TASK
char * crm_time_as_string(const crm_time_t *dt, int flags)
#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)
void crm_time_set_timet(crm_time_t *target, const time_t *source)
pe_resource_t * uber_parent(pe_resource_t *rsc)
Used only to initialize variables.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
const char * pe_node_attribute_raw(const pe_node_t *node, const char *name)
#define XML_CIB_TAG_STATE
bool pe__is_guest_node(const pe_node_t *node)
xmlNode * pcmk_find_cib_element(xmlNode *cib, const char *element_name)
Find an element in the CIB.
char * pe__node_display_name(pe_node_t *node, bool print_detail)
xmlNode * pcmk_create_xml_text_node(xmlNode *parent, const char *name, const char *content)
int pe__clone_xml(pcmk__output_t *out, va_list args)
void pcmk__g_strcat(GString *buffer,...) G_GNUC_NULL_TERMINATED
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#define XML_AGENT_ATTR_PROVIDER
#define XML_ATTR_HAVE_QUORUM
pe_working_set_t * data_set
bool pcmk_xe_mask_probe_failure(xmlNode *xml_op)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
Action completed, result is known.
char * dump_xml_formatted(xmlNode *msg)
xmlNodePtr pcmk__output_create_xml_node(pcmk__output_t *out, const char *name,...) G_GNUC_NULL_TERMINATED
#define pe_flag_stonith_enabled
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute.
#define PCMK__FAIL_COUNT_PREFIX
#define XML_RSC_ATTR_TARGET_ROLE
#define XML_LRM_ATTR_EXIT_REASON
#define crm_time_log_with_timezone
enum pe_obj_types variant
void pcmk__output_xml_pop_parent(pcmk__output_t *out)
#define RSC_ROLE_PROMOTED_S
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
int pe__resource_xml(pcmk__output_t *out, va_list args)
const xmlChar * pcmkXmlStr
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
#define PCMK__OUTPUT_LIST_FOOTER(out_obj, retcode)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
#define PCMK__OUTPUT_LIST_HEADER(out_obj, cond, retcode, title...)
gboolean(* is_filtered)(pe_resource_t *, GList *, gboolean)
gchar * pcmk__native_output_string(pe_resource_t *rsc, const char *name, pe_node_t *node, uint32_t show_opts, const char *target_role, bool show_nodes)
#define XML_LRM_TAG_RESOURCES
void(*) void(* list_item)(pcmk__output_t *out, const char *name, const char *format,...) G_GNUC_PRINTF(3
const char * rsc_printable_id(pe_resource_t *rsc)
#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.
GHashTable * pe_rsc_params(pe_resource_t *rsc, const pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_ATTR_CALLID
#define XML_NVPAIR_ATTR_VALUE
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
int pe__resource_html(pcmk__output_t *out, va_list args)
#define pcmk__plural_s(i)
rsc_role_e
Possible roles that a resource can be in.
GList * placement_constraints
#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.
gboolean crm_is_true(const char *s)
char * pcmk__trim(char *str)
#define XML_LRM_TAG_RSC_OP
const char * pcmk__epoch2str(const time_t *when)
char * crm_xml_escape(const char *text)
Replace special characters with their XML escape sequences.
void pe__register_messages(pcmk__output_t *out)
#define crm_time_log_date
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
gboolean(* active)(pe_resource_t *, gboolean)
#define XML_AGENT_ATTR_CLASS
gboolean pcmk__str_in_list(const gchar *s, const GList *lst, uint32_t flags)
#define CRMD_ACTION_STATUS
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.
void crm_time_free(crm_time_t *dt)