[AGENT++] table index with multiple components problem

john.edmonds at bt.com john.edmonds at bt.com
Fri Jan 18 10:44:17 CET 2008


Ok, thanks for clarifying Frank. 
 
Carrying on from this I discovered another problem.  After making the change and successfully allocating index "1.0.0" I tried to allocate index "2.0.0". This then failed with the same error with the Net-SNMP master agent, and a slightly different error with the AgentX++ Master Agent (259:AGENTX_INDEX_ALREADY_ALLOCATED):
 
With the Net-SNMP Master agent:
index "1.0.0" ->
20080118.09:34:10: 403: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (0), (0), (1.3.6.1.2.1.87.1.7.1), (1.3.6.1.2.1.87.1.3.1.1), (1), (1.3.6.1.2.1.87.1.7.1.1), (0), (1.3.6.1.2.1.87.1.7.1.2), (0)

index "2.0.0" ->
20080118.09:34:12: 403: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (260), (0), (1.3.6.1.2.1.87.1.7.1), (1.3.6.1.2.1.87.1.3.1.1), (2), (1.3.6.1.2.1.87.1.7.1.1), (0), (1.3.6.1.2.1.87.1.7.1.2), (0)

 
With the AgentX++ Master Agent:
index "1.0.0" ->
20080118.09:26:11: 413: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (0), (0), (1.3.6.1.2.1.87.1.7.1), (1.3.6.1.2.1.87.1.3.1.1), (1), (1.3.6.1.2.1.87.1.7.1.1), (0), (1.3.6.1.2.1.87.1.7.1.2), (0)

index "2.0.0" ->
20080118.09:26:17: 413: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (259), (2), (1.3.6.1.2.1.87.1.7.1), (1.3.6.1.2.1.87.1.3.1.1), (2), (1.3.6.1.2.1.87.1.7.1.1), (0), (1.3.6.1.2.1.87.1.7.1.2), (0)

To my mind both these indexes should be allowed as they are unique and not overlapping ranges?  It is only sub components of the index that are the same?  Or is there something I'm not understanding in the AgentX protocol regarding index allocation?
 
Thanks,
 
John Edmonds
BT Trading Systems
 
 

________________________________

From: Frank Fock [mailto:fock at agentpp.com]
Sent: Thu 17/01/2008 22:51
To: Edmonds,J,John,JGFTX C
Cc: agentpp at agentpp.org
Subject: Re: [AGENT++] table index with multiple components problem



Hello John,

This seems to be a bug in the current AgenPro code
generation template for AGENT++. You can fix it
by replacing line 208 of cpp_code.vm with

        "$subindex.printableOid"#end

(it was: "$table.printableOid"#end)

Hope this helps.

Best regards,
Frank

john.edmonds at bt.com wrote:
> Hello,
> 
> I need some help with a table index with multiple components.  I am seeing the error AGENTX_ERR_INDEX_NONE_AVAILABLE (260) returned to my AgentX++ sub-agent from net-snmp when I try to call allocate_index() to create a table row.  The index OID I am trying to register is "1.0.0". 
> 
> 20080115.16:41:11: 426: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (260), (0), (1.3.6.1.2.1
> .87.1.7.1), (1.3.6.1.2.1.87.1.7.1), (1), (1.3.6.1.2.1.87.1.7.1), (0), (1.3.6.1.2.1.87.1.7.1), (0)
> 
> Index OID "1.2.3", however, registers OK.  It looks as though all the Index components need to be different for the allocate_index() to succeed.
> 
> I am compiling the RTP MIB with AgenPro v2.6
> 
> rtpRcvrEntry OBJECT-TYPE
>     SYNTAX          RtpRcvrEntry
>     MAX-ACCESS      not-accessible
>     STATUS          current
>     DESCRIPTION
>       ""
>     INDEX { rtpSessionIndex, rtpRcvrSRCSSRC, rtpRcvrSSRC }
>     ::= { rtpRcvrTable 1 }
>
> Where each of the 3 index components is an integer.
> 
> The .cpp output file from AgenPro v2.6 shows
> 
> rtpRcvrEntry* rtpRcvrEntry::instance = 0;
> 
> const index_info indRtpRcvrEntry[3] = {
> { sNMP_SYNTAX_INT, FALSE, 1, 1 },
> { sNMP_SYNTAX_INT, FALSE, 1, 1 },
> { sNMP_SYNTAX_INT, FALSE, 1, 1 }};
> 
> const Oidx indOidsRtpRcvrEntry[3] = {
> "1.3.6.1.2.1.87.1.7.1",
> "1.3.6.1.2.1.87.1.7.1",
> "1.3.6.1.2.1.87.1.7.1"};
> 
> Should all the index OIDs in indOidsRtpRcvrEntry be the same, the OID of the rtpRcvrEntry, and not the OIDs of the actual index components?  These appear to be the OID values sent to the Master Agent during allocate_index().
> 
> If I modify indOidsRtpRcvrEntry[3] to contain the OIDs of the index components
> 
> const Oidx indOidsRtpRcvrEntry[3] = {
> "1.3.6.1.2.1.87.1.3.1.1",
> "1.3.6.1.2.1.87.1.7.1.1",
> "1.3.6.1.2.1.87.1.7.1.2"};
> 
> The allocate_index() with index "1.0.0" is now successfull.
> 
> 20080116.14:42:29: 437: (1)DEBUG  : SubAgentXMib: index (de)allocate response (oid)(err)(errind)(values..): (0), (0), (1.3.6.1.2.1.8
> 7.1.7.1), (1.3.6.1.2.1.87.1.3.1.1), (1), (1.3.6.1.2.1.87.1.7.1.1), (0), (1.3.6.1.2.1.87.1.7.1.2), (0)
>
> My feeling is that the net-snmp code will fail the table index allocation if the index used for the index allocation has multiple components with the same OID. 
> 
> Is there a problem with my understanding of table indexes with multiple components, a problem in net-snmp with index allocation for tables with multi component indexes or a problem with the output from AgenPro when compiling MIBs with tables with multi component indexes?
> 
> John Edmonds
> BT Trading Systems
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

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






More information about the AGENTPP mailing list