check_3ware_raid
How to use
1 to use this script you have to install firt tw_cli. You can find the source here : http://www.3ware.com/support/download.asp just follow the instructions to compile and deploy it
2 then you just have to run the following command : $ ./check_3ware-raid.pl --help
If you need to use this script with NRPE you just have to do the following steps :
1 allow your user to run the script with the sudo rights. Just add something like that in your /etc/sudoers (use visudo) : nagios ALL=(ALL) NOPASSWD: //check_3ware-raid.pl
2 then just add this kind of line in your NRPE config file : command[check_3ware]=/usr/bin/sudo //check_3ware-raid.pl
3 don't forget to restart your NRPE daemon
Examples :
./check_3ware-raid.pl -P /usr/sbin/tw_cli -a unit_check -p -v -m
DEBUG : action : unit_check, path-tw_cli : /usr/sbin/tw_cli
DEBUG : check if /usr/sbin/tw_cli exists and is executable
DEBUG : warning threshold : 1, critical threshold : 2
DEBUG : controller :
DEBUG : action = unit_check
DEBUG : disk u0/type RAID-1/status OK
DEBUG : disk u1/type RAID-1/status OK
DEBUG : disk u2/type SPARE/status OK
CHECK 3ware RAID - unit_check - OK - 3 unit(s) detected as OK - (u0,RAID-1,OK) (u1,RAID-1,OK) (u2,SPARE,OK) | unitOK=3 unitREBUILD=0 unitNOK=0
Help :
./check_3ware-raid.pl --help
check_3ware-raid.pl version 0.2 by Erwan Labynocle Ben Souiden
This plugin checks state of your physical disks and logical units of a 3ware RAID card.
Usage: check_3ware-raid.pl [-a unit_check|disk_check|all] [-p] [-D "CHECK 3ware RAID - "] [-v] [-m] [-c 2] [-w 1] [-C /c1]
Options:
-h, --help
  Print detailed help screen
-V, --version
  Print version information
-D, --display=STRING
  to modify the output display...
  default is "CHECK 3ware RAID - "
-P, --path-tw_cli=STRING
  specify the path to the tw_cli binary
  default value is /usr/sbin/tw_cli
-a, --action=STRING
  specify the action : unit_check|disk_check
  default is disk_check
  disk_check : display state of all physical disks
  unit_check : display state of all logical unit
  all       : check both disks and units
-C, --controller=STRING
  allow you to specify only one controller to check
  the default behavior is to check each time every controller
-c, --critical=INT
  specify a critical threshold for the number of disks in a non-OK state.
  default is 2
  only for the disk_check action
-w, --warning=INT
  specify a warning threshold for the number of disks in a non-OK state.
  default is 1
  only for the disk_check action
-m, --more
  Print a longer output. By default, the output is not complet because
  Nagios may truncate it. This option is just for you
-p, --perfdata
  If you want to activate the perfdata output
-v, --verbose
  Show details for command-line debugging (Nagios may truncate the output)
Send email to erwan@aleikoum.net if you have questions regarding use of this software. To submit patches or suggest improvements, send email to erwan@aleikoum.net
This plugin has been created by Erwan Labynocle Ben Souiden
Hope you will enjoy it ;)
Special thank
Just want to thank Eric Schultz to help me to improve this little script