aboutsummaryrefslogtreecommitdiff
path: root/check_snmp_if
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-12-11 21:43:36 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-12-11 21:43:36 +0100
commitaf2effdf31ca2564232965c726b9366bb78084b6 (patch)
treed7e60909f1eee704a095d6d2d1abf8e74b259993 /check_snmp_if
parent7edbc6d8a3d4080595c9dc5b289478e0e989f471 (diff)
downloadmonitoring_custom-af2effdf31ca2564232965c726b9366bb78084b6.tar.gz
fix snmp if
Diffstat (limited to 'check_snmp_if')
-rwxr-xr-xcheck_snmp_if4
1 files changed, 2 insertions, 2 deletions
diff --git a/check_snmp_if b/check_snmp_if
index fcc85ae..993722b 100755
--- a/check_snmp_if
+++ b/check_snmp_if
@@ -42,11 +42,11 @@ done
SNMPWALK_RESULT=$(snmpwalk -c "$COMMUNITY" -v 2c "$HOSTNAME" ifOperStatus.$INTERFACE; exit $?)
RET=$?
-[ $RET -ne 0 ] && result 3 "snmwalk failed with code $RET: $SNMPWALK_RESULT"
+[ $RET -ne 0 ] && result 3 "snmpwalk failed with code $RET: $SNMPWALK_RESULT"
[ -z "$SNMPWALK_RESULT" ] && result 2 "No matching entry found."
IFS='=' LINE=($SNMPWALK_RESULT)
-sed -n 's/.*=\(.*\)/\1/p' <<< "$SNMPWALK_RESULT" | grep "up" && result 0 "Interface $INTERFACE is up."
+sed -n 's/.*=\(.*\)/\1/p' <<< "$SNMPWALK_RESULT" | grep "up\|1" > /dev/null && result 0 "Interface $INTERFACE is up."
result 2 "Interface $INTERFACE is not up: $SNMPWALK_RESULT"