Hi,

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.

Code :

public class SnmpReportHandler implements ReportHandler{
    
    private static SnmpReportHandler reportHandler =null;
    public Snmp snmp = null;
 //   private static final LogAdapter logger =
 LogFactory.getLogger(SnmpReportHandler.class);

    
    public SnmpReportHandler(){     
       NMSLogger.getLogger().info("SnmpReportHandler constructorrrrrrrrrrr");
       if(reportHandler==null)
       {
           reportHandler = this;
       }
       snmp = new Snmp();
       snmp.setReportHandler(this);
    }
    
    public static SnmpReportHandler getInstance()
    {
        return reportHandler;
    }
    
    public void processReport(PduHandle pduhandle, 
 CommandResponderEvent event){
        NMSLogger.getLogger().info("In SnmpReportHandler.javaaaaaaaa");
        PDU pdu = event.getPDU();
        
        if (pdu.size() == 0) {
          NMSLogger.getLogger().info("Illegal report PDU received from " + 
event.getPeerAddress() +
                       " missing report variable binding");
          return;
        }
        NMSLogger.getLogger().info("*********************************");
        NMSLogger.getLogger().info("In
 SnmpReportHandler.javaaaaaaaa");
        NMSLogger.getLogger().info("PDU TYPE : " + pdu.getType());
       
        
        VariableBinding vb = pdu.get(0);
        if (vb == null) {            
            NMSLogger.getLogger().info("Received illegal REPORT PDU from " + 
event.getPeerAddress());
          return;
        }        
       
        OID firstOID = vb.getOid();        
        if
 (SnmpConstants.usmStatsNotInTimeWindows.equals(firstOID)) {            
            NMSLogger.getLogger().info("SNMPv3 USM Not In Time Window"); 
            NMSLogger.getLogger().severe("ErrorCode : " + 
ErrorCodes.SNMPV3_USM_NOT_IN_TIME_WINDOW);
        }
    }
    
}

I m seeing Report is coming frm agent side to manager side .
Ethereal detail

Source port : 161
Dest port : 32821
Length : 139
PDU Type : Report (8)
Object Identfier 1 : 1.3.6.1.6.3.15.1.1.2.0 (SNMPv2 - SMI :: 
snmpmodules.15.1.1.2.0) 

but m not seeing this Report on code level.

Thanks
Jigar Shah







Hi,

> How can I handle usmStatsNotInTimeWindow Report  in my code?

if you get this report as a response to your request, you should tell
the user (who is using the application) that there is a security issue
with the time information of the agent that he wanted to query. And if
the user typed in "Yes, I know what I am going to do!", you can allow
him to click on the button to reset the time information for this
specific agent. Do not do this automatically!

> Is there any specific setting which I need to set to get this Report (I
> mean how can I
 accept this Report, is there any specific port??), bcz I
> don't see this Report in my code (log) but I am able to see this Report
> in Ethereal.

You don't have to change any settings. The report is automatically
handled by SNMP4J when it is safe to handle it. And it will be returned
to your code, if it cannot be handled automatically.

If you do not use encryption, have a look at the engineBoots and
engineTime values within each message in ethereal/wireshark.

Regards,
  Jochen
_______________________________________________
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