Hi folks.

I want to send a trap, and I'm not interested in receiving
a response.

My current code:

            snmp = new Snmp(new DefaultUdpTransportMapping());
            PDU trap = new PDU();
            trap.setType(PDU.TRAP);
            OID oid = new OID("1.2.3.4");
 trouble->  oid.setValue("some string");
            trap.add(new VariableBinding(oid));

            Address targetaddress = new UdpAddress(address + "/" + port);
            CommunityTarget target = new CommunityTarget();
            target.setCommunity("public");
            target.setVersion(SnmpConstants.version2c);
            target.setAddress(targetaddress);
            snmp.send(trap, target, null, null);

I think I'm using the OID object incorrectly - if I remove the line labeled
"trouble", things seem to work properly. I see a trap with OID of 1.2.3.4
and a value of null. When I try to set the value, it seems to destroy the
OID; the oid in the packet capture becomes "0.0", and the value is null.

What am I doing wrong? Thanks!


--
Jeffrey Ramin
Berbee
[EMAIL PROTECTED]
608.298.1024
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to