From 2bbb6aa6f266d4304f968ddee58ab4f7c33d5619 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 11 Oct 2016 14:48:08 +0100 Subject: [PATCH] Add doc for SNMP debug tips (#1831) --- plugins/inputs/snmp/DEBUGGING.md | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 plugins/inputs/snmp/DEBUGGING.md diff --git a/plugins/inputs/snmp/DEBUGGING.md b/plugins/inputs/snmp/DEBUGGING.md new file mode 100644 index 000000000..f357c58b5 --- /dev/null +++ b/plugins/inputs/snmp/DEBUGGING.md @@ -0,0 +1,53 @@ +# Debugging & Testing SNMP Issues + +### Install net-snmp on your system: + +Mac: + +``` +brew install net-snmp +``` + +### Run an SNMP simulator docker image to get a full MIB on port 161: + +``` +docker run -d -p 161:161/udp xeemetric/snmp-simulator +``` + +### snmpget: + +snmpget corresponds to the inputs.snmp.field configuration. + +```bash +$ # get an snmp field with fully-qualified MIB name. +$ snmpget -v2c -c public localhost:161 system.sysUpTime.0 +DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1643) 0:00:16.43 + +$ # get an snmp field, outputting the numeric OID. +$ snmpget -On -v2c -c public localhost:161 system.sysUpTime.0 +.1.3.6.1.2.1.1.3.0 = Timeticks: (1638) 0:00:16.38 +``` + +### snmptranslate: + +snmptranslate can be used to translate an OID to a MIB name: + +```bash +$ snmptranslate .1.3.6.1.2.1.1.3.0 +DISMAN-EVENT-MIB::sysUpTimeInstance +``` + +And to convert a partial MIB name to a fully qualified one: + +```bash +$ snmptranslate -IR sysUpTime.0 +DISMAN-EVENT-MIB::sysUpTimeInstance +``` + +And to convert a MIB name to an OID: + +```bash +$ snmptranslate -On -IR system.sysUpTime.0 +.1.3.6.1.2.1.1.3.0 +``` +