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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…