________________________________
From: Dave Shield <[email protected]>
To: niepa inter <[email protected]>
Cc: [email protected]
Sent: Tuesday, August 25, 2009 2:36:52 AM
Subject: Re: Problem initializing table from mib2c data_set

2009/8/24 niepa inter <[email protected]>:

>     /* enable row creation */
>     table_set->allow_creation = 1;
>     netsnmp_table_set_multi_add_default_row(table_set,
> COLUMN_PRTCONSOLEDISPLAYBUFFERINDEX, ASN_INTEGER, 0,
>                                             pkt->index, sizeof(pkt->index),
> COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT, ASN_OCTET_STR, 1,
>                                             pkt->consolebuf, 
> strlen(consolebuf),
>                               0);


Those two statements mean that you can create new rows in the table,
using an SNMP SET command, and it will provide a default value for
these two objects.

Though since prtConsoleDisplayBufferIndex is one of the indexes of
the table, you would presumably be running SET command on the
prtConsoleDisplayBufferText object anyway,  so these default values
are somewhat redundant.

>> What rows should it contain?
> My hope is that the row at COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT,

That indicates the column, not the row.
If you are creating a new row, then you need to specify the index
values for that row.   The agent can't make these indexes up
automatically - you need to tell it what to do.

Sure I have been able to create rows.

> However if I create an additional row(COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT.1)
> and load some data into it ,it works.

Yes - that's how this is meant to work.
Although judging by your code, there ought to be two index values,
not just one.

>                         But I do not want to add another row,
> I would like to be able to initialize COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT.

That's not how SNMP tables work.   You *always* have to specify the
index values.
That's the whole point of a table!
    Management values are associated with an _instance_ of a column object (i.e.
a particular row of the table),  not with the column as a whole.


Well my problem is the following. I need to communicate with a device, and
it's currently querying(get-request) for an oid that comes straight
from the MIB (COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT). So GET requests are
failing but GETNEXT are working because I have
COLUMN_PRTCONSOLEDISPLAYBUFFERTEXT.1 setup on my system. So is there a
way to modify the code or maybe the handler to fake maybe the GET to
becomes a GETNEXT ? or is there any other approach to this ?

Thanks so much for your help.


      
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to