I’ve recently spent some time working with Pacemaker, and ended up with an interesting collection of XPath snippets that I am publishing here for your use and/or amusement.
Check if there are any inactive resources
pcs status xml |
xmllint --xpath '//resource[@active="false"]' - >&/dev/null &&
echo "There are inactive resources"
This selects any resource (//resource) in the output of pcs status xml that has the attribute active set to false. If there
are no matches to this query, xmllint exits with an error code.