Check 3ware-RAID with bloonix via a nagios plugin

There exists no plugin in Bloonix to check the status of 3ware RAID devices and units. But it provides a simple way to include external scripts such as nagios plugins.

This is done via the plugin Simple.Script. You can’t produce any graphs with it, but can run simple scripts with according exit codes to signal the status for a check.

So what we need at first is a script which can provide the afformentioned functionality – and we just use one for nagios: check_3ware-raid.pl

Download the script and save it in the ‘simple-plugins’ directory of bloonix (‘/usr/lib/bloonix/simple-plugins’). Create the directory, if it does not exist.

The script will use the ‘tw_cli’ command from the cli-package. The cli-package can be found here (thanks to THOMAS KRENN) and should be installed and working.

Because of the use of ‘tw_cli’ we need to run our nagios script with root privileges – so create a sudo configuration for bloonix and save it in ‘/etc/bloonix/agent/conf.d/check_3ware-raid.conf’:

use_sudo check_3ware-raid.pl

 

And create a sudo-conf for sudo itself and save it to ‘/etc/sudoers.d/check_3ware-raid’:

bloonix ALL=(ALL) NOPASSWD:/usr/lib/bloonix/simple-plugins/check_3ware-raid.pl

 

Thats all for the server-configuration. The next step is to configure it in bloonix and .. well, run it šŸ™‚

Add a new service to the prepared host and use the ‘Simple.Script’ plugin. Call it for example ‘3ware RAID unit check’. As command use the following one (be sure to replace ‘/usr/local/sbin/tw_cli’ with the path to your ‘tw_cli’-binary):

check_3ware-raid.pl -P /usr/local/sbin/tw_cli -a unit_check -m

 

This check will give you an ‘OK’ if the status of all units on your host is ‘OK’.

Another check you can do to test the status of all disks with another ‘Simple.Script’ would be:

check_3ware-raid.pl -P /usr/local/sbin/tw_cli -a disk_check -m -w 1 -c 1

 

All this was tested on Debian Jessie and Wheezy without any greater problems.

Well, one issue exists in the shown conig: The check ‘3ware RAID unit check’ will produce a warning along with a running ‘VERIFY’ of the controller. If it’s to annoying you have to fix it in check_3ware-raid.pl or schedule a maintenance in bloonix.

Leave a Reply