[SNMP4J] How to set value of MOScalar to no such instance

Frank Fock fock at agentpp.com
Thu Apr 14 01:37:15 CEST 2016


Hi Rushik,

For MOScalar you can set the variable with
setValue(Null.noSuchInstance);
to noSuchInstance exception, but that would violate the SNMP standard,
because the agent would return "noSuchInstance" on a scalar for GET
request (which is not allowed) and return an exception value on a GETNEXT
request which is also not allowed.

For table rows, the TableRow.getValue(int col) must return null to return
a noSuchInstance exception on a GET request on that cell.

Best regards,
Frank

Am 13.04.2016 um 19:56 schrieb ru_44 at hotmail.com:
> I am using the agent pro and created my own MIBs for snmp4j agent.
> My question is how to I set the mib element to no such instance since it uses MOscalar for scalar attribute in agent pro:
> here is my code:
> moFactory.createScalar(oidVictorySdrSysCbitStatus,
>
>
>                               moFactory.createAccess(MOAccessImpl.ACCESSIBLE_FOR_READ_ONLY),
>
>                               null,
>
>                               TC_MODULE_VICTORY_SDR_MIB, TC_VICTORYSDRTESTRESULTTYPE);
>   
> I can't change the null value to use the Null.nosuchInstance SMI constant.
> Is there a way to initialize the MIB value to no such instance.
>   
>   
> Also I need to know how to set the value for any table row values also to return "no such instance" in MOScalar.
>   
> thanks
> Rushik Patel
>   		 	   		
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list