diff options
-rwxr-xr-x | check_snmp_if | 4 |
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" |