[SNMP4J] Need Help/Info reg. INFORMs

Frank Fock fock at agentpp.com
Wed Apr 26 01:05:53 CEST 2006


Hi,

To make things easier, you can use

http://www.snmp4j.org/doc/org/snmp4j/Snmp.html#addNotificationListener(org.snmp4j.smi.Address, 
org.snmp4j.CommandResponder)

This will automatically respond INFORM requests (you do not
need to respond in the processPdu method of your listener).

Hope this helps.

Best regards,
Frank


Reddy Alok-a22624 wrote:
> Hi,
>     I have basically written a Trap/Inform Handler using SNMP4J. The
> requirement is that I should be able to handle 50 INFORMs/second. That
> is the Trap/INFORM Handler should be able to receive and send responses
> to 50 INFORMs/second. Actually, it seems to work fine but sometimes I
> find some INFORMs to which a RESPONSE never goes out. This seems to
> occur when I receive more than one INFORM at the same instance of a
> hundredth of a milli-second. For example, if I receive an INFORM at
> "1.000" sec and then another INFORM at "1.004" sec, then the RESPONSE to
> the second INFORM is not being sent out sometimes (that is I do not find
> the RESPONSE in the Ethereal Logs where as the code actually seems to
> send it).
>  
>     I am not really sure if I need to do any other setup on the SNMP4J
> side. Find below the code that I have written (only the code that I feel
> important is being put in here):
>  
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> ------------------------------------------------------
>  
> public class SnmpTrapHandler implements CommandResponder, Runnable {
>  
>     // An SNMP object is being created with a thread pool of size 10,
> addCommandResponder(this) is being called on it 
>     // and then "listen" method is being called on it.
>  
>     // processPdu method
>     public void processPdu (CommandResponderEvent e)
>     {
>         if(e.getPDU ().getType() == PDU.INFORM)
>         {
>                      s_logger.finest("Received PDU of type INFORM");
>                      //Send RESPONSE to Inform Request
>                      sendAcknowledgement(e);
>         }
>  
>         // Further processing of the event
>     }
>  
> }
>  
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> ------------------------------------------------------
>  
> Thanks in Advance,
> Alok.
>  
> _______________________________________________
> 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