http://qs321.pair.com?node_id=1059653


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.