[Pacemaker] Extracting resource state information from the XML

pskrap pskrap at hotmail.com
Thu Aug 11 07:51:07 EDT 2011


I have a setup with tens of resources over several nodes. The interface that is 
used to administer the system has a page showing all resources, their state and 
which node they are running on.

I can get the information of one resource using 'crm_resource -W -r <rsc>' but 
running this command over and over again for that many resources is far to slow 
for my needs. The crm_mon produced web page is not enough as I need it in a 
customized format. I figured the best way to do this efficiently is to query the 
XML using cibadmin -Q, parse it and get the state of all resources from there in 
one go. 

Unfortunately I am not familiar with the status part of the XML. Is anyone able 
to tell me how i can find the following information in the XML:

- resource state (running, stopped, failed)
- which node the resource is currently running on

More information about the Pacemaker mailing list