[SNMP4J] Sending Traps doesn't works

Alessandro Lattughini lacciu at hotmail.it
Mon Feb 4 10:20:00 CET 2008


Hi,I'm trying to send custom traps notification using snmp4j-agent.I've modified the TestAgent class adding the follow code:1 - I've added a start() method where I've set the NotificationOriginator:public void start()    {        this.loadConfig(ImportModes.REPLACE_CREATE);        this.addShutdownHook();        this.getServer().addContext(new OctetString("public"));        this.finishInit();        agent.setNotificationOriginator(notificationOriginator);        notificationOriginator.notify(new OctetString(""), SnmpConstants.coldStart, new VariableBinding[0]);        this.sendColdStartNotification();    }2 - I've added a simple method in TestAgent to send a trap:
  
  public void sendTrap(){	  agent.notify(new OctetString(),			  SnmpConstants.coldStart,			  new VariableBinding[0]);  }


3) I've called the sendTrap() method from the main() method in TestAgent:

      testAgent1.start();	   testAgent1.run();   testAgent1.sendTrap();   


I'm using a simple MIB browser but when I try to send the trap, 
browser doesn't receive anything. 
Watching the log of the MIB browser I have seen this error message:

"Can't receive SNMPv3 inform because engineID is not provided."

Can anybody help me ?

_________________________________________________________________
Ti piace giocare con le lettere? Prova ABCLive!
http://messengergiochi.it.msn.com/


More information about the SNMP4J mailing list