Check geom - NRPE gmirror and friends check: Difference between revisions

From TykWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 21: Line 21:
</pre>
</pre>


Of course, if the gmirror is called something else, change the line accordingly. I then add the host to the group gmirror-servers on the nagios server, which just tells it to run the check check_nrpe2!check_geom on all members of the group.
Of course, if the gmirror is called something else, change the line accordingly.  
 
 
Define a service on the Nagios server, in ''/usr/local/etc/nagios/objects/services.cfg'':
<pre>
define service{
        use                            generic-service
        hostgroup_name                  geom-servers
        service_description            nrpe_check_geom
        check_command                  check_nrpe2!check_geom
}
</pre>
 
I then add the host to the group geom-servers on the nagios server, which just tells it to run the check check_nrpe2!check_geom on all members of the group.




Line 36: Line 49:
</pre>
</pre>


I then add the host to the group gmirror-servers on the nagios server, which just tells it to run the check check_nrpe2!check_gmirror on all members of the group.
Define a service on the Nagios server, in ''/usr/local/etc/nagios/objects/services.cfg'':
<pre>
define service{
        use                            generic-service
        hostgroup_name                  gmirror-servers
        service_description            nrpe_check_gmirror
        check_command                  check_nrpe2!check_gmirror
}
</pre>
 
I then add the host to the hostgroup gmirror-servers on the nagios server.

Revision as of 10:23, 16 January 2010

It is possible to check the status of gmirror with Nagios and NRPE using the following port:

$ cat /usr/ports/net-mgmt/nagios-geom/pkg-descr
This is a small Nagios plugin written in PERL and designed to monitor
the state of FreeBSD GEOM devices (specifically mirrors and striped
volumes) from Nagios.

WWW: http://www.geocities.com/ntb4real/proj/geom.htm

Install the port:

sudo portmaster /usr/ports/net-mgmt/nagios-geom/

Add the following line to /usr/local/etc/nrpe.cfg:

command[check_geom]=/usr/local/libexec/nagios/check_geom mirror gm0

Of course, if the gmirror is called something else, change the line accordingly.


Define a service on the Nagios server, in /usr/local/etc/nagios/objects/services.cfg:

define service{
        use                             generic-service
        hostgroup_name                  geom-servers
        service_description             nrpe_check_geom
        check_command                   check_nrpe2!check_geom
}

I then add the host to the group geom-servers on the nagios server, which just tells it to run the check check_nrpe2!check_geom on all members of the group.


Read on for a way to do this without the port, should you want to:

I found a simple script to monitor the status of gmirror on a server in nagios. I found it on this page, the usual thanks to Søren Klintrup for making it available to the public. I do the following to make it work on an existing NRPE installation:

sudo fetch -o /usr/local/libexec/nagios/check_gmirror http://www.klintrup.dk/soren/gmirror/check_gmirror.sh
sudo chmod +x /usr/local/libexec/nagios/check_gmirror
sudo ee /usr/local/etc/nrpe.cfg
...and add "command[check_gmirror]=/usr/local/libexec/nagios/check_gmirror" in the command section near the bottom...
sudo /usr/local/etc/rc.d/nrpe2 restart

Define a service on the Nagios server, in /usr/local/etc/nagios/objects/services.cfg:

define service{
        use                             generic-service
        hostgroup_name                  gmirror-servers
        service_description             nrpe_check_gmirror
        check_command                   check_nrpe2!check_gmirror
}

I then add the host to the hostgroup gmirror-servers on the nagios server.