How to list nodes from a custom mib file using snmpwalk?

5.6k Views Asked by At

I'm trying to add a custom mib file that contains few nodes.

For an example I tried loading SNMP-COMMUNITY-MIB as it's a standard mib and thus shouldn't throw errors.

I copied the mib into the path

~/.snmp/mibs

and also updated snmpd.conf as:

mibdirs +$HOME/.snmp/mibs
mibs +SNMP-COMMUNITY-MIB

I tried to print the oid of one of the nodes "snmpCommunityName" using:

 snmptranslate -m +SNMP-COMMUNITY-MIB -IR -On snmpCommunityName

it worked fine and the oid was printed.

I then tried to list all using snmpwalk:

 snmpwalk -v2c -c public localhost

But the nodes from my mib and its oid's were not printed.

How can I have my oids listed on snmpwalk?

1

There are 1 best solutions below

0
Paul Tobias On

I accidentally noticed that when I run snmpwalk without an OID, I get only 593 variables from my device, and the device-specific variables are missing. But if I add 1 as the OID, I get 2527 variables, including the ones which are the most useful. So in your case try adding 1 at the end of the snmpwalk command:

snmpwalk -v2c -c public localhost 1

Edit: The above method worked on an APC PDU, and on a Supermicro BMC. The BMC was a bit confusing because it did not use the OID names from the MIB file, but all the information I need is there.