This is a simple Nagios plugin to monitor the state of RAID arrays on 3ware/LSI RAID cards, using 3ware's
tw_cli utility, which you can download from the 3ware/LSI site (see below).
The plugin automatically determines which 3ware/LSI RAID controller cards are present, and which RAID arrays are configured, and checks the status of each.
This means it can happily support monitoring of multiple controller cards and RAID arrays, and does not need to be told which card number / unit number to monitor - it will just Do The Right Thing.
Besides the obvious (Nagios/NRPE, Perl, and and the
Monitoring::Plugin module from CPAN), you'll also need 3ware's
tw_cli utility from 3ware/LSI
You can download tw_cli from the 3ware (now LSI) website, for instance:
Linux (32 bit): http://www.preshweb.co.uk/downloads/tw_cli-linux-x86-9.5.3.tgz
It appears to be compatible with most cards, so you don't have to pick the specific card you have from the list.
Extract the tarball, and you'll find the
tw_cli util and man pages. Make
tw_cli executable (
chmod +x tw_cli) then move it to
You probably don't want to be running your Nagios plugins as root. However, tw_cli needs to run as root. So, this script uses sudo to execute tw_cli as root.
You'll need to allow this to happen with no password. For security, I'd only allow the nagios user to run the tw_cli command - add something like this to the
nagios ALL= NOPASSWD: /usr/local/sbin/tw_cli
By default, this plugin expects to find the
tw_cli binary in your $PATH. If you can run
sudo tw_cli yourself and get output, it should work. However, if you need to, you can provide the path to the tw_cli binary using the
--tw_cli option, e.g.:
This may be a good idea anyway, to ensure that the binary that the plugin executes (as root, remember!) is the one you expect, and not some other binary/script named
tw_cli which appeared in some other directory earlier in your $PATH.
CONTRIBUTING / NEW VERSIONS
This plugin is developed on GitHub at:
Patches / bug reports / feedback welcome.
David Precious <email@example.com>