in reply to Re^3: Reading IP from a file and SNMP
in thread Reading IP from a file and SNMP
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.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();
|
|---|