[SNMP4J] About SNMP4J

Jochen Katz katz at agentpp.com
Thu Feb 24 23:34:33 CET 2005


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



More information about the SNMP4J mailing list