diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-12-11 21:43:36 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-12-11 21:43:36 +0100 |
commit | af2effdf31ca2564232965c726b9366bb78084b6 (patch) | |
tree | d7e60909f1eee704a095d6d2d1abf8e74b259993 /check_snmp_if | |
parent | 7edbc6d8a3d4080595c9dc5b289478e0e989f471 (diff) | |
download | monitoring_custom-af2effdf31ca2564232965c726b9366bb78084b6.tar.gz |
fix snmp if
Diffstat (limited to 'check_snmp_if')
-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" |