MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / print_node_summary

Function print_node_summary

tools/crm_mon.c:932–981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932static void
933print_node_summary(pe_working_set_t * data_set, gboolean operations)
934{
935 xmlNode *lrm_rsc = NULL;
936 xmlNode *rsc_entry = NULL;
937 xmlNode *node_state = NULL;
938 xmlNode *cib_status = get_object_root(XML_CIB_TAG_STATUS, data_set->input);
939
940 if (operations) {
941 print_as("\nOperations:\n");
942 } else {
943 print_as("\nMigration summary:\n");
944 }
945
946 for (node_state = __xml_first_child(cib_status); node_state != NULL;
947 node_state = __xml_next(node_state)) {
948 if (crm_str_eq((const char *)node_state->name, XML_CIB_TAG_STATE, TRUE)) {
949 node_t *node = pe_find_node_id(data_set->nodes, ID(node_state));
950
951 if (node == NULL || node->details->online == FALSE) {
952 continue;
953 }
954
955 print_as("* Node %s: ", crm_element_value(node_state, XML_ATTR_UNAME));
956 print_as("\n");
957
958 lrm_rsc = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);
959 lrm_rsc = find_xml_node(lrm_rsc, XML_LRM_TAG_RESOURCES, FALSE);
960
961 for (rsc_entry = __xml_first_child(lrm_rsc); rsc_entry != NULL;
962 rsc_entry = __xml_next(rsc_entry)) {
963 if (crm_str_eq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE, TRUE)) {
964 if (operations) {
965 print_rsc_history(data_set, node, rsc_entry);
966
967 } else {
968 const char *rsc_id = crm_element_value(rsc_entry, XML_ATTR_ID);
969 resource_t *rsc = pe_find_resource(data_set->resources, rsc_id);
970
971 if (rsc) {
972 print_rsc_summary(data_set, node, rsc, FALSE);
973 } else {
974 print_as(" %s: orphan\n", rsc_id);
975 }
976 }
977 }
978 }
979 }
980 }
981}
982
983static void
984print_ticket(gpointer name, gpointer value, gpointer data)

Callers 1

print_statusFunction · 0.85

Calls 10

get_object_rootFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
pe_find_node_idFunction · 0.85
crm_element_valueFunction · 0.85
find_xml_nodeFunction · 0.85
print_rsc_historyFunction · 0.85
pe_find_resourceFunction · 0.85
print_rsc_summaryFunction · 0.85

Tested by

no test coverage detected