[SNMP4J] SNMP4j duplicate registration exception

Frank Fock fock at agentpp.com
Mon Sep 1 22:07:07 CEST 2014


Hello Leonard,

SMI forbids the registration of an OID below another OID (instance 
within instance)
and obviously that makes sense. Otherwise, the lexicographic ordering
of objects in an agent could not be implemented without ambiguities.

In your case, the corresponding SMI MIB would have an error and should not
pass a proper syntax check.

Best regards,
Frank


Am 01.09.2014 08:52, schrieb László Leonard:
> Hello,
>
> I have some dificulties registering my managed objects to MOServer.
> The problem occured to me when I try to register a managed objects under an already registered managed object.
> I send you the problematic code below:
>
>   @SuppressWarnings({ "rawtypes", "unchecked" })
>   MOScalar myScalar = new MOScalar(new OID("1.3.6.1.4.1.5999.1.0"), MOAccessImpl.ACCESS_READ_ONLY, new OctetString(
>   "Hello"));
>   ourOwnManagedScalarObjects.put(myScalar.getID().toString(), myScalar);
>   try {
> server.register(myScalar, new OctetString("1.3.6.1.4.1.5999"));
> } catch (DuplicateRegistrationException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>   myScalar = new MOScalar(new OID("1.3.6.1.4.1.5999.1.1.0"), MOAccessImpl.ACCESS_READ_ONLY, new OctetString(
>   "HelloWorld"));
>   ourOwnManagedScalarObjects.put(myScalar.getID().toString(), myScalar);
>   try {
> // the exception is thrown at this line
> server.register(myScalar,  new OctetString("1.3.6.1.4.1.5999"));
> } catch (DuplicateRegistrationException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> Could you explain why I cannot register objects this way please?
>
> Best regards,
> Leonard
> _______________________________________________
> 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