Is there a simple way to map snmp(MIB) strings to OIDs in Perl?

Deadly 提交于 2020-01-15 02:37:51

问题


Is there a simple way/module to map snmp(MIB) strings to OIDs in Perl?

E.g. I start with "sysUpTime.0" and get "1.3.6.1.2.1.1.3.0". As far as I can see, Net::SNMP expects you to have them already mapped.


回答1:


You can use NetSNMP::OID to do the conversion.

use NetSNMP::OID;

my $oid = NetSNMP::OID->new('sysUpTime.0');

NetSNMP::OID is part of the Net-SNMP project, not to be confused with the Net::SNMP module.



来源:https://stackoverflow.com/questions/2433187/is-there-a-simple-way-to-map-snmpmib-strings-to-oids-in-perl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!