Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory

rnicksic

Reviews(1)
byrnicksic, February 23, 2017
SNMP Printer Check
I had to add the parameter for CONTEXT (-n) in order to use SNMP v3 with Konica-Minolta bizhub C284 printers.

--- /home/rnicksic/check_snmp_printer 2017-02-23 10:08:16.821478951 -0600
+++ check_snmp_printer 2017-02-23 11:53:04.914467280 -0600
@@ -890,7 +890,7 @@ walk_snmp(){
fi

if [[ $SNMPVERSION = 3 ]]; then
- RESULT_TEXT=`snmpwalk -v $SNMPVERSION $OUTPUT_OPTIONS -u $SNMPUSER -l $PRIVILEGELEVEL -x $PRIVACYPROTOCOL -X $PRIVACYPASSWORD -a $AUTHPROTOCOL -A $AUTHPASSWORD $HOST_NAME $1`
+ RESULT_TEXT=`snmpwalk -v $SNMPVERSION $OUTPUT_OPTIONS -u $SNMPUSER -n $CONTEXT -l $PRIVILEGELEVEL -x $PRIVACYPROTOCOL -X $PRIVACYPASSWORD -a $AUTHPROTOCOL -A $AUTHPASSWORD $HOST_NAME $1`
RESULT_CODE=$?
else
# Check if community was also set
@@ -989,6 +989,10 @@ while test -n "$1"; do
PRIVACYPASSWORD=$2
shift
;;
+ --context|-n)
+ CONTEXT=$2
+ shift
+ ;;
--type|-t) # Assign check to perform
CHECK_TYPE=$(echo "$2" | cut -d " " -f1)
PARAMETER=$(echo "$2" | cut -d " " -f2-)