Adaptec RAID Monitoring Plugin

From Thomas-Krenn-Wiki
Jump to: navigation, search

The Adaptec RAID Monitoring Plugin can be used to monitor Adaptec Controller RAID sets. The plugin is written in Perl and uses the command line tool arcconf to interact with the controller.

Current Version

The current check_adaptec_raid version can be obtained from GitHub:

Functionalities

The plugin README lists all available checks:

GitHub Support

Questions are answered via GitHub:

Prerequisites

A detailed description on how to install the requirements will follow in the next sections:

  • On the monitored server
    • Install check_adaptec_raid plugin
    • Install arcconf
    • Install libfile-which-perl
    • Add sudoers entry for user nagios to call arcconf without sudo password
    • If NRPE is used a command definition for NRPE
  • On the Icinga server

Installation

Manually

Installing the plugin manually involves copying the file into the directory /usr/lib/nagios/plugins.

:~$ git clone https://github.com/thomas-krenn/check_adaptec_raid.git
Cloning into 'check_adaptec_raid'...
:~$ cd check_adaptec_raid/
:~/check_adaptec_raid$ ls
arcconf_output  check_adaptec_raid  check_adaptec_raid.POD  README  testing.patch
:~/check_adaptec_raid$ sudo cp check_adaptec_raid /usr/lib/nagios/plugins/

The command line utility arcconf can be found for the corresponding adaptec controller on their website: http://www.adaptec.com/en-us/downloads/

TK Ubuntu-Repository

After setting up the Repo - Thomas Krenn Ubuntu Repo - the package nagios-plugins-thomas-krenn installs check_adaptec_raid:

:~$ sudo apt-get install nagios-plugins-thomas-krenn
[...]
Suggested packages:
  arcconf
The following NEW packages will be installed:
  nagios-plugins-thomas-krenn
0 upgraded, 1 newly installed, 0 to remove and 68 not upgraded.
Need to get 0 B/14.9 kB of archives.
After this operation, 82.9 kB of additional disk space will be used.
Selecting previously unselected package nagios-plugins-thomas-krenn.
(Reading database ... 70154 files and directories currently installed.)
Unpacking nagios-plugins-thomas-krenn (from .../nagios-plugins-thomas-krenn_0.1-1_all.deb) ...
Setting up nagios-plugins-thomas-krenn (0.1-1) ...

The suggested package arcconf and libfile-which-perl must be installed also:

:~$ sudo apt-get install arcconf libfile-which-perl
[...]
The following NEW packages will be installed:
  arcconf libstdc++5 libfile-which-perl
[...]

Configuration

The plugin is suited to monitor a host via NRPE as well as a local host. In both cases the plugin has to be installed on the monitored server.

Via NRPE

One the Icinga Server

The host definition defines the command that is called via NRPE on the remote host. The plugin parameters are specified on the remote host afterwards:

define service {
    service_description           adaptec-raid-nrpe
    display_name                  Adaptec RAID
    use                           generic-service
    host_name                     test
    check_command                 check_nrpe_1arg!check_adaptec_raid
}

Attention: In order to use the Call-Home-Service some templates have to be created - cf. Using Call-Home-Service with Icinga or Nagios. Then instead of use generic-service, the line use thomas-krenn-service must be used at service definition!

Using TKmon to configure check_adaptec_raid

The Adaptec raid plugin is already integrated in the TKmon service catalogue. It is sufficient to select "Adaptec RAID via NRPE" when adding a service to a host:

On the monitored Server

The user nagios has to call arcconf without providing a sudo password. Therefore the following sudoers definition is created.

Attention: With CentOS the NRPE daemon runs as user nrpe! Therefore you have to replace nagios with nrpe in the sudoers configuration.

:~$ sudo vi /etc/sudoers.d/check_adaptec_raid 
nagios ALL=(root)NOPASSWD:/sbin/arcconf
:~$ sudo chmod 440 /etc/sudoers.d/check_adaptec_raid 

If the definition is correct, the following command does not ask for a password:

:~$ sudo su nagios --shell /bin/bash
:~$ sudo /sbin/arcconf --version
  | UCLI |  Adaptec by PMC uniform command line interface
  | UCLI |  Version 7.0 (B18781)
  | UCLI |  (C) Adaptec by PMC 2003-2011
  | UCLI |  All Rights Reserved
[...]

A NRPE configuration file specifies the check command that is called if check_adaptec_raid is used via NRPE. This command must be the same as the one on the Icinga side in the host definition.

Notice: With CentOS it may help to specify the script interpretor explicitly, e.g. perl /usr/lib/nagios/plugins/check_lsi_raid -C 0 -p /usr/sbin/storcli.

:~$ sudo vi /etc/nagios/nrpe.d/raid.cfg
command[check_adaptec_raid]=/usr/lib/nagios/plugins/check_adaptec_raid -C 1 -p /sbin/arcconf
:~$ sudo service nagios-nrpe-server restart

Finally a test on the Icinga side checks the correct definitions:

:~$ /usr/lib/nagios/plugins/check_nrpe -H 10.0.0.2 -c check_adaptec_raid
AACRAID OK (Ctrl #1)

Check local RAID

A local check is useful if the Icinga server itself uses an adaptec RAID controller.

Manually

Requirements for a local installation are the plugin, arcconf and the sudoers entry. As a first step an Icinga command definition is created:

:~$ sudo vi /etc/nagios-plugins/config/check_adaptec_raid.cfg
define command {
        command_name    check_adaptec_raid
        command_line    /usr/lib/nagios/plugins/check_adaptec_raid -C '$ARG1$' -p '$ARG2$'
}

A service definition uses this command:

define service{
        use                             generic-service
        host_name                       tkmon
        service_description             adaptec-raid
        check_command                   check_adaptec_raid!1!/sbin/arcconf
}

Example Output

$ sudo ./check_adaptec_raid -vvv
OK (CTR, LD, PD, ZMM)|CTR_Temperature=57;80;90 ZMM_Health=100 ZMM_Temperature=27;60;75 ZMM_Voltage_Present=4938
Used arcconf commands:
- /sbin/arcconf GETCONFIG 1 AD
- /sbin/arcconf GETCONFIG 1 AD
- /sbin/arcconf GETCONFIG 1 LD
- /sbin/arcconf GETCONFIG 1 PD
CTR information:
	- Adaptec ASR8405:
		- Serial No=4B361387273
		- Driver=1.2-0 (30300)
		- Boot Flash=7.5-0 (32033)
		- BIOS Version=7.5-0 (32033)
		- FW Version=7.5-0 (32033)
		- Temperature=57 C/ 134 F (Normal)
		- Defunct drives=0
		- LD devices/Failed/Degraded=2/0/0
LD information:
	- ld0:
		- Block Size of member drives=512 Bytes
		- Bootable=Yes
		- Failed stripes=No
		- Logical device name=Ubuntu
		- Parity space=0 MB
		- Partitioned=Yes
		- Power settings=Disabled
		- Protected by Hot-Spare=No
		- RAID level=Simple_volume
		- Read-cache setting=Disabled
		- Read-cache status=Off
		- Size=76190 MB
		- Status of logical device=Optimal
		- Unique Identifier=67E114A8
		- Write-cache setting=Disabled
		- Write-cache status=Off
		- ld=ld0
	- ld1:
		- Block Size of member drives=512 Bytes
		- Bootable=No
		- Failed stripes=No
		- Logical device name=RAID1
		- Parity space=76200 MB
		- Partitioned=Yes
		- Power settings=Disabled
		- Protected by Hot-Spare=No
		- RAID level=1
		- Read-cache setting=Disabled
		- Read-cache status=Off
		- Size=76190 MB
		- Status of logical device=Optimal
		- Unique Identifier=74A924A8
		- Write-cache setting=Disabled
		- Write-cache status=Off
		- ld=ld1
PD information:
	- pd0:
		- Block Size=512 Bytes
		- FRU=None
		- Firmware=D2010370
		- Model=INTEL SSDSC2BB08
		- NCQ status=Enabled
		- Power State=Full rpm
		- Reported Channel,Device(T:L)=0,4(4:0)
		- Reported ESD(T:L)=2,0(0:0)
		- Reported Location=Enclosure 0, Slot 0
		- Reserved Size=121880 KB
		- S.M.A.R.T.=No
		- S.M.A.R.T. warnings=0
		- SSD=Yes
		- Serial number=CVWL411400W1080KGN
		- State=Online
		- Supported=Yes
		- Supported Power States=Full power,Powered off
		- Total Size=76319 MB
		- Transfer Speed=SATA 6.0 Gb/s
		- Unused Size=64 KB
		- Used Size=76200 MB
		- Vendor=ATA
		- Write Cache=Disabled (write-through)
		- pd=pd0
	- pd1:
		- Block Size=512 Bytes
		- FRU=None
		- Firmware=D2010355
		- Model=INTEL SSDSC2BB08
		- NCQ status=Enabled
		- Power State=Full rpm
		- Reported Channel,Device(T:L)=0,5(5:0)
		- Reported ESD(T:L)=2,0(0:0)
		- Reported Location=Enclosure 0, Slot 1
		- Reserved Size=121880 KB
		- S.M.A.R.T.=No
		- S.M.A.R.T. warnings=0
		- SSD=Yes
		- Serial number=BTWL326403PS080KGN
		- State=Online
		- Supported=Yes
		- Supported Power States=Full power,Powered off
		- Total Size=76319 MB
		- Transfer Speed=SATA 6.0 Gb/s
		- Unused Size=64 KB
		- Used Size=76200 MB
		- Vendor=ATA
		- World-wide name=50015178F365A7FB
		- Write Cache=Disabled (write-through)
		- pd=pd1
	- pd2:
		- Block Size=512 Bytes
		- FRU=None
		- Firmware=D2010355
		- Model=INTEL SSDSC2BB08
		- NCQ status=Enabled
		- Power State=Full rpm
		- Reported Channel,Device(T:L)=0,6(6:0)
		- Reported ESD(T:L)=2,0(0:0)
		- Reported Location=Enclosure 0, Slot 2
		- Reserved Size=121880 KB
		- S.M.A.R.T.=No
		- S.M.A.R.T. warnings=0
		- SSD=Yes
		- Serial number=BTWL326004NP080KGN
		- State=Online
		- Supported=Yes
		- Supported Power States=Full power,Powered off
		- Total Size=76319 MB
		- Transfer Speed=SATA 6.0 Gb/s
		- Unused Size=64 KB
		- Used Size=76200 MB
		- Vendor=ATA
		- World-wide name=50015178F365454E
		- Write Cache=Disabled (write-through)
		- pd=pd2
ZMM information:
		- ZMM_Charge_Level=100
		- ZMM_Health=100
		- ZMM_Status=OK
		- ZMM_Temperature=27
		- ZMM_Voltage_Present=4938

Author: Georg Schönberger

Related articles

GPU Sensor Monitoring Plugin
VMware ESXi Hardware with Nagios or Icinga Monitoring
TKmon