[SNMP4J] When to call USM.removeEngineTime

Stath, Paul PStath at axxcelera.com
Thu Jun 18 21:55:17 CEST 2009


I am using snmp4J in a long running program that performs SNMP
management functions.
 
The devices that we are managing store the value for engineBoots in
non-vol.
 
If the device is reset to factory default (by removing the non-vol
files) the value for
msgAuthoritativeEngineBoots becomes "1" when the device is rebooted.
 
If snmp4j has already discovered the values for engineBoots and
engineTime for this  device,
any further USM PDU messages return a REPORT PDU indicating that the
msgAuthoritativeEngineTime
provided by snmp4j is wrong.  When this occurs, the device is
unmanageable until the program
is restarted.
 
The removeEngineTime() method of the USM object appears to address this
problem, if I can get it called.
 
The ResposeEvent returned from Snmp.send(pdu, target) returns a null
value for getResponse().
 
If getReponse() would return the REPORT PDU, I could call
removeEngineTime() and resend the PDU.
 
If I'm using TableUtils, the RetrievalEvent has a getReportPDU() method
that returns a REPORT PDU.
 
Given that I need to clear the engineTime values for an already
discovered agent, what are my options,
and which is cleanest?
 
1) Implement my own object with a send() method that returns a
RetrievalEvent rather than a ResponseEvent?
 
2) Implement an AuthenticationFailureListener class that listens for
AuthenticationFailureEvent messages
and clears the engineTimes, allowing the retry in MessageDispatherImpl
to retry the PDU?
(This would require parsing the BERInputSteam to determine the specific
error, and get the engineID.)
 
3) Something else?
 
-- Paul Stath



More information about the SNMP4J mailing list