1

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?

Sujay
  • 26
  • 1
  • 6
  • Adding MIB documents is just step 1. You have to add the corresponding managed objects to the agent (at `localhost:161`) so that they can be queried. There are several approaches, and one of them is https://net-snmp.sourceforge.io/wiki/index.php/Tut:Extending_snmpd_using_shell_scripts – Lex Li Sep 11 '21 at 16:05

1 Answers1

0

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.

Paul Tobias
  • 1,962
  • 18
  • 18