Net::SNMP set_request() error

Spencer Lu <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I am using the following code in a Perl script:

  my $result = $snmpSession->set_request(-varbindlist => [
      ($remoteStatusOid, INTEGER, 4),
      ($remoteInterfaceOid, INTEGER32, $neInterfaceIndex),
      ($remoteMacOid, OCTET_STRING, $currentMeterMacNoColons),
      ($remoteDekOid, OCTET_STRING, $meterDek),
      ($remoteEksOid, INTEGER32, $neEksIndex),
      ($remoteNekOid, OCTET_STRING, $neNek)
      ]);
  if (!defined($result)) {
    print "Error: " . $snmpSession->error . "\n\n";
    next;
  }

I keep seeing this output: "Error: Received wrongLength(8) error-status at error-index 3".  When it says "error-index 3", it is referring to the line with $remoteMacOid.  (And actually, I moved some lines around and it gives the same error to all of the lines that contain OCTET_STRING.)  Strange that it would complain about the length, because OCTET_STRING can be any length, right?  The $currentMeterMacNoColons variable has a value that is 12 characters, but I tried some tests with strings varying from 1 to 16 characters and I always got that same error.  What is going on here?

Thanks,
Spencer


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

-------------------------------------------------------------------------
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.