Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Red Hat Cluster Suite Check

Rating
2 votes
Favoured:
0
Hits
98912
Files:
FileDescription
check_rhcscheck_rhcs
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
A python script to check the status of a RH cluster and a named service.
This is the base of a script I threw together to check the status of a RH cluster using the XML output from clustat.

It currently support two options:
-s, --service=serviceName
-c, --cluster

To check the overall status of the cluster use the "-c" option which currently checks that cluster status is "Quorate" and also checks the local status of the node as well as checking if rgmanager is running.

To check the state of a service use the "-s serviceName" option. This will check that the service is in a "started" state on any node. Don't use the long name displayed by clustat (ex: service:NFS) instead use the short name (ex: NFS).

Please feel free to update - this is my first python script... so I'm sure it's very rough around the edges.
Reviews (1)
byvrelease, February 19, 2013
Instead of using gethostname():

hostname = socket.gethostname()

to identify a local node and check its status
if node.attributes['name'].value == hostname:

is better use directly:
if node.attributes['local'].value == "1":