[Linux-cluster] Monitoring services/customize failure criteria
jstoner at opsource.net
Wed Sep 10 17:58:19 UTC 2008
> I am still a bit unclear about how/where the cluster software
> monitors a
> resource I have added.
/usr/share/cluster has the shell scripts used to manage resources,
> I have added a script resource that
> points to the
> init script of apache.
The Script resource is a generic resource (as opposed to the more
specific mysql, nfs, ip, file system, etc. resources.) The script
identified in the <script> section is responsible for properly starting,
stopping and verifying the resource is functioning properly. The script
needs to conform to LSB + OCF RA API draft specifications. This means a
script *must* accept as parameters, at a minimum for use with cluster
services, start, stop and status. These script must exit with 0 for
success and a non-zero value for any non-success condition (error,
warning, got up on the wrong side of the bed, whatever.)
> however I am not sure if it would do this for all scripts
Yes, it will.
> what if I use a custom script that does not require a
> start/stop parameter.
Only you can answer that since it's your script. I can't vouch for the
integrity of your cluster.
> How can I customize "failure criteria" for a cluster resource?
If you are using a Script resource, the script will get called with a
'status' parameter. It is totally up to you how you validate the
resource. Using Apache as an example, you can check for a pid file,
check that at least one httpd process shows up in the process list, open
a socket connection to the proper port to make sure it's listening, send
a complete HTTP request to httpd and parse the output - the
possibilities are many. It's your decision how you want to do the
"Your Success is Our Success"
More information about the Linux-cluster