User Tools

Site Tools


checking_the_battery_state_of_an_ibm_sis_sas_adapter

Checking the battery state of an IBM SIS SAS adapter

  • If you have a system with an IBM SIS SAS (Serial Attached SCSI) RAID (Redundant Array of Independent Disks) controller that contains a rechargeable battery one day you will be faced with the situation that this battery must be replaced.
  • With the help of the sissasraidmgr command one can easily maintain the SAS adapter and thus implement a check for Nagios/Icinga.
  • More information about the 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.

service-ibm-sissas0.cfg
  1. # Define a service to check the state of the battery of the SIS SAS RAID
  2. # adapter sissas0 on the remote machine.
  3.  
  4. define service {
  5. use generic-service
  6. servicegroups NRPE-Checks
  7. host_name <HOSTNAME>
  8. service_description Battery state of SIS SAS RAID Adapter sissas0
  9. check_command check_nrpe!check_ibm_sissas0
  10. }

Similar if you have more than one IBM SIS SAS RAID adapter you just add additional services:

service-ibm-sissas1.cfg
  1. # Define a service to check the state of the battery of the SIS SAS RAID
  2. # adapter sissas1 on the remote machine.
  3.  
  4. define service {
  5. use generic-service
  6. servicegroups NRPE-Checks
  7. host_name <HOSTNAME>
  8. service_description Battery state of SIS SAS RAID Adapter sissas1
  9. check_command check_nrpe!check_ibm_sissas1
  10. }

<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.

nrpe.cfg snippet
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
checking_the_battery_state_of_an_ibm_sis_sas_adapter.txt · Last modified: 2018/12/19 12:53 (external edit)