[SNMP4J] I: Sender trap v3
Frank Fock
fock at agentpp.com
Wed Apr 23 18:29:36 CEST 2008
Hi Aloi,
You have added a localized USM user for an empty
engine ID, but your local engine ID is not empty. Thus,
you cannot use that user to send out a request.
Best regards,
Frank
Aloi Gianfranco wrote:
>
>
> Hi all,
>
> I have a problem, with my sender trap v3.
>
> My source code is
>
>
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> ---------------------------------------------
>
> UdpAddress address = new
> UdpAddress(InetAddress.getByName("----------"),162);
>
>
>
> MessageDispatcherImpl msgDispatcher = new MessageDispatcherImpl();
>
> msgDispatcher.addMessageProcessingModel(new MPv3());
>
>
>
> trasport = new DefaultUdpTransportMapping();
>
>
>
> snmpV3Session = new Snmp(msgDispatcher,trasport);
>
>
>
> UsmUser user =new UsmUser(new OctetString("USERNAME123"),
>
> AuthMD5.ID,
>
> new
> OctetString("PASSWORD123"),
>
> PrivDES.ID,
>
> new
> OctetString("CRYPT123"));
>
>
>
> MPv3 mpv3 =
> (MPv3)snmpV3Session.getMessageProcessingModel(MessageProcessingModel.MPv
> 3);
>
>
>
> USM usm = new USM(SecurityProtocols.getInstance(),
>
> new OctetString(mpv3.createLocalEngineID()),
> 0);
>
>
>
> usm.addUser(new OctetString("USERNAME123"),user);
>
>
>
> SecurityModels.getInstance().addSecurityModel(usm);
>
>
>
>
>
> target = new UserTarget(address,new
> OctetString("USERNAME123"),new byte[0],SecurityLevel.AUTH_PRIV);
>
> target.setSecurityModel(SecurityModel.SECURITY_MODEL_USM);
>
>
>
>
>
> VariableBinding varBinding = null;
>
> ScopedPDU notification = new ScopedPDU();
>
> notification.setType(PDU.NOTIFICATION);
>
>
>
> // Definisco TimeStamp
>
> OID oid = new OID ("1.3.6.1.2.1.1.3.0");
>
> Variable value = new TimeTicks((int)(new
> java.util.Date()).getTime() );
>
> varBinding = new VariableBinding (oid);
>
> varBinding.setVariable(value);
>
> notification.add(varBinding);
>
>
>
> --------
>
> --------
>
>
>
> trasport.listen();
>
> snmpV3Session.notify(notification,target);
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> ---------------------------------------------
>
>
>
> When this code was running I captured this exception
>
>
>
> org.snmp4j.MessageException: Message processing model 3 returned error:
> 1403
>
> at
> org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:420)
>
> at org.snmp4j.Snmp.sendMessage(Snmp.java:955)
>
> at org.snmp4j.Snmp.send(Snmp.java:794)
>
> at org.snmp4j.Snmp.send(Snmp.java:758)
>
> at org.snmp4j.Snmp.notify(Snmp.java:699)
>
> at SnmpV3Session.openSession(SnmpV3Session.java:116)
>
> at SnmpV3Session.<init>(SnmpV3Session.java:40)
>
> at SnmpV3Session.main(SnmpV3Session.java:126)
>
>
>
> what does it means....?
>
>
>
> Thank for your help...
>
>
>
> Gianfranco
>
>
>
>
>
>
>
>
>
>
>
> --------------------------------------------
> INFORMATIVA SULLA PRIVACY
> Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute
> in questo messaggio e nei suoi eventuali allegati sono riservate e per
> uso esclusivo del destinatario. Nessuno, all'infuori dello stesso,
> può copiare o distribuire il messaggio, o parte di esso, a terzi.
> Chiunque riceva questo messaggio per errore è pregato di distruggerlo
> e di informare il mittente.
>
> PRIVACY NOTICE
> According to the D.Lgs. 196/2003 this document and its attachments are
> confidential and intended for the named addressee(s) only. If you are
> not the intended recipient of this message, any use or dissemination
> of this message is prohibited. If you have received this document by
> mistake, please notify the sender and destroy all physical and/or
> electronic copies.
>
>
> --------------------------------------------
> INFORMATIVA SULLA PRIVACY
> Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute
> in questo messaggio e nei suoi eventuali allegati sono riservate e per
> uso esclusivo del destinatario. Nessuno, all'infuori dello stesso,
> può copiare o distribuire il messaggio, o parte di esso, a terzi.
> Chiunque riceva questo messaggio per errore è pregato di distruggerlo
> e di informare il mittente.
>
> PRIVACY NOTICE
> According to the D.Lgs. 196/2003 this document and its attachments are
> confidential and intended for the named addressee(s) only. If you are
> not the intended recipient of this message, any use or dissemination
> of this message is prohibited. If you have received this document by
> mistake, please notify the sender and destroy all physical and/or
> electronic copies.
> _______________________________________________
> 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