[SNMP4J] SNMP4J V3 perfromance
Scott VanWart
scott.vanwart at Q1Labs.com
Wed Oct 19 16:45:55 CEST 2005
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);
}
More information about the SNMP4J
mailing list