snmp session timed out

Raul Miguel Nery Ferreira Sa <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hello everyone,

I am currently doing some scripting in Perl and i am using the Perl module 
for Net-SNMP. I use the following code to establish a snmp session:

$sess = new SNMP::Session (DestHost => $host, Community => $comm, Version 
=> $ver);

if ($sess->{ErrorNum}) { print "Got $sess->{ErrorStr} 
querying $host for.\n";}

This works if the host i am trying to reach is online and is an snmp 
agent. However if i deliberately put the host down, the script should
suposedly go down to the next sentence:

if ($sess->{ErrorNum}) { print "Got $sess->{ErrorStr}
querying $host for.\n";}

and thus it should print:

Got $sess->{ErrorStr} querying $host for.

Bu it doesn't print it. What am i doing wrong here?

Cheers,
Raul de Sa

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.