skunix has asked for the wisdom of the Perl Monks concerning the following question:
I am polling SNMP data from a list of devices using the SNMP module based off of the Net-SNMP library.
Everything works fine when I make a new SNMP::Session with an IP address that is reachable however if the IP is unreachable the program crashes when I try to get the SNMP data like so...
my $vars = new SNMP::VarList(['sysDescr',0]['sysUpTime',0]); my ($descr,$uptime) = $snmp->get($vars);
Which will crash with the follow error...
Can't call method "get" on an undefined value at...Is there a way to handle this error without crashing?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl SNMP Error Handling
by hippo (Bishop) on Jul 11, 2013 at 19:08 UTC | |
by Anonymous Monk on Jul 12, 2013 at 11:40 UTC | |
Re: Perl SNMP Error Handling
by choroba (Cardinal) on Jul 11, 2013 at 19:01 UTC |
Back to
Seekers of Perl Wisdom