[AGENT++] Same trap sent multiple times to notification target

Adluru, Krishna-p6018c (Perm Res) Krishna.Adluru at gdc4s.com
Thu Jul 1 06:59:09 CEST 2010


Hi,
 In our 'setup' we have 3 notification targets, but, we need to send
each trap only once per notification target. This code is sending same
trap 3 times per target within few milliseconds. Does anyone see any
issues in the following code ? Can someone help ?

   private static final int RETRIES = 1;

   private static final int TIMEOUT = 200;

/** IP addresses to send NMS notifications to */
   protected static String [] m_notifyAddresses = new String[3];


protected void addNotificationTargets(SnmpTargetMIB targetMIB,
            SnmpNotificationMIB notificationMIB)
   {
      for (int i = 0; i < m_notifyAddresses.length; i++)
      {
         targetMIB.addDefaultTDomains();

         targetMIB.addTargetAddress(new
OctetString(m_notifyAddresses[i]),
                  TransportDomains.transportDomainUdpIpv4, new
OctetString(
                           new
UdpAddress(m_notifyAddresses[i]).getValue()), TIMEOUT,
                  RETRIES, new OctetString("notify"), new
OctetString("v2c"),
                  StorageType.permanent);

         targetMIB.addTargetParams(new OctetString("v2c"),
MessageProcessingModel.MPv2c,
                  SecurityModel.SECURITY_MODEL_SNMPv2c, new
OctetString("public"),
                  SecurityLevel.NOAUTH_NOPRIV, StorageType.permanent);

         notificationMIB.addNotifyEntry(new
OctetString(m_notifyAddresses[i]),
                  new OctetString("notify"),
SnmpNotificationMIB.SnmpNotifyTypeEnum.trap,
                  StorageType.permanent);
      }
   }

Thank you.

Regards,
Krishna V




More information about the AGENTPP mailing list