Skip to content

Instantly share code, notes, and snippets.

@smbambling
Created June 16, 2017 16:05
Show Gist options
  • Save smbambling/743a3809782fe10d3c32eff1e5199678 to your computer and use it in GitHub Desktop.
Save smbambling/743a3809782fe10d3c32eff1e5199678 to your computer and use it in GitHub Desktop.

SNMP Tips

Loading MIBs

Net-SNMP loads MIBs from two locations by default :

$HOME/.snmp/mibs
/usr/local/share/snmp/mibs

Adding/Copying the F5 MIBs into either of these locations will allow you to perform reverse translations and obtain the OID from the SNMP node name

The F5-BIGIP-SYSTEM-MIB can be found in /usr/share/snmp/mibs/ on an F5 device or online (http://www.oidview.com/mibs/3375/F5-BIGIP-SYSTEM-MIB.html)

SNMP Node Name ( Reverse ) Translation

snmptranslate -m +F5-BIGIP-SYSTEM-MIB -IR -On sysGlobalHostMemTotal

The -m flag tell snmptranslate to load that MIB in addition to the system defaults, (the leading '+' plus means "also")

The -IR flags tell snmptranslate to do random access to OID labels for input parsing

The -On flags tell snmptranslate to print OIDs numerically for output display

SNMP OID Translation

snmptranslate -m +F5-BIGIP-SYSTEM-MIB 1.3.6.1.4.1.3375.2.1.1.2.1.45.0

The -m flag tell snmptranslate to load that MIB in addition to the system defaults, (the leading '+' plus means "also")

SNMP Walk Tree and Search

snmpwalk -m +F5-BIGIP-SYSTEM-MIB -v2c -c public 10.2.50.3 .1 | grep -i memoryused

Here you can walk the entire tree and while loading the MIB to display the string values and then search

snmptranslate -m +F5-BIGIP-SYSTEM-MIB -IR -On f5
  .1.3.6.1.4.1.3375

snmpwalk -m +F5-BIGIP-SYSTEM-MIB -v2c -c public 10.2.50.3 f5 | grep -i memoryused
 or
snmpwalk -m +F5-BIGIP-SYSTEM-MIB -v2c -c public 10.2.50.3 .1.3.6.1.4.1.3375 | grep -i memoryused
You can also walk a subset of the tree and search for values

References

http://net-snmp.sourceforge.net/wiki/index.php/TUT:Using_and_loading_MIBS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment