Friday, January 20, 2012

Debian – SNMPWALK with MIB lookups

Just a quick reference to get a Debian server to be able to do MIB lookups. When running snmpwalk out of the box will not use MIB lookups due to licensing issue.

snmpwalk -c public -v 1 192.168.1.1

iso.3.6.1.2.1.6.1.0 = INTEGER: 1
iso.3.6.1.2.1.6.2.0 = INTEGER: 50000
iso.3.6.1.2.1.6.3.0 = INTEGER: 3200000
iso.3.6.1.2.1.6.4.0 = INTEGER: -1
iso.3.6.1.2.1.6.5.0 = Counter32: 1993
iso.3.6.1.2.1.6.6.0 = Counter32: 13648696
iso.3.6.1.2.1.6.7.0 = Counter32: 0
iso.3.6.1.2.1.6.8.0 = Counter32: 686
iso.3.6.1.2.1.6.9.0 = Gauge32: 1
iso.3.6.1.2.1.6.10.0 = Counter32: 138464739
iso.3.6.1.2.1.6.11.0 = Counter32: 85732550
iso.3.6.1.2.1.6.12.0 = Counter32: 1530

Below we are updating our source list to allow for non-free packages. If you already have security source you can just add non-free to the end.

vi /etc/apt/sources.list

deb http://security.debian.org/ squeeze/updates main non-free
deb-src http://security.debian.org/ squeeze/updates main non-free



Install modules for snmp and snmp mibs.




apt-get update



apt-get install snmp snmp-mibs-downloader




You also need to comment out the one line in snmp.conf file. Just add a # before the mibs:




vi /etc/snmp/snmp.conf



#mibs :




Now when you do a snmpwalk you should get results like below




snmpwalk -c public -v 1 192.168.1.1



TCP-MIB::tcpRtoMin.0 = INTEGER: 50000 milliseconds

TCP-MIB::tcpRtoMax.0 = INTEGER: 3200000 milliseconds


TCP-MIB::tcpMaxConn.0 = INTEGER: -1


TCP-MIB::tcpActiveOpens.0 = Counter32: 1993


TCP-MIB::tcpPassiveOpens.0 = Counter32: 13648419


TCP-MIB::tcpAttemptFails.0 = Counter32: 0


TCP-MIB::tcpEstabResets.0 = Counter32: 686


TCP-MIB::tcpCurrEstab.0 = Gauge32: 2


TCP-MIB::tcpInSegs.0 = Counter32: 138461949


TCP-MIB::tcpOutSegs.0 = Counter32: 85730827


TCP-MIB::tcpRetransSegs.0 = Counter32: 1530

1 comment:

mdma said...

Very useful information!!!
Thanks!!!