[Pacemaker] writing a script

Michael Böhm dudleyperkins at gmail.com
Wed Aug 12 10:18:21 EDT 2015

2015-08-12 15:45 GMT+02:00 Karl Rößmann <K.Roessmann at fkf.mpg.de>:

> Hi,
> is there an easy way to determine in a script (bash or python) whether
> a CRM Resource (Xen Domain) is running or not ?

We query the location of a resource in bash with this:

if [ ! "$(/usr/sbin/crm_resource -Q -r resourcename -W)" = "$(hostname)" ];

just have a look at "man crm_resource" i'm pretty sure you'll find
something suitable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20150812/dc3b61d6/attachment-0003.html>

More information about the Pacemaker mailing list