[SNMP4J] snmp v2c getNext on linux error

Linsong Wang lwang at comtechefdata.com
Fri Jan 20 22:28:18 CET 2006


Hi,
 
I have a java (1.5) program to communicate with a snmp agent. When I
run it on win2k, no problem, But when I run it on Linux (redhat9), the
snmp.getNext returns a ResponseEvent without response PDU. But when I
use ethereal, it shows the response snmp packets with multiple tries (no
error).
Can anyone help?
 
<code>
......
    target.setCommunity( new OctetString(readComunity) );
    PDU pduRequest = pduFactory.createPDU( target );
    pduRequest.clear();
    pduRequest.setType( PDU.GETNEXT );
    pduRequest.add( new VariableBinding(oid) );
    printSpy( "snmp pdu: " + pduRequest );
    printSpy( "snmp target: " + target );
 
    try {
      ResponseEvent re = snmp.getNext( pduRequest, target );
      PDU pduResponse = re.getResponse();
      printSpy( "snmp getnext: " + pduResponse );
......
     print out is: snmp getnext: null
</code>
 
Thanks,
Linsong



More information about the SNMP4J mailing list