From b07d99699e0f01024f1ccc7b73782d9df121947d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Mon, 18 Oct 2010 12:26:24 +0000 Subject: [PATCH] --- check_cisco_qos/trunk/check_cisco_qos.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/check_cisco_qos/trunk/check_cisco_qos.sh b/check_cisco_qos/trunk/check_cisco_qos.sh index a25d235..f581e97 100755 --- a/check_cisco_qos/trunk/check_cisco_qos.sh +++ b/check_cisco_qos/trunk/check_cisco_qos.sh @@ -2,10 +2,24 @@ # ./check_cisco_qos.pl -H 10.18.0.114 -C KB816af -w 10 -c 20 -i ALL -m Call_Signaling -CLASSES=`./check_cisco_qos.pl $@ -i ALL -m ALL -d | grep qos-class| awk '{ print $6 }'` +PATH=$PATH:/usr/lib/nagios/plugins/:/usr/lib64/nagios/plugins/:/nagios/usr/lib/nagios/plugins +which check_cisco_qos.pl > /dev/null +if [ $? -gt 0 ]; then + echo "Unknown check_cisco_qos.pl not found in path" + exit 3 +fi + +CLASSES=`check_cisco_qos.pl $@ -i ALL -m ALL -d | grep qos-class| awk '{ print $6 }'` +NUM_CLASSES=`echo $CLASSES |wc -w` +if [ $NUM_CLASSES -lt 1 ]; then + echo "Error running check_cisco_qos.pl" + echo "Command was: check_cisco_qos.pl $@ -i ALL -m ALL -d" + exit 3 +fi + EXIT_CODE=0 for i in $CLASSES ; do - TMP=`./check_cisco_qos.pl $@ -i ALL -m $i` + TMP=`check_cisco_qos.pl $@ -i ALL -m $i` STATUS=$? if [ $STATUS -gt $EXIT_CODE ]; then EXIT_CODE=$STATUS