[SNMP4J] SNMP4J V3 perfromance

Frank Fock fock at agentpp.com
Wed Oct 19 20:38:23 CEST 2005


Hi Scott,

You may check your UDP buffer size and you should probably decouple
trap handling with sending out a synchronous request.

Best regards,
Frank

Scott VanWart wrote:

>Hey Guys,
>
> 
>
>I am having problems with performance using SNMP4J. I have verified that
>the device I am working with it sending more than 1 trap (inform) per
>second, but all I seem to be able to receive is one event per second.
>Here is my code, does anything jump out? Is there something I need to
>set? Thanks!
>
> 
>
>Thanks!
>
>Scott
>
> 
>
> 
>
>try
>
>{
>
>command = e.getPDU();
>
>            Address source = e.getPeerAddress();
>
>            e.setProcessed(true);
>
>                                                
>
>            if (e.getMessageProcessingModel() ==
>MessageProcessingModel.MPv3)
>
>            {
>
>                        // send response.
>
>                        UserTarget target = new UserTarget();
>
>                        target.setAddress(source);
>
>                        target.setVersion(SnmpConstants.version3);
>
>                        target.setSecurityName(new OctetString(user));
>
> 
>target.setSecurityLevel(SecurityLevel.AUTH_PRIV);
>
> 
>
>                        snmp.getBulk(command, target);
>
>            }
>
>                                                
>
>            VariableBinding varBinding;
>
>            Variable var;
>
>                        
>
>            // discover how many variables exist
>
>            int length = command.size();
>
> 
>
>            // loop through variables and put them ALL into payload.
>
>            for(int i = 0; i < length; i++)
>
>            {
>
>                        varBinding = command.get(i);
>
>                        var = varBinding.getVariable();
>
>                        payload += var.toString() + "\t";
>
>            }
>
>                                    
>
>            // Get source address of Trap.
>
>            String test = source.toString();
>
>            int colon = test.indexOf('/');
>
>            src = test.substring(0, colon);
>
> 
>
>            }
>
>catch (Exception pe)
>
>            {
>
>                        logger.error("Could not decrypt SNMP data:",
>pe);
>
>            }
>
> 
>
> 
>
>_______________________________________________
>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