[SNMP4J] Create, update, delete a row from a SNMP table using SNMP4J ...

Frank Fock fock at agentpp.com
Wed Sep 6 23:12:16 CEST 2006


Hi George,

You can delete a row by setting its RowStatus instance
to destroy(6). In the final else block, check whether
event.getResponse().getErrorStatus() == 0 (this indicates
success).

Best regards,
Frank

George Lamprakis wrote:
> Hi everyone,
> 
> I have just started using the SNMP4J and I would like to ask how can I create, delete, modify a row from a SNMP table using the SNMP4J library. I have found the method:
> 
> TableUtils.createRow(Target target,OID rowStatusColumnOID,OID rowIndex,VariableBinding[] values)
> 
> but how can I use this method to delete, for instance, an existing row. Moreover, what is the way of checking for errors? A sample code of error detection could be:
> 
> if((event=util.createRow(target,rowStatusColumnOID,rowIndex,values)) == null){
>    throw new Exception("IO exception occured.");
> }else{   
>    if(event.getResponse() == null){
>        throw new Exception("Request timed out.");
>    }else{
>         // what is the condition for error or success at this point ??????
>      ???
>    } 
> }
> 
> Any help would be extremely appreciated.
> 
> Thanks in advance !!!
> 
> George
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list