[Pacemaker] writing a script

Andrei Borzenkov arvidjaar at gmail.com
Thu Aug 13 04:06:04 UTC 2015



On 12.08.2015 17:18, Michael Böhm wrote:
> 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)" ];
> then
>
> just have a look at "man crm_resource" i'm pretty sure you'll find
> something suitable.
>

"crm resource status <resourcename>" is also possible. But having some 
more script-friendly output would be good.




More information about the Pacemaker mailing list