Note; I’ve tested this on Satabeast 1.2, 2 and 2.5 as well as E60, but not all their kit. I’m also assuming you know your way around Nagios, but the core of what’s being done here (using XPath to parse an XML document) is easy to implement in other systems and languages, should you need to.
Nexsan don’t provide an SNMP interface to get stats out of their boxes, but they *do* provide some hidden stats pages that you can access via the admin account. One of the pages is an XML document that provides, amongst other things, basic performance stats. With the help of a plugin from nagios-exchange, check_http_xpath, we can parse this for the information we need.
Be aware that by doing this you’ll be downloading the entire XML each time you run a plugin to check, so you might swamp the management interface. The GUI has been known to crash in earlier versions of the firmware, so I’d recommend being on a later release (that’s just good practice though, right?).
Each controller will need this information checking, of course. Yes, this is a lot of work, and it would be easier if you could get this via a management protocol or SNMP, but we have to work with whats here, so;
Define the Nagios Check commands;
First, CPU
define command{
command_name check_nexsan_cpu_c0
command_line /usr/lib/nagios/plugins/check_http_xpath.pl -H $HOSTADDRESS$ -l ADMIN -a $ARG2$ -u /admin/opstats.asp -c '/nexsan_op_
status/nexsan_perf_status/controller[1]/cpu_percent<=95' -w'/nexsan_op_status/nexsan_perf_status/controller[1]/cpu_percent<=80'
}
This is easily modified to check c1 as well;
define command{
command_name check_nexsan_cpu_c1
command_line /usr/lib/nagios/plugins/check_http_xpath.pl -H $HOSTADDRESS$ -l ADMIN -a $ARG2$ -u /admin/opstats.asp -c '/nexsan_op_
status/nexsan_perf_status/controller[2]/cpu_percent<=95' -w'/nexsan_op_status/nexsan_perf_status/controller[2]/cpu_percent<=80'
}
So from now on I'll only show examples for c0 and leave the rest to you..
Now memory;
define command{
command_name check_nexsan_mem_c0
command_line /usr/lib/nagios/plugins/check_http_xpath.pl -H $HOSTADDRESS$ -l ADMIN -a $ARG2$ -u /admin/opstats.asp -c '/nexsan_op_
status/nexsan_perf_status/controller[1]/memory_percent<=90' -w'/nexsan_op_status/nexsan_perf_status/controller[1]/memory_percent<75'
}
Now it gets a bit tricky, as you define a command to check an RAID array's utilisation, but you don't know how many Arrays the Nexsan has. The way I've done this is with separate host-groups for array 1, 2 etc and add the appropriate host to each host-group until all of them are covered. Not ideal, but it works.
Arrays
define command{
command_name check_nexsan_array_1_load
command_line /usr/lib/nagios/plugins/check_http_xpath.pl -H $HOSTADDRESS$ -l ADMIN -a $ARG2$ -u /admin/opstats.asp -c '/nexsan_op_
status/nexsan_perf_status/array[1]/load_percent<=90' -w'/nexsan_op_status/nexsan_perf_status/array[1]/load_percent<=75'
}
Again, repeat ad nauseum per number of arrays.
Thats the most you can get out of the XML. There is a fibre channel stats page likewise hidden, but thats HTML (and not included in the XML), and it varies per controller, so I'm writing a separate Nagios plugin for each model.
Now define your Nagios Service;
define service{
use generic-service ; defined in generic
hostgroup_name nexsan-c0 ; as per hostgroup
service_description Controller 0 CPU Utilisation ; give description
check_command check_nexsan_cpu_c0!MySecretADMINPassword ; defined commandline
normal_check_interval 10 ; useful time check
servicegroups storage_performance ; which servicegroup
notification_options c,r,w ; useful defaults
contact_groups storageadmins ; who to call
}
Again, lather, rinse repeat for all your Check Commands you defined, for each controller.
Voila! Nagios is now monitoring your Nexsan. Its helpful to also put NagVis on your Nagios setup and get the output being graphed. I'm going to add this to our Cacti installation at work, so will put the code for that up when I write it as well.