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, gboolean 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, gboolean 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 :
"");
312 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"uint32_t",
"uint32_t")
316 uint32_t section_opts = va_arg(args, uint32_t);
317 uint32_t show_opts = va_arg(args, uint32_t);
320 const char *stack_s = get_cluster_stack(
data_set);
324 out->message(out,
"cluster-stack", stack_s);
330 const char *dc_version_s = dc_version?
337 out->message(out,
"cluster-dc",
data_set->
dc_node, quorum, dc_version_s, dc_name);
348 out->message(out,
"cluster-times", last_written, user, client, origin);
353 out->message(out,
"cluster-counts", g_list_length(
data_set->
nodes),
360 out->message(out,
"cluster-options",
data_set);
374 PCMK__OUTPUT_ARGS(
"cluster-summary",
"pe_working_set_t *",
"uint32_t",
"uint32_t")
378 uint32_t section_opts = va_arg(args, uint32_t);
379 uint32_t show_opts = va_arg(args, uint32_t);
382 const char *stack_s = get_cluster_stack(
data_set);
386 out->message(out,
"cluster-stack", stack_s);
393 const char *dc_version_s = dc_version?
400 out->message(out,
"cluster-dc",
data_set->
dc_node, quorum, dc_version_s, dc_name);
411 out->message(out,
"cluster-times", last_written, user, client, origin);
416 out->message(out,
"cluster-counts", g_list_length(
data_set->
nodes),
428 out->begin_list(out, NULL, NULL,
"Config Options");
429 out->message(out,
"cluster-options",
data_set);
447 const char *node_host = NULL;
448 const char *node_id = NULL;
457 if (host_node && host_node->
details) {
460 if (node_host == NULL) {
473 name_len += strlen(node_host) + 1;
476 name_len += strlen(node_id) + 3;
480 node_name = malloc(name_len);
484 strcat(node_name,
"@");
485 strcat(node_name, node_host);
488 strcat(node_name,
" (");
489 strcat(node_name, node_id);
490 strcat(node_name,
")");
497 ,
size_t pairs_count, ...)
499 xmlNodePtr xml_node = NULL;
508 : xmlNewChild(xml_node, NULL, (
pcmkXmlStr) tag_name, NULL);
510 va_start(args, pairs_count);
511 while(pairs_count--) {
512 const char *param_name = va_arg(args,
const char *);
513 const char *param_value = va_arg(args,
const char *);
514 if (param_name && param_value) {
530 #ifdef PCMK__COMPAT_2_0 544 uint32_t show_opts = va_arg(args, uint32_t);
564 uint32_t show_opts = va_arg(args, uint32_t);
568 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
581 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
584 char *weight_s = pcmk__itoa(pe_node->
weight);
591 "promoted-only", promoted_only,
598 "master_only", promoted_only,
606 "uint32_t",
"gboolean")
610 const char *prefix = va_arg(args,
const char *);
611 GList *only_rsc = va_arg(args, GList *);
612 uint32_t show_opts = va_arg(args, uint32_t);
613 gboolean print_spacer = va_arg(args, gboolean);
615 GList *gIter, *gIter2;
622 if (prefix != NULL && !g_str_has_prefix(location->
id, prefix)) {
631 for (gIter2 = location->
node_list_rh; gIter2 != NULL; gIter2 = gIter2->next) {
636 out->message(out,
"ban", node, location, show_opts);
648 unsigned int nnodes = va_arg(args,
unsigned int);
649 int nresources = va_arg(args,
int);
650 int ndisabled = va_arg(args,
int);
651 int nblocked = va_arg(args,
int);
662 if (ndisabled && nblocked) {
677 " from further action due to failure)");
678 }
else if (ndisabled && !nblocked) {
687 }
else if (!ndisabled && nblocked) {
696 " from further action due to failure)");
710 unsigned int nnodes = va_arg(args,
unsigned int);
711 int nresources = va_arg(args,
int);
712 int ndisabled = va_arg(args,
int);
713 int nblocked = va_arg(args,
int);
715 out->list_item(out, NULL,
"%d node%s configured",
718 if (ndisabled && nblocked) {
719 out->list_item(out, NULL,
"%d resource instance%s configured " 720 "(%d DISABLED, %d BLOCKED from " 721 "further action due to failure)",
724 }
else if (ndisabled && !nblocked) {
725 out->list_item(out, NULL,
"%d resource instance%s configured " 728 }
else if (!ndisabled && nblocked) {
729 out->list_item(out, NULL,
"%d resource instance%s configured " 730 "(%d BLOCKED from further action " 734 out->list_item(out, NULL,
"%d resource instance%s configured",
744 unsigned int nnodes = va_arg(args,
unsigned int);
745 int nresources = va_arg(args,
int);
746 int ndisabled = va_arg(args,
int);
747 int nblocked = va_arg(args,
int);
752 char *s = pcmk__itoa(nnodes);
756 s = pcmk__itoa(nresources);
760 s = pcmk__itoa(ndisabled);
764 s = pcmk__itoa(nblocked);
771 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
775 const char *quorum = va_arg(args,
const char *);
776 const char *dc_version_s = va_arg(args,
const char *);
777 char *dc_name = va_arg(args,
char *);
786 dc_name, dc_version_s ? dc_version_s :
"unknown");
791 dc_name, dc_version_s ? dc_version_s :
"unknown");
805 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
809 const char *quorum = va_arg(args,
const char *);
810 const char *dc_version_s = va_arg(args,
const char *);
811 char *dc_name = va_arg(args,
char *);
814 out->list_item(out,
"Current DC",
"%s (version %s) - partition %s quorum",
815 dc_name, dc_version_s ? dc_version_s :
"unknown",
818 out->list_item(out,
"Current DC",
"NONE");
824 PCMK__OUTPUT_ARGS(
"cluster-dc",
"pe_node_t *",
"const char *",
"const char *",
"char *")
828 const char *quorum = va_arg(args,
const char *);
829 const char *dc_version_s = va_arg(args,
const char *);
830 char *dc_name G_GNUC_UNUSED = va_arg(args,
char *);
835 "version", dc_version_s ? dc_version_s :
"",
852 unsigned long long flags = va_arg(args,
unsigned long long);
872 out->list_item(out, NULL,
"STONITH of failed nodes %s",
875 out->list_item(out, NULL,
"Cluster is %s",
880 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
884 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
888 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 889 "resources and stop all other resources");
893 out->list_item(out, NULL,
"No quorum policy: Ignore");
897 out->list_item(out, NULL,
"No quorum policy: Suicide");
907 " (the cluster will not attempt to start, stop, or recover services)");
914 " (the cluster will keep all resources stopped)");
916 out->list_item(out, NULL,
"Resource management: enabled");
928 return out->info(out,
"Resource management is DISABLED. The cluster will not attempt to start, stop or recover services.");
930 return out->info(out,
"Resource management is DISABLED. The cluster has stopped all resources.");
941 out->list_item(out, NULL,
"STONITH of failed nodes %s",
944 out->list_item(out, NULL,
"Cluster is %s",
949 out->list_item(out, NULL,
"No quorum policy: Freeze resources");
953 out->list_item(out, NULL,
"No quorum policy: Stop ALL resources");
957 out->list_item(out, NULL,
"No quorum policy: Demote promotable " 958 "resources and stop all other resources");
962 out->list_item(out, NULL,
"No quorum policy: Ignore");
966 out->list_item(out, NULL,
"No quorum policy: Suicide");
978 const char *no_quorum_policy = NULL;
984 no_quorum_policy =
"freeze";
988 no_quorum_policy =
"stop";
992 no_quorum_policy =
"demote";
996 no_quorum_policy =
"ignore";
1000 no_quorum_policy =
"suicide";
1007 "no-quorum-policy", no_quorum_policy,
1010 "stonith-timeout-ms", stonith_timeout_str,
1011 "priority-fencing-delay-ms", priority_fencing_delay_str,
1013 free(stonith_timeout_str);
1014 free(priority_fencing_delay_str);
1022 const char *stack_s = va_arg(args,
const char *);
1035 const char *stack_s = va_arg(args,
const char *);
1037 out->list_item(out,
"Stack",
"%s", stack_s);
1044 const char *stack_s = va_arg(args,
const char *);
1053 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1056 const char *last_written = va_arg(args,
const char *);
1057 const char *user = va_arg(args,
const char *);
1058 const char *client = va_arg(args,
const char *);
1059 const char *origin = va_arg(args,
const char *);
1064 char *buf = last_changed_string(last_written, user, client, origin);
1077 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1080 const char *last_written = va_arg(args,
const char *);
1081 const char *user = va_arg(args,
const char *);
1082 const char *client = va_arg(args,
const char *);
1083 const char *origin = va_arg(args,
const char *);
1089 "time", last_written ? last_written :
"",
1090 "user", user ? user :
"",
1091 "client", client ? client :
"",
1092 "origin", origin ? origin :
"",
1098 PCMK__OUTPUT_ARGS(
"cluster-times",
"const char *",
"const char *",
"const char *",
"const char *")
1101 const char *last_written = va_arg(args,
const char *);
1102 const char *user = va_arg(args,
const char *);
1103 const char *client = va_arg(args,
const char *);
1104 const char *origin = va_arg(args,
const char *);
1106 char *buf = last_changed_string(last_written, user, client, origin);
1109 out->list_item(out,
"Last change",
" %s", buf);
1121 const char *op_key,
const char *node_name,
int rc,
1122 int status,
const char *exit_reason,
1123 const char *exec_time)
1125 char *rsc_id = NULL;
1127 guint interval_ms = 0;
1128 const char *last_change_str = NULL;
1129 time_t last_change_epoch = 0;
1130 GString *str = NULL;
1132 if (pcmk__str_empty(op_key)
1133 || !
parse_op_key(op_key, &rsc_id, &task, &interval_ms)) {
1134 rsc_id = strdup(
"unknown resource");
1135 task = strdup(
"unknown action");
1138 CRM_ASSERT((rsc_id != NULL) && (task != NULL));
1140 str = g_string_sized_new(256);
1142 g_string_printf(str,
"%s ", rsc_id);
1144 if (interval_ms != 0) {
1145 g_string_append_printf(str,
"%s-interval ",
1148 g_string_append_printf(str,
"%s on %s",
1149 crm_action_str(task, interval_ms), node_name);
1152 g_string_append_printf(str,
" returned '%s'",
1153 services_ocf_exitcode_str(rc));
1154 if (!pcmk__str_empty(exit_reason)) {
1155 g_string_append_printf(str,
" (%s)", exit_reason);
1159 g_string_append_printf(str,
" could not be executed (%s",
1160 pcmk_exec_status_str(status));
1161 if (!pcmk__str_empty(exit_reason)) {
1162 g_string_append_printf(str,
": %s", exit_reason);
1164 g_string_append(str,
")");
1169 &last_change_epoch) ==
pcmk_ok) {
1171 if (last_change_str != NULL) {
1172 g_string_append_printf(str,
" at %s", last_change_str);
1175 if (!pcmk__str_empty(exec_time)) {
1176 int exec_time_ms = 0;
1179 && (exec_time_ms > 0)) {
1180 g_string_append_printf(str,
" after %s",
1185 out->
list_item(out, NULL,
"%s", str->str);
1186 g_string_free(str, TRUE);
1197 const char *op_key,
const char *node_name,
int rc,
1198 int status,
const char *exit_reason,
1199 const char *exec_time)
1203 const char *exit_status = services_ocf_exitcode_str(rc);
1204 const char *lrm_status = pcmk_exec_status_str(status);
1205 const char *last_change_str = NULL;
1206 time_t last_change_epoch = 0;
1207 GString *str = NULL;
1209 if (pcmk__str_empty(op_key)) {
1210 op_key =
"unknown operation";
1212 if (pcmk__str_empty(exit_status)) {
1213 exit_status =
"unknown exit status";
1215 if (pcmk__str_empty(call_id)) {
1216 call_id =
"unknown";
1219 str = g_string_sized_new(strlen(op_key) + strlen(node_name)
1220 + strlen(exit_status) + strlen(call_id)
1221 + strlen(lrm_status) + 50);
1223 g_string_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1224 op_key, node_name, exit_status, rc, call_id, lrm_status);
1226 if (!pcmk__str_empty(exit_reason)) {
1227 g_string_append_printf(str,
", exitreason='%s'", exit_reason);
1231 &last_change_epoch) ==
pcmk_ok) {
1233 if (last_change_str != NULL) {
1238 if (!pcmk__str_empty(queue_time)) {
1239 g_string_append_printf(str,
", queued=%sms", queue_time);
1241 if (!pcmk__str_empty(exec_time)) {
1242 g_string_append_printf(str,
", exec=%sms", exec_time);
1245 out->
list_item(out, NULL,
"%s", str->str);
1246 g_string_free(str, TRUE);
1253 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1254 uint32_t show_opts = va_arg(args, uint32_t);
1270 if (pcmk__str_empty(op_key)) {
1271 op_key =
ID(xml_op);
1273 if (pcmk__str_empty(node_name)) {
1274 node_name =
"unknown node";
1278 failed_action_technical(out, xml_op, op_key, node_name, rc, status,
1279 exit_reason, exec_time);
1281 failed_action_friendly(out, xml_op, op_key, node_name, rc, status,
1282 exit_reason, exec_time);
1290 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1291 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1300 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
1301 xmlNodePtr node = NULL;
1307 rc_s = pcmk__itoa(rc);
1309 (op_key == NULL)?
"id" :
"op_key",
1310 (op_key == NULL)?
ID(xml_op) : op_key,
1312 "exitstatus", services_ocf_exitcode_str(rc),
1313 "exitreason",
crm_str(reason_s),
1316 "status", pcmk_exec_status_str(status),
1321 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1322 guint interval_ms = 0;
1325 char *rc_change = NULL;
1328 s = pcmk__itoa(interval_ms);
1350 "GList *",
"uint32_t",
"gboolean")
1354 GList *only_node = va_arg(args, GList *);
1355 GList *only_rsc = va_arg(args, GList *);
1356 uint32_t show_opts = va_arg(args, uint32_t);
1357 gboolean print_spacer = va_arg(args, gboolean);
1359 xmlNode *xml_op = NULL;
1362 const char *
id = NULL;
1368 for (xml_op = pcmk__xml_first_child(
data_set->
failed); xml_op != NULL;
1369 xml_op = pcmk__xml_next(xml_op)) {
1382 if (
parse_op_key(
id ?
id :
ID(xml_op), &rsc, NULL, NULL) == FALSE) {
1394 out->message(out,
"failed-action", xml_op, show_opts);
1416 " (in standby due to on-fail," 1417 " with active resources)");
1420 " (in standby due to on-fail)");
1423 " (in standby, with active resources)");
1431 " (in maintenance mode)");
1437 " (health is RED)");
1438 }
else if (health == 0) {
1440 " (health is YELLOW)");
1445 "GList *",
"GList *")
1449 uint32_t show_opts = va_arg(args, uint32_t);
1450 gboolean full = va_arg(args, gboolean);
1451 GList *only_node = va_arg(args, GList *);
1452 GList *only_rsc = va_arg(args, GList *);
1457 xmlNodePtr item_node;
1462 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1465 status_node(node, item_node);
1469 out->begin_list(out, NULL, NULL,
"Resources");
1481 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1484 status_node(node, item_node);
1491 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1492 rsc, only_node, only_rsc);
1504 status_node(node, item_node);
1509 out->begin_list(out, NULL, NULL,
"%s:", node_name);
1529 return "UNCLEAN (online)";
1532 return "UNCLEAN (pending)";
1535 return "UNCLEAN (offline)";
1542 return "standby (on-fail)";
1547 return "standby (with active resources)";
1552 return "OFFLINE (standby)";
1557 return "maintenance";
1559 return "OFFLINE (maintenance)";
1570 "GList *",
"GList *")
1574 uint32_t show_opts = va_arg(args, uint32_t);
1575 gboolean full = va_arg(args, gboolean);
1576 GList *only_node = va_arg(args, GList *);
1577 GList *only_rsc = va_arg(args, GList *);
1581 GString *str = g_string_sized_new(64);
1586 g_string_append(str,
"GuestNode");
1588 g_string_append(str,
"RemoteNode");
1590 g_string_append(str,
"Node");
1592 g_string_append_printf(str,
" %s: %s",
1593 node_name, node_text_status(node));
1595 g_string_append(str,
" (health is RED)");
1596 }
else if (health == 0) {
1597 g_string_append(str,
" (health is YELLOW)");
1607 out->begin_list(out, NULL, NULL,
"%s", str->str);
1608 out->begin_list(out, NULL, NULL,
"Resources");
1619 GList *gIter2 = NULL;
1621 out->begin_list(out, NULL, NULL,
"%s", str->str);
1622 out->begin_list(out, NULL, NULL,
"Resources");
1628 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1629 rsc, only_node, only_rsc);
1636 out->list_item(out, NULL,
"%s", str->str);
1639 g_string_free(str, TRUE);
1643 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1651 "GList *",
"GList *")
1655 uint32_t show_opts G_GNUC_UNUSED = va_arg(args, uint32_t);
1656 gboolean full = va_arg(args, gboolean);
1657 GList *only_node = va_arg(args, GList *);
1658 GList *only_rsc = va_arg(args, GList *);
1664 const char *health_s = NULL;
1680 }
else if (health == 0) {
1681 health_s =
"yellow";
1699 "resources_running", length_s,
1714 out->message(out, crm_map_element_name(rsc->
xml), show_opts,
1715 rsc, only_node, only_rsc);
1731 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1734 const char *
name = va_arg(args,
const char *);
1735 const char *value = va_arg(args,
const char *);
1736 gboolean add_extra = va_arg(args, gboolean);
1737 int expected_score = va_arg(args,
int);
1742 if (value == NULL) {
1748 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
1749 }
else if (v < expected_score) {
1750 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
1752 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1755 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1761 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1764 const char *
name = va_arg(args,
const char *);
1765 const char *value = va_arg(args,
const char *);
1766 gboolean add_extra = va_arg(args, gboolean);
1767 int expected_score = va_arg(args,
int);
1774 if (value == NULL) {
1785 }
else if (v < expected_score) {
1786 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
1791 out->list_item(out, NULL,
"%s: %s",
name, value);
1801 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1804 gchar *node_str = NULL;
1805 char *last_change_str = NULL;
1810 time_t last_change = 0;
1818 pe_node_t *node = pe__current_node(rsc);
1827 show_opts, target_role,
false);
1840 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
1841 node_str, op_key ? op_key :
ID(xml_op),
1845 last_change_str ? last_change_str :
"",
1846 pcmk_exec_status_str(status));
1849 free(last_change_str);
1857 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1863 time_t last_change = 0;
1864 xmlNode *node = NULL;
1869 "op", op_key ? op_key :
ID(xml_op),
1873 "status", pcmk_exec_status_str(status),
1881 char *agent_tuple = NULL;
1888 "agent", agent_tuple,
1904 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1907 const char *
name = va_arg(args,
const char *);
1908 const char *value = va_arg(args,
const char *);
1909 gboolean add_extra = va_arg(args, gboolean);
1910 int expected_score = va_arg(args,
int);
1918 char *buf = pcmk__itoa(expected_score);
1927 "gboolean",
"GList *",
"GList *")
1931 uint32_t show_opts = va_arg(args, uint32_t);
1932 gboolean print_spacer = va_arg(args, gboolean);
1933 GList *only_node = va_arg(args, GList *);
1934 GList *only_rsc = va_arg(args, GList *);
1939 for (GList *gIter =
data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1942 GList *attr_list = NULL;
1943 GHashTableIter iter;
1951 while (g_hash_table_iter_next (&iter, &key, NULL)) {
1952 attr_list = filter_attr_list(attr_list, key);
1955 if (attr_list == NULL) {
1960 g_list_free(attr_list);
1966 out->message(out,
"node", node, show_opts, FALSE, only_node, only_rsc);
1968 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
1969 const char *
name = aIter->data;
1970 const char *value = NULL;
1971 int expected_score = 0;
1972 gboolean add_extra = FALSE;
1980 out->message(out,
"node-attribute",
name, value, add_extra,
1984 g_list_free(attr_list);
1997 const char *comment = va_arg(args,
const char *);
2003 out->list_item(out, NULL,
"%s", dump_text);
2014 const char *comment = va_arg(args,
const char *);
2026 "GList *",
"GList *",
"uint32_t",
"uint32_t")
2031 xmlNode *node_state = va_arg(args, xmlNode *);
2032 GList *only_node = va_arg(args, GList *);
2033 GList *only_rsc = va_arg(args, GList *);
2034 uint32_t section_opts = va_arg(args, uint32_t);
2035 uint32_t show_opts = va_arg(args, uint32_t);
2037 xmlNode *lrm_rsc = NULL;
2038 xmlNode *rsc_entry = NULL;
2070 time_t last_failure = 0;
2074 if (failcount <= 0) {
2080 out->message(out,
"node", node, show_opts, FALSE, only_node,
2084 out->message(out,
"resource-history", rsc, rsc_id, FALSE,
2085 failcount, last_failure, FALSE);
2087 GList *op_list = get_operation_list(rsc_entry);
2091 if (op_list == NULL) {
2097 out->message(out,
"node", node, show_opts, FALSE, only_node,
2101 out->message(out,
"resource-operation-list",
data_set, rsc, node,
2102 op_list, show_opts);
2110 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"gboolean")
2113 GList *nodes = va_arg(args, GList *);
2114 GList *only_node = va_arg(args, GList *);
2115 GList *only_rsc = va_arg(args, GList *);
2116 uint32_t show_opts = va_arg(args, uint32_t);
2117 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
2121 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2131 out->message(out,
"node", node, show_opts, TRUE, only_node, only_rsc);
2138 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"gboolean")
2141 GList *nodes = va_arg(args, GList *);
2142 GList *only_node = va_arg(args, GList *);
2143 GList *only_rsc = va_arg(args, GList *);
2144 uint32_t show_opts = va_arg(args, uint32_t);
2145 gboolean print_spacer = va_arg(args, gboolean);
2148 char *online_nodes = NULL;
2149 char *online_remote_nodes = NULL;
2150 char *online_guest_nodes = NULL;
2151 char *offline_nodes = NULL;
2152 char *offline_remote_nodes = NULL;
2154 size_t online_nodes_len = 0;
2155 size_t online_remote_nodes_len = 0;
2156 size_t online_guest_nodes_len = 0;
2157 size_t offline_nodes_len = 0;
2158 size_t offline_remote_nodes_len = 0;
2162 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2185 pcmk__add_word(&online_guest_nodes,
2186 &online_guest_nodes_len, node_name);
2188 pcmk__add_word(&online_remote_nodes,
2189 &online_remote_nodes_len, node_name);
2191 pcmk__add_word(&online_nodes, &online_nodes_len, node_name);
2199 pcmk__add_word(&offline_remote_nodes,
2200 &offline_remote_nodes_len, node_name);
2204 pcmk__add_word(&offline_nodes,
2205 &offline_nodes_len, node_name);
2212 out->message(out,
"node", node, show_opts, TRUE, only_node, only_rsc);
2218 out->list_item(out,
"Online",
"[ %s ]", online_nodes);
2221 if (offline_nodes) {
2222 out->list_item(out,
"OFFLINE",
"[ %s ]", offline_nodes);
2223 free(offline_nodes);
2225 if (online_remote_nodes) {
2226 out->list_item(out,
"RemoteOnline",
"[ %s ]", online_remote_nodes);
2227 free(online_remote_nodes);
2229 if (offline_remote_nodes) {
2230 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]", offline_remote_nodes);
2231 free(offline_remote_nodes);
2233 if (online_guest_nodes) {
2234 out->list_item(out,
"GuestOnline",
"[ %s ]", online_guest_nodes);
2235 free(online_guest_nodes);
2242 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"uint32_t",
"gboolean")
2245 GList *nodes = va_arg(args, GList *);
2246 GList *only_node = va_arg(args, GList *);
2247 GList *only_rsc = va_arg(args, GList *);
2248 uint32_t show_opts = va_arg(args, uint32_t);
2249 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
2251 out->begin_list(out, NULL, NULL,
"nodes");
2252 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2260 out->message(out,
"node", node, show_opts, TRUE, only_node, only_rsc);
2268 "uint32_t",
"uint32_t",
"gboolean")
2272 GList *only_node = va_arg(args, GList *);
2273 GList *only_rsc = va_arg(args, GList *);
2274 uint32_t section_opts = va_arg(args, uint32_t);
2275 uint32_t show_opts = va_arg(args, uint32_t);
2276 gboolean print_spacer = va_arg(args, gboolean);
2278 xmlNode *node_state = NULL;
2283 if (xmlChildElementCount(cib_status) == 0) {
2303 out->message(out,
"node-history-list",
data_set, node, node_state,
2304 only_node, only_rsc, section_opts, show_opts);
2311 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2316 const char *prefix = va_arg(args,
const char *);
2317 const char *
uname = va_arg(args,
const char *);
2318 char *score = va_arg(args,
char *);
2321 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2322 prefix, rsc->
id,
uname, score);
2324 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2330 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2335 const char *prefix = va_arg(args,
const char *);
2336 const char *
uname = va_arg(args,
const char *);
2337 char *score = va_arg(args,
char *);
2352 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2355 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2356 const char *task = va_arg(args,
const char *);
2357 const char *interval_ms_s = va_arg(args,
const char *);
2358 int rc = va_arg(args,
int);
2359 uint32_t show_opts = va_arg(args, uint32_t);
2361 char *buf = op_history_string(xml_op, task, interval_ms_s, rc,
2364 out->list_item(out, NULL,
"%s", buf);
2370 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
"uint32_t")
2373 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2374 const char *task = va_arg(args,
const char *);
2375 const char *interval_ms_s = va_arg(args,
const char *);
2376 int rc = va_arg(args,
int);
2377 uint32_t show_opts = va_arg(args, uint32_t);
2379 char *rc_s = pcmk__itoa(rc);
2384 "rc_text", services_ocf_exitcode_str(rc),
2388 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2395 const char *value = NULL;
2399 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2420 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2426 char *score = va_arg(args,
char *);
2428 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2435 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2441 char *score = va_arg(args,
char *);
2444 "id", child_rsc->
id,
2459 gboolean raw = va_arg(args, gboolean);
2461 char *rsc_xml = NULL;
2470 out->output_xml(out,
"xml", rsc_xml);
2476 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2480 const char *rsc_id = va_arg(args,
const char *);
2481 gboolean all = va_arg(args, gboolean);
2482 int failcount = va_arg(args,
int);
2483 time_t last_failure = va_arg(args,
int);
2484 gboolean as_header = va_arg(args, gboolean);
2486 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2489 out->begin_list(out, NULL, NULL,
"%s", buf);
2491 out->list_item(out, NULL,
"%s", buf);
2498 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2502 const char *rsc_id = va_arg(args,
const char *);
2503 gboolean all = va_arg(args, gboolean);
2504 int failcount = va_arg(args,
int);
2505 time_t last_failure = va_arg(args,
int);
2506 gboolean as_header = va_arg(args, gboolean);
2514 }
else if (all || failcount || last_failure > 0) {
2518 "migration-threshold", migration_s,
2522 if (failcount > 0) {
2523 char *s = pcmk__itoa(failcount);
2529 if (last_failure > 0) {
2534 if (as_header == FALSE) {
2546 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2548 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2550 out->
begin_list(out, NULL, NULL,
"Active Resources");
2556 "gboolean",
"GList *",
"GList *",
"gboolean")
2561 uint32_t show_opts = va_arg(args, uint32_t);
2562 gboolean print_summary = va_arg(args, gboolean);
2563 GList *only_node = va_arg(args, GList *);
2564 GList *only_rsc = va_arg(args, GList *);
2565 gboolean print_spacer = va_arg(args, gboolean);
2569 bool printed_header =
false;
2585 print_resource_header(out, show_opts);
2586 printed_header =
true;
2593 for (rsc_iter =
data_set->
resources; rsc_iter != NULL; rsc_iter = rsc_iter->next) {
2598 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
2599 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
2625 if (!printed_header) {
2627 print_resource_header(out, show_opts);
2628 printed_header =
true;
2632 x = out->message(out, crm_map_element_name(rsc->
xml), show_opts, rsc,
2633 only_node, only_rsc);
2640 if (!printed_header) {
2642 print_resource_header(out, show_opts);
2643 printed_header =
true;
2647 out->list_item(out, NULL,
"No inactive resources");
2649 out->list_item(out, NULL,
"No resources");
2651 out->list_item(out, NULL,
"No active resources");
2655 if (printed_header) {
2663 "pe_node_t *",
"GList *",
"uint32_t")
2670 GList *op_list = va_arg(args, GList *);
2671 uint32_t show_opts = va_arg(args, uint32_t);
2673 GList *gIter = NULL;
2677 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
2678 xmlNode *xml_op = (xmlNode *) gIter->data;
2695 time_t last_failure = 0;
2700 failcount, last_failure, TRUE);
2705 out->message(out,
"op-history", xml_op, task, interval_ms_s,
2706 op_rc_i, show_opts);
2710 g_list_free(op_list);
2716 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2722 const char *fn = va_arg(args,
const char *);
2727 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
2728 out->list_item(out, NULL,
"%s", dump_text);
2734 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2740 const char *fn = va_arg(args,
const char *);
2743 "resource", rsc->
id,
2747 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
2761 out->list_item(out, NULL,
"%s:\t%s%s %s", ticket->
id,
2762 ticket->
granted ?
"granted" :
"revoked",
2763 ticket->
standby ?
" [standby]" :
"",
2767 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
2768 ticket->
granted ?
"granted" :
"revoked",
2769 ticket->
standby ?
" [standby]" :
"");
2784 out->list_item(out, ticket->
id,
"%s%s %s",
2785 ticket->
granted ?
"granted" :
"revoked",
2786 ticket->
standby ?
" [standby]" :
"",
2790 out->list_item(out, ticket->
id,
"%s%s",
2791 ticket->
granted ?
"granted" :
"revoked",
2792 ticket->
standby ?
" [standby]" :
"");
2803 xmlNodePtr node = NULL;
2807 "status", ticket->
granted ?
"granted" :
"revoked",
2808 "standby", pcmk__btoa(ticket->
standby),
2822 gboolean print_spacer = va_arg(args, gboolean);
2824 GHashTableIter iter;
2825 gpointer key, value;
2834 out->begin_list(out, NULL, NULL,
"Tickets");
2838 while (g_hash_table_iter_next(&iter, &key, &value)) {
2840 out->message(out,
"ticket", ticket);
2849 {
"ban",
"default", ban_text },
2850 {
"ban",
"html", ban_html },
2851 {
"ban",
"xml", ban_xml },
2852 {
"ban-list",
"default", ban_list },
2858 {
"cluster-counts",
"default", cluster_counts_text },
2859 {
"cluster-counts",
"html", cluster_counts_html },
2860 {
"cluster-counts",
"xml", cluster_counts_xml },
2861 {
"cluster-dc",
"default", cluster_dc_text },
2862 {
"cluster-dc",
"html", cluster_dc_html },
2863 {
"cluster-dc",
"xml", cluster_dc_xml },
2864 {
"cluster-options",
"default", cluster_options_text },
2865 {
"cluster-options",
"html", cluster_options_html },
2866 {
"cluster-options",
"log", cluster_options_log },
2867 {
"cluster-options",
"xml", cluster_options_xml },
2868 {
"cluster-summary",
"default", cluster_summary },
2869 {
"cluster-summary",
"html", cluster_summary_html },
2870 {
"cluster-stack",
"default", cluster_stack_text },
2871 {
"cluster-stack",
"html", cluster_stack_html },
2872 {
"cluster-stack",
"xml", cluster_stack_xml },
2873 {
"cluster-times",
"default", cluster_times_text },
2874 {
"cluster-times",
"html", cluster_times_html },
2875 {
"cluster-times",
"xml", cluster_times_xml },
2876 {
"failed-action",
"default", failed_action_default },
2877 {
"failed-action",
"xml", failed_action_xml },
2878 {
"failed-action-list",
"default", failed_action_list },
2881 {
"maint-mode",
"text", cluster_maint_mode_text },
2882 {
"node",
"default", node_text },
2883 {
"node",
"html", node_html },
2884 {
"node",
"xml", node_xml },
2885 {
"node-and-op",
"default", node_and_op },
2886 {
"node-and-op",
"xml", node_and_op_xml },
2887 {
"node-capacity",
"default", node_capacity },
2888 {
"node-capacity",
"xml", node_capacity_xml },
2889 {
"node-history-list",
"default", node_history_list },
2890 {
"node-list",
"default", node_list_text },
2891 {
"node-list",
"html", node_list_html },
2892 {
"node-list",
"xml", node_list_xml },
2893 {
"node-weight",
"default", node_weight },
2894 {
"node-weight",
"xml", node_weight_xml },
2895 {
"node-attribute",
"default", node_attribute_text },
2896 {
"node-attribute",
"html", node_attribute_html },
2897 {
"node-attribute",
"xml", node_attribute_xml },
2898 {
"node-attribute-list",
"default", node_attribute_list },
2899 {
"node-summary",
"default", node_summary },
2900 {
"op-history",
"default", op_history_text },
2901 {
"op-history",
"xml", op_history_xml },
2905 {
"promotion-score",
"default", promotion_score },
2906 {
"promotion-score",
"xml", promotion_score_xml },
2907 {
"resource-config",
"default", resource_config },
2908 {
"resource-history",
"default", resource_history_text },
2909 {
"resource-history",
"xml", resource_history_xml },
2910 {
"resource-list",
"default", resource_list },
2911 {
"resource-operation-list",
"default", resource_operation_list },
2912 {
"resource-util",
"default", resource_util },
2913 {
"resource-util",
"xml", resource_util_xml },
2914 {
"ticket",
"default", ticket_text },
2915 {
"ticket",
"html", ticket_html },
2916 {
"ticket",
"xml", ticket_xml },
2917 {
"ticket-list",
"default", ticket_list },
2919 { NULL, NULL, NULL }
2936 crm_trace(
"%sNode %s: (weight=%d, fixed=%s)",
2941 char *pe_mutable = strdup(
"\t\t");
2945 all = g_list_prepend(all, (gpointer)
"*");
2953 for (; gIter != NULL; gIter = gIter->next) {
2957 out->
message(out, crm_map_element_name(rsc->
xml), show_opts,
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)
#define XML_RSC_OP_LAST_CHANGE
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
#define XML_ATTR_UPDATE_ORIG
enum rsc_role_e role_filter
enum pe_quorum_policy no_quorum_policy
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
#define XML_ATTR_UPDATE_CLIENT
Control output from tools.
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
int(* message)(pcmk__output_t *out, const char *message_id,...)
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)
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
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)
pe_resource_t * uber_parent(pe_resource_t *rsc)
void pcmk__output_xml_push_parent(pcmk__output_t *out, xmlNodePtr node)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#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)
PCMK__OUTPUT_ARGS("ban-list", "pe_working_set_t *", "const char *", "GList *", "uint32_t", "gboolean")
xmlNode * pcmk_create_xml_text_node(xmlNode *parent, const char *name, const char *content)
#define crm_trace(fmt, args...)
int pe__clone_xml(pcmk__output_t *out, va_list args)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
void crm_time_set_timet(crm_time_t *target, time_t *source)
#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
GHashTable * pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
pe_working_set_t * data_set
bool pcmk_xe_mask_probe_failure(xmlNode *xml_op)
gboolean pcmk__str_in_list(const gchar *s, GList *lst, uint32_t flags)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
char * dump_xml_formatted(xmlNode *msg)
Action completed, result is known.
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.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define PCMK__FAIL_COUNT_PREFIX
void pe__output_node(pe_node_t *node, gboolean details, pcmk__output_t *out)
#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
const char * pcmk__epoch2str(time_t *when)
void pcmk__xe_set_props(xmlNodePtr node,...) G_GNUC_NULL_TERMINATED
char * crm_time_as_string(crm_time_t *dt, int flags)
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.
#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.
void pcmk__register_messages(pcmk__output_t *out, pcmk__message_entry_t *table)
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
char * crm_xml_escape(const char *text)
Replace special characters with their XML escape sequences.
void print_str_str(gpointer key, gpointer value, gpointer user_data)
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
#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)