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:
SNMPv2-MIB::sysDescr.0 = .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysObjectID.0 = .1.3.6.1.2.1.1.2.0
... etcI want to scan all the MIB files and find all the OIDs from the files.
How do I do this?
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.
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.
Use snmptranslate
-command from net-snmp
library. Try it with the following paramenters:
-M "directory containing your MIB file"
-m ALL
-Pu
-Tso
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With