andrew fresh wrote:
I have written a perl script that parses the output from bioctl and
returns it in a format that Nagios can use.
Sweet :-)
check_bioctl is avaliable here:
http://openbsd.somedomain.net/nagios/check_bioctl-1.3.tar.gz
It is useful to me, and so I thought it might be useful to someone else.
I wrote this on OpenBSD 3.9 and tested on Dell PERC 3/DC controllers
using the ami driver. It should work just fine on other versions of
OpenBSD as well as with other cards and drivers. If you do run into
trouble, send me the output from bioctl on the system you are having
trouble with and I can try to help. Patches to fix problems would be
even better.
One thing I ran into is that bioctl needs to run as root to get access
to /dev/bio, even for read only access. Is there a way to query bioctl
without needing root?
No!
Also, in biovar.h, both a raid volume and a disk can be "Offline".
However, I am not sure what that means. Currently it is a WARNING, but
I don't know what status it should be set to.
If 2 or more physical disks of a RAID 5 are offline a volume will be
marked offline as well. An offline RAID 5 is obviously a critical
event. Hope this makes sense since I am not exactly sure what you are
asking.
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/biovar.h?rev=1.25&content-type=text/x-cvsweb-markup
If anyone knows what the "Offline" status means, I would sure like to
know.
An additional useful feature is that you can specify multiple devices to
check in a single check
/usr/local/libexec/nagios/check_bioctl -d ami0 -d ami1
Output is similar to below, except with NAGIOS_OUTPUT set to 1 in the
source (as it usually is) all output is on a single line separated with
<br> and it hides any devices that are OK because Nagios has a limit on
the length of a response.
CRITICAL (1):
ami0 sd1 Degraded
WARNING (1):
ami0 0:8.0 Rebuild <QUANTUM ATLAS10K2-TY184JDA40>
OK (7):
ami0 sd0 Online
ami0 0:0.0 Online <IBM DMVS09M 0220>
ami0 0:1.0 Online <IBM DRVS09D 0140>
ami0 0:3.0 Online <QUANTUM ATLAS10K2-TY184JDA40>
ami0 0:4.0 Online <QUANTUM ATLAS10K2-TY184JDA40>
ami0 0:5.0 Online <QUANTUM ATLAS10K2-TY184JDA40>
ami0 0:2.0 Hot spare <IBM DRVS09D 0140>
I currently configure it something like this:
$ grep check_bioctl /etc/sudoers /etc/nrpe.cfg
/etc/sudoers:_nrpe ALL = NOPASSWD:/usr/local/libexec/nagios/check_bioctl -d
ami0
/etc/nrpe.cfg:command[check_bioctl]=/usr/bin/sudo
/usr/local/libexec/nagios/check_bioctl -d ami0
Also available is check_hw_sensors for checking of sysctl hw.sensors
from Nagios.
http://openbsd.somedomain.net/nagios/
l8rZ,