snowbb has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am a newbie at perl script and I was wondering if perl can help me solve my problem. I want to write a script to help me to reproduce a bug on SNMP module on a network switch. Basically the script will have a loop that will call some snmp utility to set some MIB value on a network switch, after the set operation returns, verify the operation by retrieving the value just set from the network switch through a snmp get operation. Then loop back to do the next set operation. I also need the ability to timeout the operation if we dont hear anything from the network switch through the snmp set/get operation for a certain time (say 30 seconds). Can perl do this easily? Anybody can point me to some similar scrip if there exists any or point me to some quick start page on how to code this little script? Thanks a lot! snowbb

Replies are listed 'Best First'.
Re: can perl do this?
by isotope (Deacon) on May 04, 2001 at 03:59 UTC
    Take a look at SNMP_Session. It should get you started. This package is completely implemented in Perl and I have successfully tested it under SunOS and Windows.

    There are other packages available, but they rely on the UCD-SNMP libraries (written in C), which must be compiled and installed.

    Update: Other SNMP libraries can be found here.

    --isotope
    http://www.skylab.org/~isotope/
Re: can perl do this?
by RhetTbull (Curate) on May 04, 2001 at 04:09 UTC
    snowbb wrote: Can perl do this?

    Yes, perl can do anything. :-)

    Try searching on CPAN for SNMP. A quick search turned up several modules that might be useful including Net::SNMP, SNMP::Util, and SNMP. I'd read through the docs for those modules -- I imagine it would give you a good start.

    --RT