Nagios vinum plugin for FreeBSD
This is a small Nagios plugin written in PERL and designed to monitor the state of FreeBSD vinum volumes.
Usage
This plug-in will require root privileges to function correctly, so you may find yourself setting up Nagios or nrpe to execute this plugin via sudo.
Simply speaking, this plugin monitors the status of vinum volumes available on your system. It can be called to monitor multiple volumes in one shot.
Usage: check_vinum myvol mymirror mystripe (Where myvol, mymirror, and mystripe are all vinum volumes)
If all the volumes are in an "up" state, the plugin will return with an OK status. Should one volume happen to not be up or even available, the plugin will go CRITICAL. There are no WARNING events issued by this plugin.
Install the nrpe plug in on your operating system (For FreeBSD, use the port at /usr/ports/net-mgmt/nrpe2), copy the file at /usr/local/etc/nrpe.cfg_sample to /usr/local/etc/nrpe.cfg, and add something like this command definition at the bottom of the file:
command[check_vinum]=/usr/local/libexec/nagios/check_vinum mymirror myraid
(The above example creates a command that will check the status of the volumes "mymirror" and "myraid".)
Next, install the plugin to the nagios plug in directory, and set its permissions (if necessary):-
# cp check_geom /usr/local/libexec/nagios
# chmod 555 /usr/local/libexec/nagios/check_vinum
Edit /etc/rc.conf and add the following line to enable nrpe2.
nrpe2_enable="YES"
Now the daemon can be started at boot time, or manually from /usr/local/etc/rc.d/nrpe2.sh
# /usr/local/etc/rc.d/nrpe2.sh start
On the Nagios side, you can detect that the plugin is working by issuing the follwing command and checking it's output:-
# check_nrpe -H $HOSTADDRESS -c check_vinum
Once that is functioning, it is simply a matter of creating a service.cfg entry on your nagios server and calling the plugin thusly:-
check_command check_nrpe!check_vinum
And that's it!