Hello,

my snmp application is created as a Dynamically Loadable Object and
i try to do an multiple snmpget request on my implemented table with 8 colums 
and i've got the error 'No Such Instance currently exists at this OID' on some 
column entries. It seems that only the STRING columns followed  after the first 
string column failed. Also If i request a wrong column index on multiple 
snmpget request snmpd crashed with segfault. 
If i do an snmptable request or a single snmpget request on all columns all 
data correctly response.


Multiple request failed (1-9) -> column 9 does not exist:
snmpget -c public localhost 25.3.3.1.sysModInfo.0x8801 25.3.3.1.9.0x8801

snmpd -f -Le
Initializing networkData
initialize_table_moduleParamTable
NET-SNMP version 5.3.3
Segmentation fault

Single request succeeded (column 9 does not exist);
snmpget -c public localhost 25.3.3.1.9.0x8801
INDUSOL-MODULAR-INSPEKTOR-MIB::moduleParamEntry.9.34817 = No Such Object 
available on this agent at this OID

Multiple request failed (column 1-1):
snmpget -c public localhost 25.3.3.1.sysModInfo.0x8801 
25.3.3.1.sysModInfo.0x8801

INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = STRING: "v1.37"
INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = No Such Instance currently 
exists at this OID 

Multiple request succeeded (column 1 - 2):
snmpget -c public localhost 25.3.3.1.sysModInfo.0x88 25.3.3.1.modIndex.0x8801  

INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = STRING: "v1.37"
INDUSOL-MODULAR-INSPEKTOR-MIB::modIndex.34817 = INTEGER: 136

Multiple request failed(column 2 - 1):
snmpget -c puplic localhost 25.3.3.1.modIndex.0x88 25.3.3.1.sysModInfo.0x8801  

INDUSOL-MODULAR-INSPEKTOR-MIB::modIndex.34817 = Wrong Type (should be INTEGER): 
STRING: "v1.37"                                     
INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = No Such Instance currently 
exists at this OID    

Multiple request failed(column 1 - 3):
snmpget -c public localhost 25.3.3.1.sysModInfo.0x88 25.3.3.1.modIndex.0x8801  
25.3.3.1.modDescr.0x8801

INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = STRING: "Module 1" 
INDUSOL-MODULAR-INSPEKTOR-MIB::modIndex.34817 = INTEGER: 136
INDUSOL-MODULAR-INSPEKTOR-MIB::modDescr.34817 = No Such Instance currently 
exists at this OID    

Single request succeeded (column 3):
snmpget -c public localhost 25.3.3.1.modDescr.0x88
INDUSOL-MODULAR-INSPEKTOR-MIB::modDescr.34817 = STRING: "Module 1 (DP)"

What 

Here is the code of my table handler function:

int
moduleParamTable_handler(
    netsnmp_mib_handler               *handler,
    netsnmp_handler_registration      *reginfo,
    netsnmp_agent_request_info        *reqinfo,
    netsnmp_request_info              *requests) {

    netsnmp_request_info       *request;
    netsnmp_table_request_info *table_info;
    struct moduleParamTable_entry          *table_entry;

    switch (reqinfo->mode) {
        /*
         * Read-support (also covers GetNext requests)
         */
    case MODE_GET:
        for (request=requests; request; request=request->next) {
            table_entry = (struct moduleParamTable_entry *)
                              netsnmp_extract_iterator_context(request);
            table_info  =     netsnmp_extract_table_info(      request);

            switch (table_info->colnum)
                        {
                        case COLUMN_SYSINFO:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_value(requests->requestvb, 
ASN_OCTET_STR,
                                                
table_entry->mod_param.firmware, strlen(
                                                                
table_entry->mod_param.firmware));
                                break;
                        case COLUMN_MODINDEX:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_integer(request->requestvb, 
ASN_INTEGER,
                                                                                
table_entry->mod_param.modindex);
                                break;
                        case COLUMN_MODDESCR:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_value(requests->requestvb, 
ASN_OCTET_STR,
                                                
table_entry->mod_param.writable_param.moddescr, strlen(
                                                                
table_entry->mod_param.writable_param.moddescr));
                                break;

                        case COLUMN_MODID:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_value(requests->requestvb, 
ASN_OCTET_STR,
                                                table_entry->mod_param.modID, 
strlen(
                                                                
table_entry->mod_param.modID));
                                break;
                        case COLUMN_MODOPERSTATUS:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_integer(request->requestvb, 
ASN_INTEGER,
                                                
table_entry->mod_param.modOperStatusCounter);
                                break;
                        case COLUMN_MODLASTCHANGE:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_integer(request->requestvb, 
ASN_TIMETICKS,
                                                
(u_long)table_entry->mod_param.modLastChange);
                                break;
                        case COLUMN_MODNAME:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_value(requests->requestvb, 
ASN_OCTET_STR,
                                                
table_entry->mod_param.writable_param.modName, strlen(
                                                                
table_entry->mod_param.writable_param.modName));
                                break;
                        case COLUMN_CHCOUNT:
                                if (!table_entry)
                                {
                                        netsnmp_set_request_error(reqinfo, 
request,
                                                        SNMP_NOSUCHINSTANCE);
                                        continue;
                                }
                                snmp_set_var_typed_integer(request->requestvb, 
ASN_INTEGER,
                                                
table_entry->mod_param.channelCount);

                                break;
                        default:
                                netsnmp_set_request_error(reqinfo, request, 
SNMP_NOSUCHOBJECT);
                                break;
            }
        }
        break;
    }
    return SNMP_ERR_NOERROR;
}

Can anybody help me?

Norman


-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
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