I am working on a project that involves SNMP. Basically I need to construct MIB and OID tree in PHP.
I know that there are programs that do this already, but I am trying to implement my own version to incorporate with my webapp.
What I know: I am familiar with php SNMP function. I can do SNMPWALk to get OIDs and such. Unfortunately there is no function that I know of that finds all MIBs and parses them.
What I need: Get all MIB docs first from remote server, then based on each docs get their Objects. At the end my tree will have this structure:
+ mib-doc1 |
- obc1
- obj2
+ mib-doc2 |
- obj1
- obj2
- obj3
and so on...
I also know:
- From the actual server I can get all the MIB directories:
$net-snmp-config --default-mibdirs
- I can also get list of all MIB docs:
$snmpwalk -mALL -v1 cpublic ip
I have 2 questions.
- How can I get list of all MIB docs from a remote server?
- Is there an easier way (with known functions), to parse each MIB to get Objects?
Thanks
If you just want a list of modules, see if your manager supports SNMPv2-MIB::sysORTable. This does not help you find the MIB files of course, but tells you what is supposed to be supported.
Quoting specs,
sysORTable
is:Here is what I get for a standard Linux host :