Re: multiple Sub-agents managing the same table

"Arnaud BODENAN" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
OK. The problem is that I've received the well-known error message
registering pdu failed: 263! three times

My initialization function for my table is the following:

void init_GenServerTable()
{
static oid genServerTableOid[] =
    { 1, 3, 6, 1, 4, 1, 99999, 10000, 1, 1 };

size_t genServerTableOidLen = OID_LENGTH(genServerTableOid);
u_long allocatedIndex = register_int_index(genServerTableOid, 
genServerTableOidLen, ANY_INTEGER_INDEX);
snmp_log(LOG_INFO,"Index found=%d.\n", allocatedIndex);

netsnmp_table_data_set *genServerTable = 
netsnmp_create_table_data_set("genServerTable");

netsnmp_table_dataset_add_index(genServerTable, ASN_INTEGER);
netsnmp_table_set_multi_add_default_row(genServerTable,
                                            2,
                                            ASN_OCTET_STR, 0, NULL, 0,
                                            3,
                                            ASN_OCTET_STR, 0, NULL, 0,
                                            4,
                                            ASN_OCTET_STR, 0, NULL, 0,
                                            5,
                                            ASN_INTEGER, 0, NULL, 0, 					   
          0);

// Normal registration
netsnmp_handler_registration * handlerServerTable = 
netsnmp_create_handler_registration
("genServerTable",
NULL,
genServerTableOid,
genServerTableOidLen,
HANDLER_CAN_RONLY);

// Set a specific ContextName
char buf[1024];
sprintf(buf, "TestContext%d", allocatedIndex);
handlerServerTable->contextName = buf;

snmp_log(LOG_INFO, "Context = %s. \n", handlerServerTable->contextName);
//snmp_set_do_debugging(1);
int res = netsnmp_register_table_data_set(handlerServerTable, 
genServerTable, NULL);
//snmp_set_do_debugging(0);

if ( res != MIB_REGISTERED_OK )
{
      snmp_log(LOG_ERR,"Unable to register the Server Row: res = %d.\n", 
res);
}

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

netsnmp_table_row_add_index(row, ASN_INTEGER, &allocatedIndex, 
sizeof(allocatedIndex));

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"));
u_long pid = 1500;
netsnmp_set_row_column(row, 5, ASN_INTEGER, (const char *)&pid, 
sizeof(pid));

netsnmp_table_dataset_add_row(genServerTable, row);

}

To use a ContextName, must I add something:
- in my code?
- in the MIB?
- in the configuration file?

Thanks.

>From: "Dave Shield" <[email protected]>
>To: "Arnaud BODENAN" <[email protected]>
>CC: [email protected]
>Subject: Re: multiple Sub-agents managing the same table
>Date: Thu, 7 Sep 2006 19:47:25 +0100
>
>On 07/09/06, Arnaud BODENAN <[email protected]> wrote:
> > Would it be possible to use contextName of the registrationHandler
> > (different contextName per application) instead of the
> > range_subid/range_ubound?
>
>Yes.
>
>Dave
>
>-------------------------------------------------------------------------
>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
>

_________________________________________________________________
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
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.