[Pacemaker] Monitor a resource without the cluster reacting to the result...

Dominik Klein dk at in-telegence.net
Wed Mar 25 02:52:03 EDT 2009


foxycode at yahoo.com wrote:
> I've been wanting this for some time now and expecting pacemaker would include it in it's newer versions. But I've checked the latest pacemaker 1.0 distribution fresh of the day, and unfortunately have found nothing in it indicating if this is possible.
> 
> - Running a HAv2 or Openais cluster,
> - with a valid configured resource instance,
> - whether that resource is running properly, or not running at all, or limping on 3 or less legs,
> - under the 'root' account,
> - from the shell of a node in that cluster,
> 
> .... what command should I type to cause the cluster to perform a "monitor" operation at a specific check level on that resource, and return the appropriate OCF status of the operation, *without* the cluster reacting like triggering a failover ?
> 
> I'd love to see something like:
> 
> # crm_resource -m check_level resource_id
> ..
> < everything 'echo'ed by the monitor operation >
> ..
> Resource 'resource_id' is (running normally / in a failed or undeterminable state / cleanly stopped).
> #
> 
> .... and $? holding the OCF_status of the monitor operation.

This should be possible:

export OCF_ROOT=/usr/lib/ocf
export OCF_RESKEY_<your_variable>=<your_value>
export OCF_RESKEY_<your_variable2>=<your_value2>
$OCF_ROOT/resource.d/<your_provider>/<your_script> monitor
echo $?

What's your use case though? Why do you need this and what for? Do you
not "trust" the cluster?

> And eventually ...
> 
> # crm_resource -m check_level -h comma-separated-host-id-list resource_id
> 
> 
> And BTW, exactly what criteria does crm_resource -W' uses to say if a resource is running or not ?

Its current status as known by the cluster? This should be based on the
last op on this resource and its returncode.

Regards
Dominik




More information about the Pacemaker mailing list