[SNMP4J] TreeUtils detecting issues with getSubtree results

Mackay, Scott scott.mackay at progeny.net
Tue Aug 3 18:23:58 CEST 2010


That is good.  I am hoping that the loop and conditions I am checking are the accurate ones to detect this particular issue.
Are the inner checks, isError()==true, getStatus()==TreeEvent.STATUS_REPORT, and finally bind.getOid().equals(SnmpConstants.usmStatsNotInTimeWindows)==true the path to detect a condition like this or is there another combination?  I am afraid I have not seen any material on the website to get to the details as an example.


-Scott


-----Original Message-----
From: snmp4j-bounces at agentpp.org on behalf of Frank Fock
Sent: Tue 8/3/2010 11:44 AM
To: Mackay, Scott
Cc: <snmp4j at agentpp.org>
Subject: (nwl)  Re: [SNMP4J] TreeUtils detecting issues with getSubtree results
 
Hi Scott,
Normally the last entry in the list has the error. Any other case  
would indicate an abnormal behavior of the agent.

Best regards,
Frank

Von meinem iPhone gesendet

Am 03.08.2010 um 15:36 schrieb "Mackay, Scott"  
<scott.mackay at progeny.net>:

> A sanity check, in case anyone has processed the error results  
> before...
> It looks like the List of TreeEvents holds the information.
> for each TreeEvent entry you can do a .isError().  I think the  
> detection would be as follows:
>
>          for (int i = 0; i < results.size(); i++) {
>            TreeEvent tresult = (TreeEvent) results.get(i);
>            if (tresult.isError()==true) {
>                 if (tresult.getStatus()==TreeEvent.STATUS_REPORT){
>                    VariableBinding[]  
> bindings=tresult.getVariableBindings();
>                    for (VariableBinding bind:bindings) {
>                        if (bind.getOid().equals 
> (SnmpConstants.usmStatsNotInTimeWindows)==true) {
>                            result.badTimeWindow=true;
>                            break;
>                        }
>
>                    }
>
>                }
>            }
> Does that seem the right place to get an error status like the not  
> in time window?
>
>
> -Scott
>
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org on behalf of Mackay, Scott
> Sent: Mon 8/2/2010 7:17 PM
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] TreeUtils detecting issues with getSubtree results
>
>
> I had a question about detecting error conditions while performing a  
> TreeUtils getSubtree() method.
>
> Is there a standard result processing layout for detecting issues  
> with the results?
>
> Instead of hunting and pecking for each of the possible error codes,  
> I was wondering if anyone has a template method which takes the  
> getSubtree results and translates issues to exceptions or at least  
> just have stub code with all the possible error conditions laid out.
>
> -Scott
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j




More information about the SNMP4J mailing list