mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-05 10:03:45 +01:00
check_eva plugin added
This commit is contained in:
parent
1c0dcdeaf0
commit
3513866837
BIN
check_eva/trunk/bin/sssu_linux_ia64
Executable file
BIN
check_eva/trunk/bin/sssu_linux_ia64
Executable file
Binary file not shown.
BIN
check_eva/trunk/bin/sssu_linux_x64
Executable file
BIN
check_eva/trunk/bin/sssu_linux_x64
Executable file
Binary file not shown.
BIN
check_eva/trunk/bin/sssu_linux_x86
Executable file
BIN
check_eva/trunk/bin/sssu_linux_x86
Executable file
Binary file not shown.
35
check_eva/trunk/check_eva
Executable file
35
check_eva/trunk/check_eva
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
BODYFILE=/tmp/check_eva.body
|
||||
LASTCHECK=`ls -la /etc/sssu.out | awk ' { print $6,$7,$8 }'`
|
||||
COMMANDFILE="/etc/nagios/check_eva.sssu"
|
||||
|
||||
|
||||
if [ ! -f $COMMANDFILE ]; then
|
||||
echo "Error, could not find commandfile $COMMANDFILE"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
/usr/local/sbin/sssu "file $COMMANDFILE" |grep -v PASSWORD > /etc/sssu.out
|
||||
|
||||
PROBLEM=`grep -w operationalstate /etc/sssu.out |grep -v good |wc -l`
|
||||
|
||||
SUMMARY=`awk ' $1 == "objectname" { STORAGE=$3 } \
|
||||
$1 == "operationalstate" { STATE=$3 } \
|
||||
$1 == "managementhostname" { print STORAGE, STATE } ' /etc/sssu.out`
|
||||
|
||||
totalstoragespace=`grep totalstoragespace /etc/sssu.out | awk '{ print $3 }'`
|
||||
usedstoragespace=`grep usedstoragespace /etc/sssu.out | awk '{ print $3 }'`
|
||||
availablestoragespace=`grep availablestoragespace /etc/sssu.out | awk '{ print $3 }'`
|
||||
|
||||
PERFDATA="totalstoragespace=$totalstoragespace usedstoragespace=$usedstoragespace availablestoragespace=$availablestoragespace"
|
||||
|
||||
if [ "$PROBLEM" -gt 0 ]; then
|
||||
echo "Warning, HP EVA Requires attention. $SUMMARY | $PERFDATA"
|
||||
echo "EVA state last checked at $LASTCHECK"
|
||||
grep -E 'operationalstate|operationalstatedetail|objectname|licensestate|systemtype|storagespace' /etc/sssu.out
|
||||
exit 1
|
||||
fi
|
||||
echo "OK, HP EVA reports: $SUMMARY | $PERFDATA"
|
||||
echo "EVA state last checked at $LASTCHECK"
|
||||
grep -E 'operationalstate|operationalstatedetail|objectname|licensestate|systemtype|storagespace' /etc/sssu.out
|
||||
|
3
check_eva/trunk/check_eva.sssu
Normal file
3
check_eva/trunk/check_eva.sssu
Normal file
@ -0,0 +1,3 @@
|
||||
set option on_error=continue
|
||||
select manager commandview USERNAME=administrator PASSWORD=Z0rglu66
|
||||
ls system full
|
Loading…
Reference in New Issue
Block a user