[SNMP4J] problem to receive traps

Frank Fock fock at agentpp.com
Mon Jun 12 14:16:00 CEST 2006


Hello Stefan,

You did not specify the interface and port on which you want
to receive SNMP messsages. SNMP4J therefore chooses an arbitrary
one. Have you sent the traps to that port?

If you have used

this.snmp = new Snmp(new DefaultUdpTransportMapping());

by accident, then please specify the port like this

    Address listenAddress = GenericAddress.parse("udp:0.0.0.0/162");
    TransportMapping transport =
	new DefaultUdpTransportMapping(listenAddress);
    snmp = new Snmp(transport);

BTW, I will make the JavaDoc clearer in this point for the next
release.

Best regards,
Frank


Stefan M wrote:
> Hello List,
> 
> I try to receive traps from a couple of access points unsing snmp4j. I 
> just copied the code from the api docs which add a CommandResponder to 
> the snmp object using the following code:
> 
> ...
> this.snmp = new Snmp(new DefaultUdpTransportMapping());
> CommandResponder trapPrinter =
>   new CommandResponder() {
>     public synchronized void processPdu(CommandResponderEvent e) {
>         LOGGER.debug("e = "+e);
>         PDU command = e.getPDU();
>         if (command != null) {
>             LOGGER.debug("TRAP>> "+command);
>         }
>     }
> };
> snmp.addCommandResponder(trapPrinter);
> this.snmp.listen();
> ...
> 
> The access point I am using in my test environment is configured to send 
> TRAPs on "whatever" event to the IP of my test machine. When I use the 
> MibbleBrowser (www.mibble.org, great tool!) to ask for the TRAP PDUs, it 
> tells me that 18 PDU had been send so far...Problem: I do not get any 
> debug message on my console. Is there something I forgot to configure?
> 
> thanx,
> 
> Stefan
> _______________________________________________
> 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