Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top