Hi Jochen,

Objective : On getting Report from NE side saying usmStatsNotInTimeWindow 
...call my own ReportHandler and set Engine Boot and Engine Time for that 
particular NE as 0 , 0 on manager side. So communication wont stop between 
manager and agent.

I have written my own ReportHandler to handle usmStatsNotInTimeWindow.

Scenario : 

1) First Manager and Agent both r not in sync

-> On that time manager will send msg to NE and NE will reply back with Report 
(usmStatsNotInTimeWindow) and manager will set that (Engne Boot and Engine 
Time).

-> On getting this Report my handler gets invoke for Each NE.

Problem :

2) Now communication is going smoothely as both r in sync. But if I change the 
time of NESIM (Decrease system time), so both wont be in sync.

-> now when manager sends SET or GET request to NE, NE will reply back with 
Report (usmStatsNotInTimeWindow), bcz manager has higher value of NE Boot or 
time diff is more than 150.

-> here m facing problem...On getting this Report my handler doesn't get invoke.


question :

1) if I don't override my own ReportHandler then should Default ReportHandler 
of SNMP4J gets invoke on getting report from NE??

pls give me some guidance to solve this problem

Thanks
Jigar Shah



--- On Thu, 11/11/10, Jochen Katz <k...@agentpp.com> wrote:

From: Jochen Katz <k...@agentpp.com>
Subject: Re: [SNMP4J] Usm_Stats_Not_In_Time_Window problem in SNMP4j
To: snmp4j@agentpp.org
Date: Thursday, 11 November, 2010, 2:21 AM

Hi,

with the following changes I can see that the default ReportHandler of
Snmp class can be overridden. Maybe you are setting your report handler
on one Snmp object and use another one (with default handler) to send
the request.

# svn diff -x -w
Index: src/org/snmp4j/tools/console/SnmpRequest.java
===================================================================
--- src/org/snmp4j/tools/console/SnmpRequest.java       (Revision 1881)
+++ src/org/snmp4j/tools/console/SnmpRequest.java       (Arbeitskopie)
@@ -50,6 +50,16 @@
     BER.setCheckSequenceLength(false);
   }

+
+public class SnmpReportHandler implements Snmp.ReportHandler{
+
+    public void processReport(PduHandle pduhandle,
CommandResponderEvent event)
+    {
+        System.err.println("In processReport");
+    }
+}
+
+
   public static final int DEFAULT = 0;
   public static final int WALK = 1;
   public static final int LISTEN = 2;
@@ -278,6 +288,7 @@
     SecurityProtocols.getInstance().addPrivacyProtocol(new Priv3DES());

     Snmp snmp = new Snmp(mtDispatcher, transport);
+       snmp.setReportHandler(new SnmpReportHandler());
     if (version == SnmpConstants.version3) {
       USM usm = new USM(SecurityProtocols.getInstance(), localEngineID, 0);
       SecurityModels.getInstance().addSecurityModel(usm);
@@ -325,6 +336,7 @@
     // Could save some CPU cycles:
     // transport.setAsyncMsgProcessingSupported(false);
     Snmp snmp =  new Snmp(transport);
+       snmp.setReportHandler(new SnmpReportHandler());
     ((MPv3)snmp.getMessageProcessingModel(MPv3.ID)).
         setLocalEngineID(localEngineID.getValue());


# java -cp dist/lib/SNMP4J.jar:lib/log4j-1.2.14.jar
org.snmp4j.tools.console.SnmpRequest -d DEBUG -a MD5 -A
MD5UserAuthPassword -u MD5 -p GETNEXT 127.0.0.1/4700
In processReport
In processReport
Received response after 2008 millis
Request timed out.

Regards,
  Jochen


Am 09.11.2010 07:52, schrieb Jigar Shah:

> I have generated Report UsmStatsNotInTimeWindow from agent side to manager 
> side.
> 
> Can u pls answer some of my doubts
> 
> 1) When I will get Report on manager side, Which API will be used at manager 
> side (Which method will be called)  ??
> 
> 2) If I want to handle this report explicitly, which interface should I 
> implement and where should I register that interface.
> 
> 
> 
> I have done this thing.... but problem is this class is not getting called 
> wen I get Report.
_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to