[SNMP4J] About SNMP4J
Mauricio Reyes
maure5 at hotmail.com
Tue Mar 1 06:03:30 CET 2005
Hello Jochen,
I've tryied to modify the code so that I can send SNMPv3 Traps with SNMP4J
to net-snmp. I modified the MPv3.createLocalEngineID(), with another
engineID created like this:
byte[] tt={1,2,3,4};
USM usm = new USM(SecurityProtocols.getInstance(),
new OctetString(tt), 0);
SecurityModels.getInstance().addSecurityModel(usm);
if (authoritativeEngineID != null) {
snmp.setLocalEngine(authoritativeEngineID.getValue(), 0, 0);
}
// Add the configured user to the USM
addUsmUser(snmp);
Both in listen() and createSnmpSession(). Am I doing something wrong?
I'd appreciate if you can point me to what part of the code I need to change
in order to send SNMPv3 traps within SNMP4J to net-snmp?
>From: Jochen Katz <katz at agentpp.com>
>To: snmp4j at agentpp.org
>Subject: Re: [SNMP4J] About SNMP4J
>Date: Thu, 24 Feb 2005 23:34:33 +0100
>
>Hi!
>
>>1. SNMP4J prints the traps in it numeric form. Is there a way to map the
>>numbers to some verbal representation of the objects? So that the object
>>name is displayed instead of the numeric value?
>
>Not at the moment...
>
>>2. I've searched through the code to try and find where are the traps
>>received and printed to the screen. I'd like to know this so that I can
>>extract the trap and use it to do some calculations. Can you please
>>indicate me how to do this?
>
>I think you're looking for these lines in SnmpRequest.java:
> public synchronized void processPdu(CommandResponderEvent e) {
> PDU command = e.getPDU();
> if (command != null) {
> System.out.println(command.toString());
>
>>But on the side of the snmptrapd I get:
>
>>usm: Unknown User(mtest)
>
>>createUser -e 0x0102030406 mtest MD5 mprueba DES mprueba
> ^^^^^^^^^^^^
>If you didn't modify the SNMP4J tool to use that engineID it won't work.
>SnmpRequest uses the engineID returned from MPv3.createLocalEngineID(). So
>either change the snmptrapd.conf or SnmpRequest.java.
>
>Regards,
> Jochen
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/snmp4j
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
More information about the SNMP4J
mailing list