CRM resources monitoring has other result then expected

Hi Andreas,

How did it go with the XML output?

I was checking the code again and begin searching for “num_resources” and “inventory_heartbeat_crm_resources”. Because this is the variable that is used to create dictionary with all the resource(s) in it. The weard thing is that this is the only code that does something with the status of the resource

def inventory_heartbeat_crm_resources(info):
# Full list of resources:
# Resource Group: group_slapmaster
# resource_virtip1 (ocf::heartbeat:IPaddr): Started mwp
# resource_virtip2 (ocf::heartbeat:IPaddr): Started mwp
# resource_pingnodes (ocf::heartbeat:pingd): Started mwp
# resource_slapmaster (ocf::heartbeat:OpenLDAP): Started mwp
# resource_slapslave (ocf::heartbeat:OpenLDAP): Started smwp
inventory =
settings = host_extra_conf_merged(host_name(), inventory_heartbeat_crm_rules)
for name, resources in heartbeat_crm_parse_resources(info).iteritems():
# In naildown mode only resources which are started somewhere can be
# inventorized
if settings.get(‘naildown_resources’, False) and resources[0][2] != ‘Stopped’:
inventory.append((name, ‘“%s”’ % resources[0][3]))
else:
inventory.append((name, None))
return inventory