Hi Robert,

I am creating row initially at startup. I am using following code in init
method of code.
int init_gsomcGrpCfgTable(void){
netsnmp_index index;
oid index_oid[2];
for(int indexVal = 0; indexVal< 5; indexVal++){
/*initialize the index value*/
 index_oid[0] = indexVal; //first index value
 index_oid[1] = indexVal; //second index value
 index.oids =  index_oid;
 index.len = 2;
 ctx = NULL;
ctx = CONTAINER_FIND (cb.container, &index);

 if (!ctx)
 {
 ctx = gsomcGrpCfgTable_create_row(&index);
 ctx->gsomcCdmSlotNum = 1;
 ctx->gsomcCuChainId =2;
 ctx ->gsomcGsId = 3;
  CONTAINER_INSERT (cb.container, ctx);
 }
   }
}

When i do SNMP set request, i am not creating any row, A call back
(gsomcGrpCfgTable_create_row) to create the row is called at runtime by
Net-SNMP. I am again asking, wheather the way of index creation in startup
is correct? What is way if it is wrong.Please note that I am able to read
the startup value in SNMP GET request. But it is not updating after SET
request.

How my subagent will know that the request came for SET request on index
column(there are two index in table)? so that i can delete the row and
create a new value? Do i need to maintaion my own data structure seperately
to check the index information?

Your help will be highly appreciated.

Thanks
Awadhesh.



On 6/12/07, Robert Story <[EMAIL PROTECTED]> wrote:

On Mon, 11 Jun 2007 16:48:19 +0530 Awadhesh wrote:
AK> I have not written any code the ACTION and COMMIT phase of mib2c
generated
AK> code right now and same code is working if I use it for single index
table.

That's just odd. How are these rows created? By snmpset, or do you create
them
at startup?

AK> So setting the table column value is not updating value with the
latest one
AK> and no error is shown by net-snmp. Here I had initialized the column
with
AK> value 4, when i modified it with value 3, it is updated as per
net-snmp but
AK> if i use SNMP GET command on same instances, it is showing the old
value.
AK>
AK> [EMAIL PROTECTED] log]# snmpset -c gssoam -r 0 -t 300 localhost:161
AK> .1.3.6.1.4.1.303.3.3.9.35.5.2.8.1.4.1.1 i 3
AK> SNMPv2-SMI::enterprises.303.3.3.9.35.5.2.8.1.4.1.1 = INTEGER: 3
AK> [EMAIL PROTECTED] log]# snmpget -c gssoam -r 0 -t 300 localhost:161
AK> .1.3.6.1.4.1.303.3.3.9.35.5.2.8.1.4.1.1
AK> SNMPv2-SMI::enterprises.303.3.3.9.35.5.2.8.1.4.1.1 = INTEGER: 4
AK>
AK> Also when i update the index column with some value using SNMP SET
command,
AK> it is updating but with wrong value. Please tell me,  it is known
behavior
AK> or i am doing some thing wrong.

You _CAN NOT_ set the index column. That should generate an error. To
change
an index, you must delete a row and add it with the new index.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to