Hi,

I've got another problem with the initialisation of my table.

In the MIB, my table is declared as following:
genServerTable OBJECT-TYPE
        SYNTAX          SEQUENCE OF GenServerEntry
        MAX-ACCESS      not-accessible
        STATUS          current
        DESCRIPTION
        "A Table containing all servers running"
        ::= { genMetrics 1 }

genServerEntry OBJECT-TYPE
        SYNTAX          GenServerEntry
        MAX-ACCESS      not-accessible
        STATUS          current
        DESCRIPTION
        "A row in the table of servers"
        INDEX           { genServerIndex }
        ::=     { genServerTable 1 }

GenServerEntry ::= SEQUENCE {
                genServerIndex          Unsigned32,
                genServerName           OCTET STRING,
                        rgenServerProductName   OCTET STRING,
                genServerHostname               OCTET STRING,
                        genServerPID            Unsigned32
}

and my C function intializing this table:

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

size_t genServerTableOidLen = OID_LENGTH(genServerTableOid);

netsnmp_table_data_set *genServerTable = 
netsnmp_create_table_data_set("genServerTable");
netsnmp_table_dataset_add_index(genServerTable, ASN_UNSIGNED);
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_UNSIGNED, 0, NULL, 0,
                                            0
);

netsnmp_register_table_data_set(netsnmp_create_handler_registration
                                    ("genServerTable",
                                     NULL,
                                     genServerTableOid,
                                     genServerTableOidLen,
                                     HANDLER_CAN_RWRITE), genServerTable, 
NULL
);

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

// Populate the row for each column, beginning with the index
u_long ind = 1;
netsnmp_table_row_add_index(row, ASN_UNSIGNED, &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"));

u_long pid = 1500;
netsnmp_set_row_column(row, 5, ASN_UNSIGNED, (const char *)&pid, 
sizeof(pid));

netsnmp_table_dataset_add_row(genServerTable, row);

}

When I execute my sub-agent (which registers my table), if I execute the 
following command:

../net-snmp-5.0.11/apps/snmpgetnext -v 2c -c public localhost:1400 
KGEN-MONITORING-MIB::genServerName

I only get:
KGEN-MONITORING-MIB::genServerName.1 = STRING: "Test1"

I don't have "Test2", "Test3", nor 1500.

Has somebody detected a problem explaining that only the first column is 
created in my table?

Thanks in advance.

_________________________________________________________________
Get the new Windows Live Messenger!   
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline


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

Reply via email to