[SNMP4J] Problem with a Trap

smart bart smartbart1701e at gmail.com
Fri Feb 8 11:01:31 CET 2008


Hi all,

i'm a newbie on snmp and i'm trying to make an Agent using snmp4j.

I've create MyAgent  extending the BaseAgent.
I've some problem when i try to send a customized trap.

This trap is send from my Agent (i've seen the packet on the lan) but
it is not parsed from snmptrapd demon. The snmptrapd recieves the trap
but don't reconize it.

In MyAgent i have configurated a the NotificationTargets

 protected void addNotificationTargets(SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB)
    {
        targetMIB.addDefaultTDomains();
        targetMIB.addTargetAddress(new OctetString("notification"),
TransportDomains.transportDomainUdpIpv4,
                new OctetString(new
UdpAddress("127.0.0.1/162").getValue()), 200, 1, new
OctetString("notify"),
                new OctetString("v2c"), StorageType.permanent);
        targetMIB.addTargetParams(new OctetString("v2c"),
MessageProcessingModel.MPv3,
                SecurityModel.SECURITY_MODEL_USM, new
OctetString("SHADES"), SecurityLevel.AUTH_PRIV,
                StorageType.permanent);
        notificationMIB.addNotifyEntry(new OctetString("default"), new
OctetString("notify"),
                SnmpNotificationMIB.SnmpNotifyTypeEnum.trap,
StorageType.permanent);
    }

and i've create a sendTrapMethod
public void sendTrap()
{
        agent.notify(new OctetString(""), MyOIDTrap, new VariableBinding[0]);
}

Someone can help?
My Agent is correct?

I've seen that i send a trap version 3. How can i send trap version 1?



More information about the SNMP4J mailing list