[SNMP4J] SNMP V2 Trap Problems

Frank Fock fock at agentpp.com
Thu Sep 6 20:53:31 CEST 2007


Hi Leonard,

Have you specified version2c for the target you used?
By default v1 is used.

Best regards,
Frank

Leonard Bocock wrote:
> List,
> 
> V1 trap sends are working fine to both NetView and the snmpj4 agent, however
> I seem unable to resolve V2c trap send problems despite much effort.
> 
> When received by Netview 7.14, I get invalid trap format errors in
> trapd.logalthough I don't necessarily trust that product!
> 
> When sending to snmpj4 agent, running the command line "SNMP4J  -Ol
> 0.0.0.0/162", I get the following error:
> 
> 29/08/2007 19:50:00 org.snmp4j.log.JavaLogAdapter log
> SEVERE: java.io.IOException: Unsupported PDU type: -89
> 
> I can't help but think I'm missing something basic here, but have no idea
> what.....as far as I can tell the PDU is set right, var1=sysTime and var2
> the OID,
> 
> Here is the relevant code snippet.....
> 
> 
> CommunityTarget target = new CommunityTarget();
> target.setCommunity(new OctetString(getElementText(community)));
> 
> PDU pduRequest = new PDU();
> pduRequest.add(new VariableBinding(SnmpConstants.sysUpTime, new
> TimeTicks(5666)));
> pduRequest.add(new VariableBinding(SnmpConstants.snmpTrapOID, new
> OID(sEnterprise)));
> 
> pduRequest.setType(PDU.TRAP);
> 
> Address address = new TcpAddress(InetAddress.getByName(sHostname), iPort);
> AbstractTransportMapping transport = new DefaultTcpTransportMapping();
> 
> target.setAddress(address);
> Snmp snmp = new Snmp(transport);
> snmp.listen();
> 
> ResponseEvent responseEvent = snmp.send(pduRequest, target);
> 
> etc etc................
> 
> Any help gratefully received, Thanks Len
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list