2
votes

I'm googling around for a couple of days, and can't find clear method/lib for resolving OID from MIB name, and MIB from OID.

I've found few sites that have a large MIB database, search functions ie. but communicate with them needs cURL/socket connectivity and regexp of results (or eval in some cases)

I've tried to parse MIB files myself, but this is returning to writing language parser in php witch, is "madness" ;)

I have storage/cache mechanism witch work well, and every MIB lockup has to be done only once, but this one lockup must be fast and reliable

[EDIT] heh and forgot about clearing the point, is there any tool/lib/method fast and reliable to lockup MIBs and OIDs?

1
I assume you've looked at PHP's snmp module uk.php.net/manual/en/book.snmp.php - Mark Baker
Yeah... It can read MIB database, but there is no way i know witch i can use to extract this database to readable format - canni

1 Answers

2
votes

If you have net-snmp installed, and you can execute programs from your PHP script, you can use snmptranslate to go from a name to a mib:

snmptranslate -IR sysName.0

This tool depends on having your MIBDIRS and MIBS environment variables set, or supplying appropriate command arguments. (See man snmpcmd for details on the env vars and/or args.)