in reply to Re: Best module(s) for SNMP?
in thread Best module(s) for SNMP?

My application is automated testing of the SNMP interface for a piece of equipment my company sells, so it'll probably be pretty rigorous if I'm doing my job correctly :-) Lots of table additions and deletions, that's for sure.

Interesting that you mention Net::SNMP. That's the first thing I looked at, but I stopped looking when I realized that it didn't know anything about MIBs. If I want to get sysDescr.0 without having to know that it's .1.3.6.1.2.1.1.1.0, how do I go about that with Net::SNMP?

Replies are listed 'Best First'.
Re^3: Best module(s) for SNMP?
by gam3 (Curate) on Feb 10, 2006 at 18:49 UTC
    Take a look at SNMP::MIB::Compiler.
    use SNMP::MIB::Compiler; my $mib = new SNMP::MIB::Compiler; $mib->add_path('./mibs', '/usr/share/snmp/mibs'); $mib->add_extension('', '.mib', '.my', '.txt'); $mib->repository('./out'); # only accept SMIv2 MIBs $mib->{'accept_smiv1'} = 0; $mib->{'accept_smiv2'} = 1; # no debug $mib->{'debug_lexer'} = 0; $mib->{'debug_recursive'} = 0; # store compiled MIBs into files $mib->{'make_dump'} = 1; # read compiled MIBs $mib->{'use_dump'} = 1; # follow IMPORTS clause while compiling $mib->{'do_imports'} = 1; # load a precompiled MIB $mib->load('SNMPv2-MIB'); print $mib->resolve_oid('sysDescr'), ".0\n";
    UPDATE: show sysDescr.
    -- gam3
    A picture is worth a thousand words, but takes 200K.