summaryrefslogtreecommitdiffstats
path: root/contrib/check_adptraid.sh
diff options
context:
space:
mode:
authorSubhendu Ghosh <sghosh@users.sourceforge.net>2003-02-09 14:20:30 (GMT)
committerSubhendu Ghosh <sghosh@users.sourceforge.net>2003-02-09 14:20:30 (GMT)
commitcad530a113e3049b1b20d8e1b93e9c486d29720a (patch)
treebc347b20542374fb23d0e6742726fc10227d8053 /contrib/check_adptraid.sh
parent38175080b2e7f576d73dbe472f35953c2e189f38 (diff)
downloadmonitoring-plugins-cad530a113e3049b1b20d8e1b93e9c486d29720a.tar.gz
new plugins
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@302 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'contrib/check_adptraid.sh')
-rw-r--r--contrib/check_adptraid.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/contrib/check_adptraid.sh b/contrib/check_adptraid.sh
new file mode 100644
index 0000000..d7f8d0c
--- /dev/null
+++ b/contrib/check_adptraid.sh
@@ -0,0 +1,75 @@
1#! /bin/sh
2#
3# Modified check_sensors to check the alarm status of an Adaptec 3200S RAID
4# controller.
5#
6# Scott Lambert -- lambert@lambertfam.org
7#
8# Tested on FreeBSD 4.7 with the adptfbsd_323.tgz package installed. This
9# package installs all it's programs into /usr/dpt.
10#
11
12PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
13
14PROGNAME=`basename $0`
15PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
16REVISION=`echo '$Revision$' | sed -e 's/[^0-9.]//g'`
17
18. $PROGPATH/utils.sh
19
20RAIDUTIL_CMD="/usr/dpt/raidutil -A ?"
21
22print_usage() {
23 echo "Usage: $PROGNAME"
24}
25
26print_help() {
27 print_revision $PROGNAME $REVISION
28 echo ""
29 print_usage
30 echo ""
31 echo "This plugin checks alarm status of Adaptec 3200S RAID controller."
32 echo ""
33 support
34 exit 0
35}
36
37case "$1" in
38 --help)
39 print_help
40 exit 0
41 ;;
42 -h)
43 print_help
44 exit 0
45 ;;
46 --version)
47 print_revision $PROGNAME $REVISION
48 exit 0
49 ;;
50 -V)
51 print_revision $PROGNAME $REVISION
52 exit 0
53 ;;
54 *)
55 raidutiloutput=`$RAIDUTIL_CMD 2>&1`
56 status=$?
57 if test "$1" = "-v" -o "$1" = "--verbose"; then
58 echo ${raidutiloutput}
59 fi
60 if test ${status} -eq 127; then
61 echo "RAIDUTIL UNKNOWN - command not found (did you install raidutil?)"
62 exit -1
63 elif test ${status} -ne 0 ; then
64 echo "WARNING - raidutil returned state $status"
65 exit 1
66 fi
67 if echo ${raidutiloutput} | egrep On > /dev/null; then
68 echo RAID CRITICAL - RAID alarm detected!
69 exit 2
70 else
71 echo raid ok
72 exit 0
73 fi
74 ;;
75esac