From 05186426f9877b714612c3b63d68aeabc126a16a Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 12 Sep 2021 02:21:04 +0200 Subject: check_snmp_if --- check_snmp_if | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/check_snmp_if b/check_snmp_if index bc2ae44..5d56ae3 100755 --- a/check_snmp_if +++ b/check_snmp_if @@ -39,7 +39,7 @@ walk() { } extract_val() { - sed -n 's/.*=\(.*\)/\1/p' | sed -n 's/.*:\s*\(.*\)/\1/p' + sed -n 's/.*=\(.*\)/\1/p' | sed -n 's/.*:\s*\(.*\)/\1/p' | tr -d "\"'" } perfdata() { @@ -89,7 +89,7 @@ else result 3 "No or insufficient authentication info provided" fi -SNMPWALK_RESULT=$(snmpwalk $AUTH "$HOSTNAME" "$MIB_IFOPERSTATUS.$INTERFACE"; exit $?) +SNMPWALK_RESULT=$(walk "$MIB_IFOPERSTATUS.$INTERFACE"; exit $?) RET=$? [ $RET -ne 0 ] && result 3 "snmpwalk failed with code $RET: $SNMPWALK_RESULT" @@ -111,5 +111,4 @@ OUTERRORS=$(walk "$MIB_ERR_OUT.$INTERFACE" | extract_val) extract_val <<< "$SNMPWALK_RESULT" | grep "up\|1" > /dev/null && result 0 "$COMPLETE_NAME is up." - result 2 "$COMPLETE_NAME $INTERFACE is not up: $SNMPWALK_RESULT" -- cgit v1.2.3