Hi,
From your mail, we understood that the trap forwarded by the subAgent must be modified in the master agent as per your requirement and send to the manager. If our assumption is wrong, please correct us with the appropriate details.
To modify the traps send by the subAgent, the master agent waits in a callback thread waiting for the packet at the default port 8005. To modify the trap pdu, you can override the method callback of SnmpTrapReceiverService and process the trap pdu and send the pdu by calling the sendTrap method of SnmpTrapService.
The following shows the sample code snippet to override the callback method.
public class TrapService extends SnmpTrapReveiverService {
TrapService(int port){
super(port);
}
public boolean callback(SnmpSession session,
SnmpPDU pdu, int reqid){
...(process your pdu)
...(send the pdu)
return false;
}
public void addTrapRequestListener(TrapRequestListener trapListener)
{
this.trapListener = trapListener;
}
}
In the main file of the master agent, by default the SnmpTrapReceiverService is instantiated. please include the following line instead of SnmpTrapReceiverService.
TrapService trapservice = new TrapService(8005);
trapservice.addTrapRequestListener(trapListener);
Also to send a trap, please refer our example bundled with the product. For further reference, please refer the javadoc.
Hope we are clear.
Please do get back to us for further clarification.
Thanks,
Ramkumar