[SNMP4J] Agent send a V3 trap

Saraswat, Deepak deepak.saraswat at hp.com
Tue Jul 24 13:38:33 CEST 2007


Hi All,

 

I have just installed a Snmp4j agent and tries to send a Cold start trap
and found out that it always send a V3 trap. However, I have added a
target with MPv2c processing model. How to change it's configuration to
send V1/V2 trap by default. I also found that when I added this target
it was got added as a V2 target as shown in the code but during
retrieval it got Message processing model to be MPV3.

 

Thanks for the help in advance,

Regards

Deepak

 

Here is the target adding code:

 

protected void addNotificationTargets(SnmpTargetMIB targetMIB,

                                        SnmpNotificationMIB
notificationMIB) {

    targetMIB.addDefaultTDomains();

 

    targetMIB.addTargetAddress(new OctetString("notification"),

                               TransportDomains.transportDomainUdpIpv4,

                               new OctetString(new
UdpAddress("15.76.222.130/162").getValue()),

                               200, 1,

                               new OctetString("notify"),

                               new OctetString("v2c"),

                               StorageType.permanent);

    targetMIB.addTargetParams(new OctetString("v2c"),

                              MessageProcessingModel.MPv2c,

                              SecurityModel.SECURITY_MODEL_SNMPv2c,

                              new OctetString("cpublic"),

                              SecurityLevel.NOAUTH_NOPRIV,

                              StorageType.permanent);

    notificationMIB.addNotifyEntry(new OctetString("default"),

                                   new OctetString("notify"),

 
SnmpNotificationMIB.SnmpNotifyTypeEnum.trap,

                                   StorageType.permanent);

  }




More information about the SNMP4J mailing list