Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Best module(s) for SNMP?

by splinky (Hermit)
on Feb 10, 2006 at 06:22 UTC ( [id://529289]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://529289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found