Re: FW: Re: How can I extend a MIB with a subagentX

"Arnaud BODENAN" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I've added in my registration of my table the creation of the rows:

int initGenServerTable
{

...

// Add a Row
netsnmp_table_row *row  = netsnmp_create_table_data_row();

u_long ind = 1;
netsnmp_table_row_add_index(row, ASN_UINTEGER, &ind, sizeof(ind));
netsnmp_set_row_column(row, 2, ASN_OCTET_STR,
                          "Test1", strlen("Test1"));
netsnmp_set_row_column(row, 3, ASN_OCTET_STR, "Test2",
                           strlen("Test2"));
netsnmp_set_row_column(row, 4, ASN_OCTET_STR,
                           "Test3", strlen("Test3"));

netsnmp_table_dataset_add_row(genServerTable, row);
}

When I execute my sub agent, I now have the following error:
illegal data attempted to be added to table (no index)genServerTable

although I set the index (variable ind) in the row of the table...

I hoped that management of the index of a table was managed by the net-snmp 
API. Must I manage it myself?

Thanks for your help.

>From: "Arnaud BODENAN" <[email protected]>
>To: [email protected]
>Subject: Re: FW: Re: How can I extend a MIB with a subagentX
>Date: Thu, 31 Aug 2006 11:57:41 +0200
>
>Hi,
>
>I've created a MIB with the following tables, and create a sample to
>initialize the table.
>
>I have a subagent (agentX) where i register my table genServerTable.
>
>To do this, I create a function initGenServerTable where I call:
>netsnmp_create_table_data_set => to create the table
>netsnmp_table_dataset_add_index => to set the index on this table
>netsnmp_table_set_multi_add_default_row => to define each row on the table
>netsnmp_register_table_data_set => to register the table with the master
>agent
>
>When i run the subagent (which calls the function initGenServerTable), and
>execute the command:
>
>snmpget ... MONITORING-SERVER-MIB::genServerTable
>I get the error message:  No Such Object available on this agent at this 
>OID
>
>It seems that my table has not been registered. Is there a way allowing me
>to check what has been registered?
>
>Do I miss some steps when i register my table? Is there a 'easier' way to
>register a table?
>
>I do not register a function to get the value of an entry in my table.
>
>Thanks.
>
> >From: "Dave Shield" <[email protected]>
> >To: "Arnaud BODENAN" <[email protected]>
> >CC: [email protected]
> >Subject: Re: FW: Re: How can I extend a MIB with a subagentX
> >Date: Wed, 23 Aug 2006 21:18:53 +0100
> >
> >On 23/08/06, Arnaud BODENAN <[email protected]> wrote:
> >>- genStatisticsTable with the index genServerIndex and 
>genStatisticsIndex
> >>:
> >>statistics here are specific to each server
> >>
> >>Is there a generic way to create the genStatisticsTable with columns
> >>that can be added dynamically by a sub agent?
> >
> >Well, that does sound like a generic statistics table.
> >You can't change the number of *columns* dynamically, but you can
> >certainly add new rows (corresponding to new statistics).
> >
> >So you'd probably have three columns in this table (plus the external
> >genServerIndex):
> >
> >  *  genStatisticsIndex - to distinguish between multiple statistics
> >relating to the same server
> >  *  genStatisticsDescr - a textual description of what this statistic
> >reports
> >  *  genStatisticsValue - the value for this statistics
> >
> >So you might have a table such as:
> >
> >1   1    "# Silly Questions received"    23
> >1   2    "# Sarcastic Answers"    22
> >1   3    "# Clearly phrased Questions"   3
> >2   2    "# Silly Questions received"   17
> >2   3    "# Patient Answers"    18
> >
> >
> >Note that a given "genStatisticsIndex" value can refer to two
> >different statistic for two different servers.
> >
> >OK?
> >
> >Dave
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job 
>easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>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

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.