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