Net::SNMP - Newbie Help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi All,

Please help!

I am in need of a perl script utilizing Net::SNMP to poll a router or
routers for various statistics and hope someone out there can help me
as I am useless and new to the perl world.

I want to have a text file with various hosts/community-strings/OIDs
which the perl script will read then run the polls against the text
file and put the results into variables or to another text file.

I understand the opening and closing of files and reading them but
when it comes to using the Net::SNMP sections and placing the output
into variables gets my stomach churning.

Any help will be extremely appreciated and thanks in advance.


Re: Net::SNMP - Newbie Help

Rob wrote:

Quoted text here. Click to load it

For the churning, I recommend Pepcid AC - great stuff. :-)

As for your Perl code - what have you tried? What were the results, and
how were they different from those you expected?


Cocoa programming in Perl:
Hire me! My resume:

Re: Net::SNMP - Newbie Help


Thanks for your reply,

I popped out to the shops .....lets see if this Pepcid helps.... :-)

Its not so much what I've tried its what I am trying to do and at the
same time learn a bit.

I want to query several routers for cpu usage,mem usage etc using
Net::SNMP and outputting those results into variables or text files.
These results I then want to take and use the RRD module to output
these stats to the rrd database for graphing.

I will be happy to just get some advice setting up a simple (for you
not me) perl script using Net::SNMP to query a device and output the

Quoted text here. Click to load it
choice......(there goes the stomach again) and  both modules are used
for this purpose.
My main concern is with the Net::SNMP side of things as the online docs
dont explain it in newbie terms.

I have used simple bash scripts to poll routers however I am sure a lot
of the functionality is not there to utilise.

Thanks again,


Re: Net::SNMP - Newbie Help

RobO wrote:

Quoted text here. Click to load it

Well... the docs for the Net::SNMP module aren't meant to be an
introduction to the Perl language. There are other docs for that. For
instance, if it's the use of objects & methods that's causing your
heartburn, you might want to have a look at these perldocs:


Whereas, if you're having trouble getting your head (and stomach) around
complex nested data structures, have a look at:


Or, if it's regexes:


So once again, it gets back to the question - what terms are you having
difficulty with?


Cocoa programming in Perl:
Hire me! My resume:

Site Timeline