Converting SNMP OIDs to descriptive names on Win32
Whats the recommended way of converting SNMP OIDs to their equivalent descriptive names?
i.e. from 1.3.6.1.2.1.1.9.1.4.7
to SNMPv2-MIB::sysORUpTime.7
I'm co开发者_StackOverflow中文版ding in C++, platform should be XP and above, and looking for a fairly fast and small footprint way of doing this.
I know that libsmi or net-snmp can do this, but is there anything directly within the Win32 API that can do it?
Also, I know the necessary MIB files will need to be installed - is there a 'centralized' location for MIB files under Windows?
Microsoft does not have any Win32 API for such conversion (the closest thing is this Managing Object Identifiers). So libsmi is still the way to go. Or you can call snmptranslate process.
If you use netsnmp API, you should use its location to store MIB files. Windows usually hold MIB files in
%windir%\system32
, but that location is useless as Microsoft does not have API you want.
精彩评论