Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Perl Net::SNMP returns 1 instead of the desired outcome

by VinsWorldcom (Prior)
on Oct 25, 2013 at 13:05 UTC ( #1059653=note: print w/replies, xml ) Need Help??

in reply to Perl Net::SNMP returns 1 instead of the desired outcome

From the perldoc of Net::SNMP:

get_request() - send a SNMP get-request to the remote agent $result = $session->get_request( [-callback => sub {},] # non-blocking [-delay => $seconds,] # non-blocking [-contextengineid => $engine_id,] # v3 [-contextname => $name,] # v3 -varbindlist => \@oids, ); [...] A reference to a hash is returned in blocking mode which contains the contents of the VarBindList. In non-blocking mode, a true value is returned when no error has occurred. In either mode, the undefined value is returned when an error has occurred. The "error()" method may be used to determine the cause of the failure.

I see you're using 'nonblocking' mode in your call to session() so you're getting a "TRUE" value returned as per the documented operation. Try removing the '-nonblocking => 1' line from the call to session() and see what happens.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-11-30 02:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found