#!/usr/bin/perl ## Plugin for Nagios to determine the state of HP SmartArray RAID volume under FreeBSD ## (C) 2008 Pavol SCorp Cierny ## if(!defined($ARGV[0]) || $ARGV[0] eq "") { print "Usage: check_raid \n"; exit; } $txt = `/sbin/camcontrol inquiry $ARGV[0] -D`; if($txt =~ /^pass(\d*): <(.*)>/) { print $2."\n"; if($2 =~ /VOLUME OK/) { exit(0); } else { if($txt ne "") { exit(2); } } } print "Unable to determine RAID status! (Maybe need sudo to root?)\n"; exit(3);