I use MIB Designer to create my MIB file. There is an Module defined and the comment for
OID is correct (generate by Designer): – 1.3.6.1.4.1.PEN.1.1.3.
When the code is generated for that module the default constructor for the module initialize MibGroup with OID which is: --1.3.6.1.4.1.PEN, but it should be 1.3.6.1.4.1.PEN.1.1.3.
When I fix this issue in the code I am able get the values using MIB Explorer.
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.
As you can see the MibGroup is generated with 1.3.6.1.4.1.PEN.
In the code in the class constructor I replaced 1.3.6.1.4.1.PEN with 1.3.6.1.4.1.PEN.1.1.3.
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?
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 1.3.6.1.4.1.50562 but not below 1.3.6.1.4.1.50562.1.1.3 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.
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: 1.3.4.1.50562. Both modules are registered under the subtree of the module registration OID:
–enterprises
|____ pen(PEN)
|___penReg(1)
| |____penGlobalRegModule(1)
| |____penProducstModule(2)
| |____penSTS(3)
|
|___penGeneric(2)
…
So when the code is generated from AgenPro the OID for the MibGroup for
penGlobalRegModule, penProducstModule, and penSTS have 1.3.6.1.4.1.PEN.
What I would expect to see here is: 1.3.6.1.4.1.PEN.1.1.1, 1.3.6.1.4.1.PEN.1.1.2 and 1.3.6.1.4.1.PEN.1.1.3 respectively.
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?