in reply to SNMP Error using Net::SNMP - Transport endpoint is not connected

If you notice, the response to the request for OID "192.168.0.49 1.3.6.1.4.1.9.2.1.3" ends in ...3.0 .

This is an indication that you are supplying an incomplete OID to the SNMP query.

The "SNMPWALK" request succeeds because it dives deeper, returning all child OID's. A simpler SNMPGET would have failed.

Try changing the OID to "1.3.6.1.4.1.9.2.1.3.0" in your code.

To keep this on-topic (perl-related), please do use strict;, etc, as arc_of_descent recommends. Also, it is a good idea to check return values, to ensure that your SNMP object did indeed get created.

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

  • Comment on Re: SNMP Error using Net::SNMP - Transport endpoint is not connected

Replies are listed 'Best First'.
Re^2: SNMP Error using Net::SNMP - Transport endpoint is not connected
by glide (Pilgrim) on Apr 08, 2008 at 14:35 UTC
    Hi,
    when the OID don't end with a index (it's not a table) you need to add a .0 in the end of the OID, to retrieve (or set) a value.

    see more in the rfc-1157

Re^2: SNMP Error using Net::SNMP - Transport endpoint is not connected
by Anonymous Monk on Apr 10, 2008 at 20:34 UTC
    yep, i realized that i had been using snmpwalk from the command line, and thats why it wasnt working. thanks for the input though!