Check HP MSA P2000

Bookmark and Share

Current Version
v1
Last Release Date
2012-10-01
Compatible With
  • Nagios 3.x
  • Nagios XI
Owner
E-mail
License
GPL
Hits
18054
This checks the HP P2000 for the status of all parts within the SAN, this includes all Enclosures, Fans, Voltages, Disks and Temperatures. SNMP is not needed for this as it uses the inbuilt API to gather the status and performance counters over HTTP or HTTPS. It can also gather statistical information about disks, volumes, controllers etc.
V1.1 fixes a bug whereby a broken disk may not show up in later Firmwares. In v1.1 multiple API calls are used to determine the health of the SAN. Upgrade to v1.1 as soon as possible.

This checks the HP P2000 for the status of all parts within the SAN, this includes all Enclosures, Fans, Voltages, Disks and Temperatures. SNMP is not needed for this as it uses the inbuilt API to gather the status and performance counters.

The check can also get performance data about about IOPS, Bytes a Second and more by using the API to run statistic commands if the firmware supports it. The commands runs through the API are disk-statistics, controller-statistics, vdisk-statistics and volume-statistics.

The option L is required and is the login string which is a hashed combination of your username and password. The best way to get this auth string is to capture packets when logging in to the storage manager HTTP interface and look for the first HTTP post. You can use fiddler or wireshark to do this.

For performance data set -c option to what performance data you want I.e. disk, controller, volume or vdisk then specify -S for what type of performance data you want I.e. cpu-load, iops, bytes-per-second etc.


Usage:

This script sends HTTP Requests to the specified HP P2000 Array to determine its health
and outputs performance data fo other checks.
Required Variables:
-H Hostname or IP Address
-L Login Information

Optional Variables:
These options are not required. Both critical and warning must be specified together
If warning/critical is specified -t must be specified or it defaults to greaterthan.
-s Set to 1 for Secure HTTPS Connection
-c Sets what you want to do
status - get the status of the SAN
disk - Get performance data of the disks
controller - Get performance data of the controllers
vdisk - Get performance data of the VDisks
volume - Get performance data of the volumes
-S specify the stats to get for performance data. ONLY works when -c is specified
-u Units of measure. What should be appended to performance values. ONLY used when -c specified.
-w Specify Warning value
-C Specify Critical value
-t Specify how critical warning is calculated (DEFAULT greaterthan)
lessthan - if value is lessthan warning/critical return warning/critical
greaterthan - if value is greaterthan warning/critical return warning/critical

Examples
Just get the status of the P2000
./check_p2000_api.php -H 192.168.0.2 -L 948b44579e48f69ce431909719534307

Get the CPU load of the controllers and append % to the output
./check_p2000_api.php -H 192.168.0.2 -L 948b44579e48f69ce431909719534307 -s 1 -c controller -S cpu-load -u "%"

Get the CPU load of the controllers and append % to the output warning if its over 30 or critical if its over 60
./check_p2000_api.php -H 192.168.0.2 -L 948b44579e48f69ce431909719534307 -s 1 -c controller -S cpu-load -u "%" -w 30 -C 60

Setting option -c to anything other than status will output performance data for Nagios to process.
You can find certain stat options to use by logging into SAN Manager through the web interface and
manually running the commands in the API. Some options are iops, bytes-per-second-numeric, cpu-load,
write-cache-percent and others. If using Warning/Critical options specify a stat without any Units
otherwise false states will be returned. You can specify units yourself using -u option.
Reviews (1)
byHanbeeg, December 11, 2012
Great script, thanks!

You can find the full API documentation in this PDF:
http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/c02520779/c02520779.pdf