From 4a049dd36aad5015497c704e74b9aea34575848c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Mon, 30 Aug 2010 12:31:21 +0000 Subject: [PATCH] --- check_eva/trunk/check_eva | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/check_eva/trunk/check_eva b/check_eva/trunk/check_eva index 86acee8..6695686 100755 --- a/check_eva/trunk/check_eva +++ b/check_eva/trunk/check_eva @@ -12,13 +12,10 @@ 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` -ERRORCHECK1=`grep -i error /etc/sssu.out| grep -v on_error | wc -l` -ERRORCHECK2=`grep -w operationalstate /etc/sssu.out | wc -l` - SUMMARY=`awk ' $1 == "objectname" { STORAGE=$3 } \ $1 == "operationalstate" { STATE=$3 } \ -$1 == "managementhostname" { print STORAGE, STATE } ' /etc/sssu.out` +$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 }'` @@ -27,30 +24,13 @@ availablestoragespace=`grep availablestoragespace /etc/sssu.out | awk '{ print $ PERFDATA="totalstoragespace=$totalstoragespace usedstoragespace=$usedstoragespace availablestoragespace=$availablestoragespace" if [ "$PROBLEM" -gt 0 ]; then - echo "Warning - HP EVA Requires attention. $SUMMARY | $PERFDATA" + 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 - - - -if [ "$ERRORCHECK1" -gt 0 ]; then - echo "Unknown - failed to run sssu command" - cat /etc/sssu.out - exit 3 -fi - -if [ "$ERRORCHECK2" -lt 1 ]; then - echo "Unknown - Could not retrieve information via sssu" - cat /etc/sssu.out - exit 3 -fi - - - - -echo "OK - HP EVA reports: $SUMMARY | $PERFDATA" +echo "OK, HP EVA reports: $SUMMARY | $PERFDATA" | tr '\n' ' ' +echo echo "EVA state last checked at $LASTCHECK" -grep -E 'operationalstate|operationalstatedetail|objectname|licensestate|systemtype|storagespace' /etc/sssu.out +grep -E 'operationalstate|operationalstatedetail|objectname|licensestate|systemtype|storagespace' /etc/sssu.out