18 #define FILTER_STR { PCMK__FAIL_COUNT_PREFIX, PCMK__LAST_FAILURE_PREFIX, \ 19 "shutdown", "terminate", "standby", "probe_complete", \ 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;
59 if (add_extra_info(node, rsc->
children, data_set, attrname,
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']",
181 data_set->
input, LOG_DEBUG);
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 *",
"unsigned int",
"unsigned int")
316 unsigned int section_opts = va_arg(args,
unsigned int);
317 unsigned int show_opts = va_arg(args,
unsigned int);
320 const char *stack_s = get_cluster_stack(data_set);
324 out->message(out,
"cluster-stack", stack_s);
329 data_set->
input, LOG_DEBUG);
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 *",
"unsigned int",
"unsigned int")
378 unsigned int section_opts = va_arg(args,
unsigned int);
379 unsigned int show_opts = va_arg(args,
unsigned int);
382 const char *stack_s = get_cluster_stack(data_set);
386 out->message(out,
"cluster-stack", stack_s);
392 data_set->
input, LOG_DEBUG);
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 unsigned int show_opts = va_arg(args,
unsigned int);
564 unsigned int show_opts = va_arg(args,
unsigned int);
568 out->list_item(out, NULL,
"%s\tprevents %s from running %son %s",
581 unsigned int show_opts G_GNUC_UNUSED = va_arg(args,
unsigned int);
584 char *weight_s = pcmk__itoa(pe_node->
weight);
591 "promoted-only", promoted_only,
598 "master_only", promoted_only,
606 "unsigned int",
"gboolean")
610 const char *prefix = va_arg(args,
const char *);
611 GList *only_rsc = va_arg(args, GList *);
612 unsigned int show_opts = va_arg(args,
unsigned int);
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");
1139 str = g_string_sized_new(strlen(rsc_id) + strlen(task) + strlen(node_name)
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));
1155 g_string_append_printf(str,
" could not be executed (%s)",
1156 pcmk_exec_status_str(status));
1159 if (!pcmk__str_empty(exit_reason)) {
1160 g_string_append_printf(str,
" because '%s'", exit_reason);
1164 &last_change_epoch) ==
pcmk_ok) {
1166 if (last_change_str != NULL) {
1167 g_string_append_printf(str,
" at %s", last_change_str);
1170 if (!pcmk__str_empty(exec_time)) {
1171 int exec_time_ms = 0;
1174 && (exec_time_ms > 0)) {
1175 g_string_append_printf(str,
" after %s",
1180 out->
list_item(out, NULL,
"%s", str->str);
1181 g_string_free(str, TRUE);
1192 const char *op_key,
const char *node_name,
int rc,
1193 int status,
const char *exit_reason,
1194 const char *exec_time)
1198 const char *exit_status = services_ocf_exitcode_str(
rc);
1199 const char *lrm_status = pcmk_exec_status_str(status);
1200 const char *last_change_str = NULL;
1201 time_t last_change_epoch = 0;
1202 GString *str = NULL;
1204 if (pcmk__str_empty(op_key)) {
1205 op_key =
"unknown operation";
1207 if (pcmk__str_empty(exit_status)) {
1208 exit_status =
"unknown exit status";
1210 if (pcmk__str_empty(call_id)) {
1211 call_id =
"unknown";
1214 str = g_string_sized_new(strlen(op_key) + strlen(node_name)
1215 + strlen(exit_status) + strlen(call_id)
1216 + strlen(lrm_status) + 50);
1218 g_string_printf(str,
"%s on %s '%s' (%d): call=%s, status='%s'",
1219 op_key, node_name, exit_status,
rc, call_id, lrm_status);
1221 if (!pcmk__str_empty(exit_reason)) {
1222 g_string_append_printf(str,
", exitreason='%s'", exit_reason);
1226 &last_change_epoch) ==
pcmk_ok) {
1228 if (last_change_str != NULL) {
1233 if (!pcmk__str_empty(queue_time)) {
1234 g_string_append_printf(str,
", queued=%sms", queue_time);
1236 if (!pcmk__str_empty(exec_time)) {
1237 g_string_append_printf(str,
", exec=%sms", exec_time);
1240 out->
list_item(out, NULL,
"%s", str->str);
1241 g_string_free(str, TRUE);
1248 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1249 unsigned int show_opts = va_arg(args,
unsigned int);
1265 if (pcmk__str_empty(op_key)) {
1266 op_key =
ID(xml_op);
1268 if (pcmk__str_empty(node_name)) {
1269 node_name =
"unknown node";
1273 failed_action_technical(out, xml_op, op_key, node_name,
rc, status,
1274 exit_reason, exec_time);
1276 failed_action_friendly(out, xml_op, op_key, node_name,
rc, status,
1277 exit_reason, exec_time);
1285 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1286 unsigned int show_opts G_GNUC_UNUSED = va_arg(args,
unsigned int);
1295 char *reason_s =
crm_xml_escape(exit_reason ? exit_reason :
"none");
1296 xmlNodePtr node = NULL;
1302 rc_s = pcmk__itoa(
rc);
1304 (op_key == NULL)?
"id" :
"op_key",
1305 (op_key == NULL)?
ID(xml_op) : op_key,
1307 "exitstatus", services_ocf_exitcode_str(
rc),
1308 "exitreason",
crm_str(reason_s),
1311 "status", pcmk_exec_status_str(status),
1316 &epoch) ==
pcmk_ok) && (epoch > 0)) {
1317 guint interval_ms = 0;
1320 char *rc_change = NULL;
1323 s = pcmk__itoa(interval_ms);
1345 "GList *",
"unsigned int",
"gboolean")
1349 GList *only_node = va_arg(args, GList *);
1350 GList *only_rsc = va_arg(args, GList *);
1351 unsigned int show_opts = va_arg(args, gboolean);
1352 gboolean print_spacer = va_arg(args, gboolean);
1354 xmlNode *xml_op = NULL;
1357 const char *
id = NULL;
1359 if (xmlChildElementCount(data_set->
failed) == 0) {
1363 for (xml_op = pcmk__xml_first_child(data_set->
failed); xml_op != NULL;
1364 xml_op = pcmk__xml_next(xml_op)) {
1373 if (
parse_op_key(
id ?
id :
ID(xml_op), &rsc, NULL, NULL) == FALSE) {
1385 out->message(out,
"failed-action", xml_op, show_opts);
1393 status_node(
pe_node_t *node, xmlNodePtr parent)
1415 "GList *",
"GList *")
1419 unsigned int show_opts = va_arg(args,
unsigned int);
1420 gboolean full = va_arg(args, gboolean);
1421 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1422 GList *only_node = va_arg(args, GList *);
1423 GList *only_rsc = va_arg(args, GList *);
1428 xmlNodePtr item_node;
1433 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1436 status_node(node, item_node);
1440 out->begin_list(out, NULL, NULL,
"Resources");
1452 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1455 status_node(node, item_node);
1462 rsc, only_node, only_rsc);
1474 status_node(node, item_node);
1479 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1486 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1487 "GList *",
"GList *")
1491 unsigned int show_opts = va_arg(args,
unsigned int);
1492 gboolean full = va_arg(args, gboolean);
1493 const char *node_mode = va_arg(args,
const char *);
1494 GList *only_node = va_arg(args, GList *);
1495 GList *only_rsc = va_arg(args, GList *);
1517 out->begin_list(out, NULL, NULL,
"%s", buf);
1518 out->begin_list(out, NULL, NULL,
"Resources");
1529 GList *gIter2 = NULL;
1531 out->begin_list(out, NULL, NULL,
"%s", buf);
1532 out->begin_list(out, NULL, NULL,
"Resources");
1537 rsc, only_node, only_rsc);
1544 out->list_item(out, NULL,
"%s", buf);
1551 out->begin_list(out, NULL, NULL,
"Node: %s", node_name);
1558 PCMK__OUTPUT_ARGS(
"node",
"pe_node_t *",
"unsigned int",
"gboolean",
"const char *",
1559 "GList *",
"GList *")
1563 unsigned int show_opts G_GNUC_UNUSED = va_arg(args,
unsigned int);
1564 gboolean full = va_arg(args, gboolean);
1565 const char *node_mode G_GNUC_UNUSED = va_arg(args,
const char *);
1566 GList *only_node = va_arg(args, GList *);
1567 GList *only_rsc = va_arg(args, GList *);
1596 "resources_running", length_s,
1610 rsc, only_node, only_rsc);
1626 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1629 const char *
name = va_arg(args,
const char *);
1630 const char *value = va_arg(args,
const char *);
1631 gboolean add_extra = va_arg(args, gboolean);
1632 int expected_score = va_arg(args,
int);
1637 if (value == NULL) {
1643 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is lost",
name, value);
1644 }
else if (v < expected_score) {
1645 out->list_item(out, NULL,
"%-32s\t: %-10s\t: Connectivity is degraded (Expected=%d)",
name, value, expected_score);
1647 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1650 out->list_item(out, NULL,
"%-32s\t: %-10s",
name, value);
1656 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1659 const char *
name = va_arg(args,
const char *);
1660 const char *value = va_arg(args,
const char *);
1661 gboolean add_extra = va_arg(args, gboolean);
1662 int expected_score = va_arg(args,
int);
1669 if (value == NULL) {
1680 }
else if (v < expected_score) {
1681 char *buf =
crm_strdup_printf(
"(connectivity is degraded -- expected %d", expected_score);
1686 out->list_item(out, NULL,
"%s: %s",
name, value);
1696 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1699 gchar *node_str = NULL;
1700 char *last_change_str = NULL;
1705 time_t last_change = 0;
1713 pe_node_t *node = pe__current_node(rsc);
1722 show_opts, target_role,
false);
1735 out->list_item(out, NULL,
"%s: %s (node=%s, call=%s, rc=%s%s): %s",
1736 node_str, op_key ? op_key :
ID(xml_op),
1740 last_change_str ? last_change_str :
"",
1741 pcmk_exec_status_str(status));
1744 free(last_change_str);
1752 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
1758 time_t last_change = 0;
1759 xmlNode *node = NULL;
1764 "op", op_key ? op_key :
ID(xml_op),
1768 "status", pcmk_exec_status_str(status),
1776 char *agent_tuple = NULL;
1783 "agent", agent_tuple,
1799 PCMK__OUTPUT_ARGS(
"node-attribute",
"const char *",
"const char *",
"gboolean",
"int")
1802 const char *
name = va_arg(args,
const char *);
1803 const char *value = va_arg(args,
const char *);
1804 gboolean add_extra = va_arg(args, gboolean);
1805 int expected_score = va_arg(args,
int);
1813 char *buf = pcmk__itoa(expected_score);
1822 "gboolean",
"GList *",
"GList *")
1826 unsigned int show_opts = va_arg(args,
unsigned int);
1827 gboolean print_spacer = va_arg(args, gboolean);
1828 GList *only_node = va_arg(args, GList *);
1829 GList *only_rsc = va_arg(args, GList *);
1834 for (GList *gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1837 GList *attr_list = NULL;
1838 GHashTableIter iter;
1846 while (g_hash_table_iter_next (&iter, &key, NULL)) {
1847 attr_list = filter_attr_list(attr_list, key);
1850 if (attr_list == NULL) {
1855 g_list_free(attr_list);
1861 out->message(out,
"node", node, show_opts, FALSE, NULL, only_node, only_rsc);
1863 for (GList *aIter = attr_list; aIter != NULL; aIter = aIter->next) {
1864 const char *
name = aIter->data;
1865 const char *value = NULL;
1866 int expected_score = 0;
1867 gboolean add_extra = FALSE;
1872 data_set,
name, &expected_score);
1875 out->message(out,
"node-attribute",
name, value, add_extra,
1879 g_list_free(attr_list);
1892 const char *comment = va_arg(args,
const char *);
1898 out->list_item(out, NULL,
"%s", dump_text);
1909 const char *comment = va_arg(args,
const char *);
1921 "GList *",
"GList *",
"unsigned int",
"unsigned int")
1926 xmlNode *node_state = va_arg(args, xmlNode *);
1927 GList *only_node = va_arg(args, GList *);
1928 GList *only_rsc = va_arg(args, GList *);
1929 unsigned int section_opts = va_arg(args,
unsigned int);
1930 unsigned int show_opts = va_arg(args,
unsigned int);
1932 xmlNode *lrm_rsc = NULL;
1933 xmlNode *rsc_entry = NULL;
1965 time_t last_failure = 0;
1969 if (failcount <= 0) {
1975 out->message(out,
"node", node, show_opts, FALSE, NULL, only_node, only_rsc);
1978 out->message(out,
"resource-history", rsc, rsc_id, FALSE,
1979 failcount, last_failure, FALSE);
1981 GList *op_list = get_operation_list(rsc_entry);
1985 if (op_list == NULL) {
1991 out->message(out,
"node", node, show_opts, FALSE, NULL, only_node, only_rsc);
1994 out->message(out,
"resource-operation-list", data_set, rsc, node,
1995 op_list, show_opts);
2003 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean")
2006 GList *nodes = va_arg(args, GList *);
2007 GList *only_node = va_arg(args, GList *);
2008 GList *only_rsc = va_arg(args, GList *);
2009 unsigned int show_opts = va_arg(args,
unsigned int);
2010 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
2014 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2024 out->message(out,
"node", node, show_opts, TRUE, NULL, only_node, only_rsc);
2031 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean")
2034 GList *nodes = va_arg(args, GList *);
2035 GList *only_node = va_arg(args, GList *);
2036 GList *only_rsc = va_arg(args, GList *);
2037 unsigned int show_opts = va_arg(args,
unsigned int);
2038 gboolean print_spacer = va_arg(args, gboolean);
2041 char *online_nodes = NULL;
2042 char *online_remote_nodes = NULL;
2043 char *online_guest_nodes = NULL;
2044 char *offline_nodes = NULL;
2045 char *offline_remote_nodes = NULL;
2047 size_t online_nodes_len = 0;
2048 size_t online_remote_nodes_len = 0;
2049 size_t online_guest_nodes_len = 0;
2050 size_t offline_nodes_len = 0;
2051 size_t offline_remote_nodes_len = 0;
2055 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2057 const char *node_mode = NULL;
2071 node_mode =
"UNCLEAN (online)";
2074 node_mode =
"UNCLEAN (pending)";
2077 node_mode =
"UNCLEAN (offline)";
2081 node_mode =
"pending";
2084 node_mode =
"standby (on-fail)";
2089 node_mode =
"standby (with active resources)";
2091 node_mode =
"standby";
2094 node_mode =
"OFFLINE (standby)";
2099 node_mode =
"maintenance";
2101 node_mode =
"OFFLINE (maintenance)";
2105 node_mode =
"online";
2108 pcmk__add_word(&online_guest_nodes,
2109 &online_guest_nodes_len, node_name);
2111 pcmk__add_word(&online_remote_nodes,
2112 &online_remote_nodes_len, node_name);
2114 pcmk__add_word(&online_nodes, &online_nodes_len, node_name);
2121 node_mode =
"OFFLINE";
2124 pcmk__add_word(&offline_remote_nodes,
2125 &offline_remote_nodes_len, node_name);
2129 pcmk__add_word(&offline_nodes,
2130 &offline_nodes_len, node_name);
2138 out->message(out,
"node", node, show_opts, TRUE, node_mode, only_node, only_rsc);
2144 out->list_item(out,
"Online",
"[ %s ]", online_nodes);
2147 if (offline_nodes) {
2148 out->list_item(out,
"OFFLINE",
"[ %s ]", offline_nodes);
2149 free(offline_nodes);
2151 if (online_remote_nodes) {
2152 out->list_item(out,
"RemoteOnline",
"[ %s ]", online_remote_nodes);
2153 free(online_remote_nodes);
2155 if (offline_remote_nodes) {
2156 out->list_item(out,
"RemoteOFFLINE",
"[ %s ]", offline_remote_nodes);
2157 free(offline_remote_nodes);
2159 if (online_guest_nodes) {
2160 out->list_item(out,
"GuestOnline",
"[ %s ]", online_guest_nodes);
2161 free(online_guest_nodes);
2168 PCMK__OUTPUT_ARGS(
"node-list",
"GList *",
"GList *",
"GList *",
"unsigned int",
"gboolean")
2171 GList *nodes = va_arg(args, GList *);
2172 GList *only_node = va_arg(args, GList *);
2173 GList *only_rsc = va_arg(args, GList *);
2174 unsigned int show_opts = va_arg(args,
unsigned int);
2175 gboolean print_spacer G_GNUC_UNUSED = va_arg(args, gboolean);
2177 out->begin_list(out, NULL, NULL,
"nodes");
2178 for (GList *gIter = nodes; gIter != NULL; gIter = gIter->next) {
2186 out->message(out,
"node", node, show_opts, TRUE, NULL, only_node, only_rsc);
2194 "unsigned int",
"unsigned int",
"gboolean")
2198 GList *only_node = va_arg(args, GList *);
2199 GList *only_rsc = va_arg(args, GList *);
2200 unsigned int section_opts = va_arg(args,
unsigned int);
2201 unsigned int show_opts = va_arg(args,
unsigned int);
2202 gboolean print_spacer = va_arg(args, gboolean);
2204 xmlNode *node_state = NULL;
2208 if (xmlChildElementCount(cib_status) == 0) {
2228 out->message(out,
"node-history-list", data_set, node, node_state,
2229 only_node, only_rsc, section_opts, show_opts);
2236 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2241 const char *prefix = va_arg(args,
const char *);
2242 const char *
uname = va_arg(args,
const char *);
2243 char *score = va_arg(args,
char *);
2246 out->list_item(out, NULL,
"%s: %s allocation score on %s: %s",
2247 prefix, rsc->
id,
uname, score);
2249 out->list_item(out, NULL,
"%s: %s = %s", prefix,
uname, score);
2255 PCMK__OUTPUT_ARGS(
"node-weight",
"pe_resource_t *",
"const char *",
"const char *",
"char *")
2260 const char *prefix = va_arg(args,
const char *);
2261 const char *
uname = va_arg(args,
const char *);
2262 char *score = va_arg(args,
char *);
2281 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2282 const char *task = va_arg(args,
const char *);
2283 const char *interval_ms_s = va_arg(args,
const char *);
2284 int rc = va_arg(args,
int);
2285 unsigned int show_opts = va_arg(args,
unsigned int);
2287 char *buf = op_history_string(xml_op, task, interval_ms_s,
rc,
2290 out->list_item(out, NULL,
"%s", buf);
2296 PCMK__OUTPUT_ARGS(
"op-history",
"xmlNodePtr",
"const char *",
"const char *",
"int",
2300 xmlNodePtr xml_op = va_arg(args, xmlNodePtr);
2301 const char *task = va_arg(args,
const char *);
2302 const char *interval_ms_s = va_arg(args,
const char *);
2303 int rc = va_arg(args,
int);
2304 unsigned int show_opts = va_arg(args,
unsigned int);
2306 char *rc_s = pcmk__itoa(
rc);
2311 "rc_text", services_ocf_exitcode_str(
rc),
2315 if (interval_ms_s && !pcmk__str_eq(interval_ms_s,
"0",
pcmk__str_casei)) {
2322 const char *value = NULL;
2326 &epoch) ==
pcmk_ok) && (epoch > 0)) {
2347 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2353 char *score = va_arg(args,
char *);
2355 out->list_item(out, NULL,
"%s promotion score on %s: %s",
2362 PCMK__OUTPUT_ARGS(
"promotion-score",
"pe_resource_t *",
"pe_node_t *",
"char *")
2368 char *score = va_arg(args,
char *);
2371 "id", child_rsc->
id,
2386 gboolean raw = va_arg(args, gboolean);
2388 char *rsc_xml = NULL;
2397 out->output_xml(out,
"xml", rsc_xml);
2403 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2407 const char *rsc_id = va_arg(args,
const char *);
2408 gboolean all = va_arg(args, gboolean);
2409 int failcount = va_arg(args,
int);
2410 time_t last_failure = va_arg(args,
int);
2411 gboolean as_header = va_arg(args, gboolean);
2413 char *buf = resource_history_string(rsc, rsc_id, all, failcount, last_failure);
2416 out->begin_list(out, NULL, NULL,
"%s", buf);
2418 out->list_item(out, NULL,
"%s", buf);
2425 PCMK__OUTPUT_ARGS(
"resource-history",
"pe_resource_t *",
"const char *",
"gboolean",
"int",
"time_t",
"gboolean")
2429 const char *rsc_id = va_arg(args,
const char *);
2430 gboolean all = va_arg(args, gboolean);
2431 int failcount = va_arg(args,
int);
2432 time_t last_failure = va_arg(args,
int);
2433 gboolean as_header = va_arg(args, gboolean);
2441 }
else if (all || failcount || last_failure > 0) {
2445 "migration-threshold", migration_s,
2449 if (failcount > 0) {
2450 char *s = pcmk__itoa(failcount);
2456 if (last_failure > 0) {
2461 if (as_header == FALSE) {
2469 print_resource_header(
pcmk__output_t *out,
unsigned int show_opts)
2473 out->
begin_list(out, NULL, NULL,
"Inactive Resources");
2475 out->
begin_list(out, NULL, NULL,
"Full List of Resources");
2477 out->
begin_list(out, NULL, NULL,
"Active Resources");
2483 "gboolean",
"GList *",
"GList *",
"gboolean")
2488 unsigned int show_opts = va_arg(args,
unsigned int);
2489 gboolean print_summary = va_arg(args, gboolean);
2490 GList *only_node = va_arg(args, GList *);
2491 GList *only_rsc = va_arg(args, GList *);
2492 gboolean print_spacer = va_arg(args, gboolean);
2496 bool printed_header =
false;
2512 print_resource_header(out, show_opts);
2513 printed_header =
true;
2520 for (rsc_iter = data_set->
resources; rsc_iter != NULL; rsc_iter = rsc_iter->next) {
2525 gboolean is_active = rsc->
fns->
active(rsc, TRUE);
2526 gboolean partially_active = rsc->
fns->
active(rsc, FALSE);
2552 if (!printed_header) {
2554 print_resource_header(out, show_opts);
2555 printed_header =
true;
2559 x = out->message(out, crm_map_element_name(rsc->
xml), show_opts, rsc,
2560 only_node, only_rsc);
2567 if (!printed_header) {
2569 print_resource_header(out, show_opts);
2570 printed_header =
true;
2574 out->list_item(out, NULL,
"No inactive resources");
2576 out->list_item(out, NULL,
"No resources");
2578 out->list_item(out, NULL,
"No active resources");
2582 if (printed_header) {
2590 "pe_node_t *",
"GList *",
"unsigned int")
2597 GList *op_list = va_arg(args, GList *);
2598 unsigned int show_opts = va_arg(args,
unsigned int);
2600 GList *gIter = NULL;
2604 for (gIter = op_list; gIter != NULL; gIter = gIter->next) {
2605 xmlNode *xml_op = (xmlNode *) gIter->data;
2622 time_t last_failure = 0;
2627 failcount, last_failure, TRUE);
2632 out->message(out,
"op-history", xml_op, task, interval_ms_s,
2633 op_rc_i, show_opts);
2637 g_list_free(op_list);
2643 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2649 const char *fn = va_arg(args,
const char *);
2654 g_hash_table_foreach(rsc->
utilization, append_dump_text, &dump_text);
2655 out->list_item(out, NULL,
"%s", dump_text);
2661 PCMK__OUTPUT_ARGS(
"resource-util",
"pe_resource_t *",
"pe_node_t *",
"const char *")
2667 const char *fn = va_arg(args,
const char *);
2670 "resource", rsc->
id,
2674 g_hash_table_foreach(rsc->
utilization, add_dump_node, xml_node);
2688 out->list_item(out, NULL,
"%s:\t%s%s %s", ticket->
id,
2689 ticket->
granted ?
"granted" :
"revoked",
2690 ticket->
standby ?
" [standby]" :
"",
2694 out->list_item(out, NULL,
"%s:\t%s%s", ticket->
id,
2695 ticket->
granted ?
"granted" :
"revoked",
2696 ticket->
standby ?
" [standby]" :
"");
2711 out->list_item(out, ticket->
id,
"%s%s %s",
2712 ticket->
granted ?
"granted" :
"revoked",
2713 ticket->
standby ?
" [standby]" :
"",
2717 out->list_item(out, ticket->
id,
"%s%s",
2718 ticket->
granted ?
"granted" :
"revoked",
2719 ticket->
standby ?
" [standby]" :
"");
2730 xmlNodePtr node = NULL;
2734 "status", ticket->
granted ?
"granted" :
"revoked",
2735 "standby", pcmk__btoa(ticket->
standby),
2749 gboolean print_spacer = va_arg(args, gboolean);
2751 GHashTableIter iter;
2752 gpointer key, value;
2754 if (g_hash_table_size(data_set->
tickets) == 0) {
2761 out->begin_list(out, NULL, NULL,
"Tickets");
2764 g_hash_table_iter_init(&iter, data_set->
tickets);
2765 while (g_hash_table_iter_next(&iter, &key, &value)) {
2767 out->message(out,
"ticket", ticket);
2776 {
"ban",
"default", ban_text },
2777 {
"ban",
"html", ban_html },
2778 {
"ban",
"xml", ban_xml },
2779 {
"ban-list",
"default", ban_list },
2785 {
"cluster-counts",
"default", cluster_counts_text },
2786 {
"cluster-counts",
"html", cluster_counts_html },
2787 {
"cluster-counts",
"xml", cluster_counts_xml },
2788 {
"cluster-dc",
"default", cluster_dc_text },
2789 {
"cluster-dc",
"html", cluster_dc_html },
2790 {
"cluster-dc",
"xml", cluster_dc_xml },
2791 {
"cluster-options",
"default", cluster_options_text },
2792 {
"cluster-options",
"html", cluster_options_html },
2793 {
"cluster-options",
"log", cluster_options_log },
2794 {
"cluster-options",
"xml", cluster_options_xml },
2795 {
"cluster-summary",
"default", cluster_summary },
2796 {
"cluster-summary",
"html", cluster_summary_html },
2797 {
"cluster-stack",
"default", cluster_stack_text },
2798 {
"cluster-stack",
"html", cluster_stack_html },
2799 {
"cluster-stack",
"xml", cluster_stack_xml },
2800 {
"cluster-times",
"default", cluster_times_text },
2801 {
"cluster-times",
"html", cluster_times_html },
2802 {
"cluster-times",
"xml", cluster_times_xml },
2803 {
"failed-action",
"default", failed_action_default },
2804 {
"failed-action",
"xml", failed_action_xml },
2805 {
"failed-action-list",
"default", failed_action_list },
2808 {
"maint-mode",
"text", cluster_maint_mode_text },
2809 {
"node",
"default", node_text },
2810 {
"node",
"html", node_html },
2811 {
"node",
"xml", node_xml },
2812 {
"node-and-op",
"default", node_and_op },
2813 {
"node-and-op",
"xml", node_and_op_xml },
2814 {
"node-capacity",
"default", node_capacity },
2815 {
"node-capacity",
"xml", node_capacity_xml },
2816 {
"node-history-list",
"default", node_history_list },
2817 {
"node-list",
"default", node_list_text },
2818 {
"node-list",
"html", node_list_html },
2819 {
"node-list",
"xml", node_list_xml },
2820 {
"node-weight",
"default", node_weight },
2821 {
"node-weight",
"xml", node_weight_xml },
2822 {
"node-attribute",
"default", node_attribute_text },
2823 {
"node-attribute",
"html", node_attribute_html },
2824 {
"node-attribute",
"xml", node_attribute_xml },
2825 {
"node-attribute-list",
"default", node_attribute_list },
2826 {
"node-summary",
"default", node_summary },
2827 {
"op-history",
"default", op_history_text },
2828 {
"op-history",
"xml", op_history_xml },
2832 {
"promotion-score",
"default", promotion_score },
2833 {
"promotion-score",
"xml", promotion_score_xml },
2834 {
"resource-config",
"default", resource_config },
2835 {
"resource-history",
"default", resource_history_text },
2836 {
"resource-history",
"xml", resource_history_xml },
2837 {
"resource-list",
"default", resource_list },
2838 {
"resource-operation-list",
"default", resource_operation_list },
2839 {
"resource-util",
"default", resource_util },
2840 {
"resource-util",
"xml", resource_util_xml },
2841 {
"ticket",
"default", ticket_text },
2842 {
"ticket",
"html", ticket_html },
2843 {
"ticket",
"xml", ticket_xml },
2844 {
"ticket-list",
"default", ticket_list },
2846 { NULL, NULL, NULL }
2863 crm_trace(
"%sNode %s: (weight=%d, fixed=%s)",
2868 char *pe_mutable = strdup(
"\t\t");
2872 all = g_list_prepend(all, (gpointer)
"*");
2880 for (; gIter != NULL; gIter = gIter->next) {
2883 out->
message(out, crm_map_element_name(rsc->
xml),
crm_time_t * crm_time_new_undefined(void)
Allocate memory for an uninitialized time object.
#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 * get_object_root(const char *object_type, xmlNode *the_root)
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
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)
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)
#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.
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)
#define XML_LRM_TAG_RESOURCES
gchar * pcmk__native_output_string(pe_resource_t *rsc, const char *name, pe_node_t *node, unsigned long show_opts, const char *target_role, bool show_nodes)
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)
PCMK__OUTPUT_ARGS("ban-list", "pe_working_set_t *", "const char *", "GList *", "unsigned int", "gboolean")
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)