Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check Corosync Rings
0.2
2011-01-05
- Nagios 3.x
GPL
109433
File | Description |
---|---|
check_corosync_rings_v0_2 | Check Corosync Rings Perl script |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Checks the number of Corosync rings running and their status. Only runs on local host so I suggest you use NRPE if nagios isn't local.
With -r option can specify the expected number of rings although this is optional and not required.
If corosync isn't installed in /usr/sbin or sudo in /usr/bin then script will need editing see comments in script.
NOTE:- Requires Perl 5.8 or higher & the Perl Module Nagios::Plugin.
Nagios user will need sudo access - suggest adding line below to sudoers
nagios ALL=(ALL) NOPASSWD: /usr/sbin/corosync-cfgtool -s
In sudoers if requiretty is on (off state is default) you will also need to add the line below
Defaults:nagios !requiretty
Version History
v0.1 05/01/2011
v0.2 31/10/2011 - additional crit when closing the file handle and additional comments added
With -r option can specify the expected number of rings although this is optional and not required.
If corosync isn't installed in /usr/sbin or sudo in /usr/bin then script will need editing see comments in script.
NOTE:- Requires Perl 5.8 or higher & the Perl Module Nagios::Plugin.
Nagios user will need sudo access - suggest adding line below to sudoers
nagios ALL=(ALL) NOPASSWD: /usr/sbin/corosync-cfgtool -s
In sudoers if requiretty is on (off state is default) you will also need to add the line below
Defaults:nagios !requiretty
Version History
v0.1 05/01/2011
v0.2 31/10/2011 - additional crit when closing the file handle and additional comments added
Reviews (2)
Dave, any ideas?
When I run it via command line, works like a charm:
[root@localhost ~]# ./check_corosync_rings
check_cororings OK - ring 0 OK
nrpe is running on client as "nrpe" user:
[root@localhost ~]# grep ^nrpe_user /etc/nagios/nrpe.cfg
nrpe_user=nrpe
I put: nrpe ALL=(ALL) NOPASSWD: /usr/sbin/corosync-cfgtool -s
both in nrpe.cfg file and sudoers file.
I can run command with nrpe user:
[root@localhost ~]# su - nrpe
-sh-3.2$ /usr/bin/sudo /usr/sbin/corosync-cfgtool -s
Printing ring status.
Local node ID -1425773046
RING ID 0
id = 10.110.4.171
status = ring 0 active with no faults
When I run via check_nrpe from nagios server, I get:
[root@nagios ~]# /usr/local/groundwork/nagios/libexec/check_nrpe -H cl1 -c check_coro_rings
check_cororings CRITICAL - No Rings Found
Any ideas? I'm at wits. Can't think of what else to look at.
Thanks.
When I run it via command line, works like a charm:
[root@localhost ~]# ./check_corosync_rings
check_cororings OK - ring 0 OK
nrpe is running on client as "nrpe" user:
[root@localhost ~]# grep ^nrpe_user /etc/nagios/nrpe.cfg
nrpe_user=nrpe
I put: nrpe ALL=(ALL) NOPASSWD: /usr/sbin/corosync-cfgtool -s
both in nrpe.cfg file and sudoers file.
I can run command with nrpe user:
[root@localhost ~]# su - nrpe
-sh-3.2$ /usr/bin/sudo /usr/sbin/corosync-cfgtool -s
Printing ring status.
Local node ID -1425773046
RING ID 0
id = 10.110.4.171
status = ring 0 active with no faults
When I run via check_nrpe from nagios server, I get:
[root@nagios ~]# /usr/local/groundwork/nagios/libexec/check_nrpe -H cl1 -c check_coro_rings
check_cororings CRITICAL - No Rings Found
Any ideas? I'm at wits. Can't think of what else to look at.
Thanks.
Owner's reply
In sudoers if requiretty is on (off state is default) you will also need to add the line below
Defaults:nagios !requiretty
bydavebean, January 11, 2011
Checking corosync ring status is essential in any Pacemaker cluster and this plugin just does what it says on th lid - thanks Phil!