[SNMP4J] TreeUtils detecting issues with getSubtree results

Frank Fock fock at agentpp.com
Tue Aug 3 17:44:28 CEST 2010


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



More information about the SNMP4J mailing list