SNMP Data Query with snmpget and snmpwalk

From Thomas-Krenn-Wiki
Jump to: navigation, search

A typical query with "snmpget" might look like this (in this, requesting the OID for the BalanceNG version):

    snmpget -v1 -c public tklb1 .

Querying (and outputting) the entire BalanaceNG 2.x management information base (MIB) might be performed as follows:

    snmpwalk -v1 -c public tklb1 .

The BALANCENG-MIB.txt file can be copied into the /usr/share/snmp/mibs directory on the client. The following environment is used to inform local tools like snmpget and snmpwalk) where to find the BalanceNG MIB:


The following output clarifies the difference:

    $ snmpget -v1 -c public tklb1 .
    SNMPv2-SMI::enterprises.2771.1.1 = STRING: "2.228"
    $ export MIBS=+BALANCENG-MIB
    $ snmpget -v1 -c public tklb1 .
    BALANCENG-MIB::Release = STRING: "2.228"

The following command makes this setting permanent for the current user:

    $ echo "mibs +MY-MIB" >> $HOME/.snmp/snmp.conf

Additional information can be found in the BalanceNG FAQ, (in English), as well as Chapter 4 of the BalanceNG manual (