[SNMP4J] Traps - Multiple Management

BRESCIANI MARCO Marco.Bresciani at alcatel-lucent.it
Tue Oct 30 15:28:11 CET 2007


Hello,
  I'm working on a software using SNMP4J API and I'm facing a strange problem related to trap receving.
  I have to start multiple instances of my software and it seems I'm having conflicts (or things like that) on SNMP ports for receiving traps.

These are the steps:

- run first application (double click on a JAr), it registers on SNMP agent and works correctly (send/receive data and receive traps);

- run second application (another JVM, another double click on a JAr). It registers on (another, different IP address) SNMP agent and can send and received data but cannot receive traps because they goes to first application only. I cannot read those trap data from the second application, even though sending/receiving "normal" SNMP data is correct.


No errors are shown by SNMP4J on second application but no data are received.


This is my trap listener registration:
//trap listener registration
boolean re = snmpManager.getManager()
        .addNotificationListener(trapAddress, trapController);


This is the setting-up of Snmp class:
public SnmpManager(String pAddress, int pPort, boolean pSelectV3,
                   int pRetries, int pTimeout) {
    this.setTransport();

    /* SNMP activation */
    this.snmpObject = new Snmp(transport);

    /* SNMP v2c/v3 message processor */
    if (pSelectV3) {
        this.snmpObject.getMessageProcessingModel(
                MessageProcessingModel.MPv3);
        this.usm = new USM(SecurityProtocols.getInstance(),
                           new OctetString(MPv3.createLocalEngineID()), 0);
        SecurityModels.getInstance().addSecurityModel(this.usm);
    } else {
        this.snmpObject.getMessageProcessingModel(
                MessageProcessingModel.MPv2c);
    }

    this.startSNMP();
    this.setDevice(pSelectV3, pRetries, pTimeout);
    this.setTarget(pAddress.toString(), pPort);
}



Any help or idea on this? Obviously, agent address is different on  the two applications but it seems second application cannot receive trap.
  Please, help.


Because the world is always on.,

Ing. Marco Bresciani
Alcatel-Lucent
Software Specialist
OpticsBD R&D Software Competence Center
via Trento 30, Vimercate, Italy, 20059
EMail: Marco.Bresciani at alcatel-lucent.it
Phone: +39 039 686 5546
Fax: +39 039 686 5600


More information about the SNMP4J mailing list