Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get OIDs from a MIB file?

Tags:

snmp

net-snmp

mib

I want to read all the objects from the MIB file that a manager has.

I developed one tool to get some data from a SNMP enabled agent. I want to enhance that tool by showing all the OIDs form the manager's MIB file.

I am using the NET-SNMP library.

I saw the following:

/usr/local/share/snmp/mibs/ 

folder and it contains many MIB files, but how can I form a list of the OIDs it has?

I went through the MIBs and saw the structures, but how do I get the OIDs of each and every object mentioned in the MIB files?

I want to list all the OIDs as follows:

  1. SNMPv2-MIB::sysDescr.0 = .1.3.6.1.2.1.1.1.0
  2. SNMPv2-MIB::sysObjectID.0 = .1.3.6.1.2.1.1.2.0 ... etc

I want to scan all the MIB files and find all the OIDs from the files.

How do I do this?

like image 949
pradipta Avatar asked Sep 20 '12 07:09

pradipta


People also ask

What is the difference between OID and MIB?

The raw data (e.g. hardware temperature) is called an 'object' that resides within the device in a database, i.e. Management Information Base (MIB), and every object (the device statistics that you are trying to poll) is uniquely identified with an object identifier i.e. OID.

What is SNMP OIDs?

In the Simple Network Management Protocol (SNMP), OID means an "Object Identifier." To define OID, it's an address used to uniquely identify managed devices and their statuses.


1 Answers

Use snmptranslate-command from net-snmp library. Try it with the following paramenters:

-M "directory containing your MIB file"
-m ALL
-Pu
-Tso
like image 163
Massy Avatar answered Oct 06 '22 15:10

Massy