Mickey_C has asked for the wisdom of the Perl Monks concerning the following question:
Why does this SNMP session not die? It continues ad infinitum... well, a long time at least, ignoring the timeouts, retries etc.
I am pointing it to an interface that is pingable, but the snmp agent is not available to that interface at the time (this is a system where there are multiple management cards, in a high availability type system, and only one is available at a time - I am trying to get a clean failure, so I can move on to the next interface - and this works perfectly when talking to an interface that is active, ie has the mgmt client avialable on it). To fully appreciate the predicament, the interfaces are always active when in a standby mode... otherwise I would just Net::Ping them first... but shouldn't the timeouts force the snmpsession to fail?
sample code: my ($hosted,$community) = @_; my $sversion = "v2c"; my $stimeout = 8; my $sretries = 1; print "trying SNMP on $hosted ...\n"; my ($snmpsession, $snmperror) = Net::SNMP->session( -hostname => $hosted, -version => $sversion, -timeout => $stimeout, -retries => $sretries, -community => $community, -debug => "DEBUG_ALL", ); Watching the debug output, I see the retries expire, debug: [342] Net::SNMP::Dispatcher::_transport_timeout(): retries left + 0 and then it ramps right up again! error: [2361] Net::SNMP::__ANON__(): No response from remote host "myo +bfuscatedhostname" debug: [516] Net::SNMP::Dispatcher::_event_delete(): deleted [ARRAY(0x +9c4354)], list is now empty Error: No response from remote host "m +yobfuscatedhostname". debug: [1057] Net::SNMP::Message::_prepare_object_identifier(): leadin +g dot present debug: [439] Net::SNMP::Dispatcher::_event_insert(): created new head +and tail [ARRAY(0x9c4384)] debug: [199] Net::SNMP::Dispatcher::register(): added handler for desc +riptor [8] debug: [461] Net::SNMP::Dispatcher::_event_insert(): modified tail [AR +RAY(0x9c45c4)] debug: [534] Net::SNMP::Dispatcher::_event_delete(): deleted [ARRAY(0x +9c4204)], defined new head [ARRAY(0x9c45c4)] debug: [595] Net::SNMP::Dispatcher::_event_handle(): event [ARRAY(0x9c +45c4)], timeout = 7.9997
I am hoping to have a way to fail this gracefully, I can take it from there... Any ideas?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::SNMP ignoring retries & timeouts
by Mickey_C (Initiate) on Mar 28, 2013 at 19:58 UTC | |
by clark9788 (Initiate) on May 31, 2013 at 01:47 UTC | |
by Anonymous Monk on Jul 16, 2013 at 22:01 UTC |