From cad530a113e3049b1b20d8e1b93e9c486d29720a Mon Sep 17 00:00:00 2001 From: Subhendu Ghosh Date: Sun, 9 Feb 2003 14:20:30 +0000 Subject: new plugins git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@302 f882894a-f735-0410-b71e-b25c423dba1c --- contrib/check_adptraid.sh | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 contrib/check_adptraid.sh (limited to 'contrib/check_adptraid.sh') diff --git a/contrib/check_adptraid.sh b/contrib/check_adptraid.sh new file mode 100644 index 00000000..d7f8d0c3 --- /dev/null +++ b/contrib/check_adptraid.sh @@ -0,0 +1,75 @@ +#! /bin/sh +# +# Modified check_sensors to check the alarm status of an Adaptec 3200S RAID +# controller. +# +# Scott Lambert -- lambert@lambertfam.org +# +# Tested on FreeBSD 4.7 with the adptfbsd_323.tgz package installed. This +# package installs all it's programs into /usr/dpt. +# + +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +PROGNAME=`basename $0` +PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` +REVISION=`echo '$Revision$' | sed -e 's/[^0-9.]//g'` + +. $PROGPATH/utils.sh + +RAIDUTIL_CMD="/usr/dpt/raidutil -A ?" + +print_usage() { + echo "Usage: $PROGNAME" +} + +print_help() { + print_revision $PROGNAME $REVISION + echo "" + print_usage + echo "" + echo "This plugin checks alarm status of Adaptec 3200S RAID controller." + echo "" + support + exit 0 +} + +case "$1" in + --help) + print_help + exit 0 + ;; + -h) + print_help + exit 0 + ;; + --version) + print_revision $PROGNAME $REVISION + exit 0 + ;; + -V) + print_revision $PROGNAME $REVISION + exit 0 + ;; + *) + raidutiloutput=`$RAIDUTIL_CMD 2>&1` + status=$? + if test "$1" = "-v" -o "$1" = "--verbose"; then + echo ${raidutiloutput} + fi + if test ${status} -eq 127; then + echo "RAIDUTIL UNKNOWN - command not found (did you install raidutil?)" + exit -1 + elif test ${status} -ne 0 ; then + echo "WARNING - raidutil returned state $status" + exit 1 + fi + if echo ${raidutiloutput} | egrep On > /dev/null; then + echo RAID CRITICAL - RAID alarm detected! + exit 2 + else + echo raid ok + exit 0 + fi + ;; +esac -- cgit v1.2.3-74-g34f1