sissasraidmgr
command one can easily maintain the SAS adapter and thus implement a check for Nagios/Icinga.sissasraidmgr
command can be found in the man page (“man sissasraidmgr
”).
The current battery state for the device sissas0
for instance can be queried as follows:
$ /usr/bin/sissasraidmgr -M -o0 -l sissas0 RAID Adapter . . . . . . . . . . . . . : sissas0 Battery Type . . . . . . . . . . . . . : Lithium Ion (LiIon) Battery State . . . . . . . . . . . . . : No battery warning/error Power-on time (days) . . . . . . . . . : 367 Adjusted power-on time (days) . . . . . : 367 Estimated time to warning (days) . . . : 605 Estimated time to error (days) . . . . : 696 Concurrently maintainable battery pack. : No Battery pack can be safely replaced . . : No
Based on that information I have implemented a check for the remaining days of the battery pack of the specified adapter:
Usage: check_ibm_sissas.sh [-h] -d <sissas-device> -w <warn> -c <crit> -h display help -d SISSAS RAID Adapter to check (e.g., sissas0) -w Warning threshold (in days) -c Critical threshold (in days)
The check_ibm_sissas.sh
script can be downloaded here:
check_ibm_sissas.sh
Please note:
Running /usr/bin/sissasraidmgr
requires root privileges. As nrpe
does not run as root you need to implement sudo
for it!
Check out this article here on how to do it.
Once you have transferred the check_ibm_sissas.sh
script to your plugins directory and implemented sudo
, you define appropriate services for it on your Icinca/Nagios host.
# Define a service to check the state of the battery of the SIS SAS RAID # adapter sissas0 on the remote machine. define service { use generic-service servicegroups NRPE-Checks host_name <HOSTNAME> service_description Battery state of SIS SAS RAID Adapter sissas0 check_command check_nrpe!check_ibm_sissas0 }
Similar if you have more than one IBM SIS SAS RAID adapter you just add additional services:
# Define a service to check the state of the battery of the SIS SAS RAID # adapter sissas1 on the remote machine. define service { use generic-service servicegroups NRPE-Checks host_name <HOSTNAME> service_description Battery state of SIS SAS RAID Adapter sissas1 check_command check_nrpe!check_ibm_sissas1 }
<HOSTNAME>
refers to the name of the host for which the check should be implemented and the name of your service group for NRPE checks might be different as well.
In your nrpe.cfg
file (typically located in /etc/nagios
or /etc/icinga
) you have to add the following checks (for devices sissas0
and sissas1
). The parameters for the number of days for the critical (-c
) and warning threshold (-w
) are hardcoded as passing parameters to NRPE is a potential security hole. PLUGINS_DIR
refers to the absolute path of the check_ibm_sissas.sh
script.
command[check_ibm_sissas0]=PLUGINS_DIR/check_ibm_sissas.sh -d sissas0 -c 20 -w 10 command[check_ibm_sissas1]=PLUGINS_DIR/check_ibm_sissas.sh -d sissas1 -c 20 -w 10