[SNMP4J] SNMP Dispatcher

Frank Fock fock at agentpp.com
Tue Sep 19 21:37:13 CEST 2006


Hi Scott,

Amost everything is OK, except you will need
to clone the PDU you are sending before each
call to snmp.send(..) because otherwise, you
will use the same request ID for all the requests
and SNMP4J will then not be able to map the
responses to the right request.

Best regards,
Frank

Scott MacKay wrote:
> Hi, I am making a SNMP poller and wanted to make sure
> I was doing it right...
> 
> With a class SNMPEntity, implementing
> ResponseListener, each having a PDU and Target.  The
> idea is that the class's object will get back the
> results for its own PDU/Target.
> 
> I have a dispatching thread, with:
> Transport transport=new DefaultUdpTransportMapping();
> Snmp snmp=new Snmp(transport);
> snmp.listen();
> 
> In a loop of an array of SNMPEntity, I want to issue a
> SNMP to the it's target.
>    I basically do a:
> for (int i=0;i<SNMPEntityArray.size();i++) {
>   SNMPEntity entity=SNMPEntityArray.get(i);
>   snmp.send(pdu, entity.getTarget(), null, entity);
> }
> 
> Is there any more setup/preparation needed?
> Will this cause problems/overwrites/etc when sending a
> number of requests back to back?
> 
> -Scott
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> 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