Home Directory Plugins Hardware Storage Systems RAID Controllers 3Ware Raid Plugin for 32-bit and 64-bit systems

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

3Ware Raid Plugin for 32-bit and 64-bit systems

Rating
7 votes
Favoured:
3
Hits
108125
Files:
FileDescription
check_3ware_raidversion 1.0
check_3ware_raid_1_1version 1.1
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This is a plugin to test the state of 3ware Raid arrays on servers. Works on 32-bit and 64-bit linux servers. Also tells you if your individual disks are not ok. Switches to customize behaviour.
This plugin has been tested on Linux with 8xxx and 9xxx series 3ware Raid controllers.

It requires that you have the tw_cli utility which can be downloaded from http://www.3ware.com/support/download.asp http://www.3ware.com/support/download.asp.

All you have to do is put the plugin and the utility in the same directory and then run the plugin.

You will need to run the plugin as root as this is the only way it can get the details on the RAID arrays. This is not my design but that of 3ware. Use sudo to run the plugin as the nagios user with the privileges of root.

Put the following line in your /etc/sudoers file to allow the nagios user to run the plugin as root:

nagios ALL=(ALL) NOPASSWD: /path/to/check_3ware_raid

Run the plugin as follows:

sudo /path/to/check_3ware_raid
RAID OK: All arrays OK [2 arrays checked on 1 controller]


or more informative messages if something is happening:

sudo /path/to/check_3ware_raid
RAID OK: All arrays OK - Array 2 status is 'VERIFYING'(RAID-5 on adapter 0) - Verify Status: 92% complete [3 arrays checked on 1 controller]


There are lots of switches to customize what to test, whether to warn on rebuilds, verifies, initializing, whether to print summary information on how many arrays, disks and controllers were checked etc. See --help for full details.

Can check all disks attached to 3ware controllers as well. By default it checks all arrays and then all disks, but you can select just one or the other if you prefer.

Summary also tells you at a glance how many arrays or disks have problems, how many arrays and disks were checked on how many controllers. Can switch this on or off with -n switch.

use -vvv to increase verbosity and get raw details on all the arrays.

This runs straight on both 32-bit and 64-bit systems and all modern linux distros that have Python. NOTE: REQUIRES PYTHON 2.4 OR GREATER.

If running on a 64-bit system, make sure you get the 64-bit 3ware utility tw_cli and name it tw_cli_64 as this is the name the plugin looks for on 64-bit systems.

This has been tested and works on servers of both x86 and amd64/x86_64 architectures and across distros.
Support

If you have any issues, contact me at hpsekhon(AT)googlemail.com

Version 1.1 is an minor update to support 9690sa-4i4e 3ware controllers but is not as thoroughly tested.
Reviews (6)
bydavidak, July 7, 2014
1 of 1 people found this review helpful
cp tw_cli /usr/sbin/tw_cli
bystefanlasiewski, March 26, 2013
1 of 1 people found this review helpful
Seems pretty good, and the best out the ones that I have tested. However, the following requirement is confusing:

> If running on a 64-bit system, make sure you get
> the 64-bit 3ware utility tw_cli and name it
> tw_cli_64 as this is the name the plugin looks
> for on 64-bit systems.

It shouldn't matter if the utility is named either tw_cli or tw_cli_64, it will function the same. I don't understand why this script needs the file to be renamed to tw_cli_64, when 'tw_cli' works just fine. I pulled this part out of the script, as the required rename made our configuration management more complicated.
Recently, our command was faced with the new controllers of the company 3ware.
And we had to redo the script because in new version of the TW_?LI output changed.


Version of TW_CLI:
Copyright (c) 2011 LSI
LSI/3ware CLI (version 2.00.11.020)

# lspci | grep RAID
05:00.0 RAID bus controller: 3ware Inc 9750 SAS2/SATA-II RAID PCIe (rev 05)


And the result of command DIFF with old 1.1 version:

239c239,244
#print "test_drives result: [
%s
]" % lines
> controllers = []
> for line in lines:
> if line.split() == "":
> controlers.append(line.split()[0])
>
Here's a solution to the problem mentioned above: the "tw_cli(_64) show" command returns information about the enclosure as well as the controller. I don't think the script knows how to handle that. Changing line 238:
lines = run("show")
to:
lines = run("info")
just returns information about the controller. The script then is able to work properly.
(using check_3ware_1_1 with a 9650SE-8ch)
get this when I run it:


./check_3ware_raid
Traceback (most recent call last):
File "./check_3ware_raid", line 451, in
main()
File "./check_3ware_raid", line 444, in main
result, output = test_all(verbosity, warn_true, no_summary, show_drives)
File "./check_3ware_raid", line 139, in test_all
drive_result, drive_message = test_drives(verbosity, no_summary)
File "./check_3ware_raid", line 239, in test_drives
controllers = [ line.split()[0] for line in lines ]
IndexError: list index out of range

------------------

dunno if it's because of my controlled number being so high

# tw_cli show

Ctl Model (V)Ports Drives Units NotOpt RRate VRate BBU
------------------------------------------------------------------------
c4 9690SA-4I 24 24 3 1 5 1 OK
byshop.ren@gmail.com, October 8, 2009
1 of 2 people found this review helpful
Using Nagios 3.0.2
NRPE 2.12
Nagios Plugins 1.4.13

No problems with script or status updates. To make your documentation more complete, you should add:

Many distros default tty requirements for sudo. Edit your /etc/sudoers config by simply editing it as follows:

#Defaults requiretty