Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Reading IP from a file and SNMP

by Anonymous Monk
on Jan 08, 2005 at 15:20 UTC ( [id://420533]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Reading IP from a file and SNMP
in thread Reading IP from a file and SNMP

That's good news! Could you be more specific or just show me some lines of code. I was reading the docs of net-snmp and tehre was only an exapmle of C async poll. Thanks!

Replies are listed 'Best First'.
Re^4: Reading IP from a file and SNMP
by Anonymous Monk on Jan 10, 2005 at 10:01 UTC
    there are a couple examples in the net-snmp/perl/SNMP/examples directory. there's also a bit in the SNMP perldoc. for the most part you just add a callback to the get command (which will get called when the reply comes back) and then call SNMP::MainLoop.
    use SNMP; my $session = SNMP::Session->new( ... ); sub callback { if ( !defined( $_[0] ) { warn "request timed out: $session->{ErrorStr}\n"; } # do something with VarbindList $_[0] } $session->get( [[ $oid ]], \&callback ); SNMP::MainLoop();
    my code is a bit more complex, taking a list of hosts, a number of outstanding reqests and a set of OIDs. it returns all of the info in a hash. i'll see if i can clean it up a bit for posting.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-23 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found