Wrong Group OID in generated files for a module


I use MIB Designer to create my MIB file. There is an Module defined and the comment for
OID is correct (generate by Designer): –
When the code is generated for that module the default constructor for the module initialize MibGroup with OID which is: --, but it should be

When I fix this issue in the code I am able get the values using MIB Explorer.

Can you please, help?


Hello Safet,

What object did you define in your MIB module for the following OID?

The OID of the MibGroup is not used in the agent for any data returned, it is just to identify that object (object identifier). That OID is not used to in SNMP responses. You could use 1.10.20 too.

So I wonder, what you fix in the code? I do not think that there needs to be fixed anything.

The MibGroup OID is derived from the OIDs included in the group by the code generation. It is simply some common parent OID.

Best regards,

Hello Frank,

I my MIB file I have one module and it has to have OID, right? It is here:

LAST-UPDATED “202011241541Z” – Nov 24, 2020, 3:41:00 PM
ORGANIZATION “PEN International Corp.”
"Email: support@pen.com "
"PEN International Corp. Management Information MIB.

            Copyright November  2020 PEN International Corp."
    REVISION "202011241541Z"        -- Nov 24, 2020, 3:41:00 PM
            "Initial version."

– – ::= { PENModules 3 }

Then the AgenPro generate class for the modules and init its leafs:

MibGroup(“”, “pen_sts_mib”)
//–AgentGen BEGIN=pen_sts_mib::pen_sts_mib
//–AgentGen END
add(new pen_sts_mib_stsCfgDeviceCode());
add(new pen_sts_mib_stsIdentSerialNumber());
add(new pen_sts_mib_stsIdentSocomecRef());
add(new pen_sts_mib_stsIdentUserDevRef());
add(new pen_sts_mib_stsIdentUserDevLoc());
add(new pen_sts_mib_stsStatysStatus());
//–AgentGen BEGIN=pen_sts_mib::pen_sts_mib:post
//–AgentGen END

As you can see the MibGroup is generated with
In the code in the class constructor I replaced with
If there is no this fix when I try to GET an OID from this module it says “noSuchObject”


I still do not think, that the “fix” and the query result have a direct connection. Have you seen the following warning in your log before applying the change to the generated code?

MibContext: duplicate MibGroup registration (context)(oid)

That would have made sense then, because then there were two groups of objects with the same OID and the agent then refuses to add the second group to its MIB object tree. In that case, using any other OID for the second group of objects makes sense - to avoid the clash.

The OID of the MIB module definition is not used by AgenPro for the group OID, because there are probably other objects with an OID below but not below defined in the MIB module. That is legal but not the best MIB module writing style, because it makes it more complicated to manage OID usage in an organisation.

Hello Frank,

I review the generated code and the reason why there is duplicated MibGroup is that the OID for the MibGroup for two different modules are the same: Both modules are registered under the subtree of the module registration OID:
|____ pen(PEN)
| |____penGlobalRegModule(1)
| |____penProducstModule(2)
| |____penSTS(3)

So when the code is generated from AgenPro the OID for the MibGroup for
penGlobalRegModule, penProducstModule, and penSTS have
What I would expect to see here is:, and respectively.

What do I overseen here? Please, help.


Hello Frank,

You are right for the duplicated MibGroup log if there is no “fix”.
I follow the AgentPP OID organization looking at AGENTPP-GLOBAL-REG and AGENTPP-TEST-MIB… So I created : PEN-GLOBAL-REG.mib, PEN-PRODUCTS-MIB.mib, and each product will have to include those two. When the code is generated from AGENTPP-TEST-MIB the OID for MibGroup match for this the OID in that module. That’s why I though it is using that OID.
I will review one more time the organization of our OID, but I did it multiple times, and I am sure I follow the way how it is done in AGENTPP, before I open the topic.

You think I should change the way how the OID are organized?


Hi Safet,

You can change the cpp_code.vm template at line 890 from

MibGroup("$agenUtils.getRootOid($module)", "$moduleNameNoHyphen.toLowerCase()")


MibGroup("$module.getPrintableOid()", "$moduleNameNoHyphen.toLowerCase()")

With that change you get a guaranteed unique OID.
Note: This works with SMIv2 MIB modules only - that is why it is not yet the default!

Hello Frank,

It worked.

Thank you.