Hello,
i try to do some Get-Request on my implemented table and i have got the error 'No Such Instance currently exists at this OID' on some column entries. If i do an snmptable request or a single snmpget request all data correctly response.
Request:
snmpget -c public localhost 25.3.3.1.1.0x8801 25.3.3.1.2.0x8801 25.3.3.1.3.0x8801 25.3.3.1.4.0x8801 25.3.3.1.5.0x8801 25.3.3.1.6.0x8801 25.3.3.1.7.0x8801 25.3.3.1.8.0x8801
Result:
INDUSOL-MODULAR-INSPEKTOR-MIB::sysModInfo.34817 = STRING: "Modul 1"
INDUSOL-MODULAR-INSPEKTOR-MIB::modIndex.34817 = INTEGER: 136
INDUSOL-MODULAR-INSPEKTOR-MIB::modDescr.34817 = No Such Instance currently exists at this OID
INDUSOL-MODULAR-INSPEKTOR-MIB::modID.34817 = No Such Instance currently exists at this OID
INDUSOL-MODULAR-INSPEKTOR-MIB::modOperStatus.34817 = INTEGER: 0
INDUSOL-MODULAR-INSPEKTOR-MIB::modLastChange.34817 = Timeticks: (0) 0:00:00.00
INDUSOL-MODULAR-INSPEKTOR-MIB::modName.34817 = No Such Instance currently exists at this OID
INDUSOL-MODULAR-INSPEKTOR-MIB::chNumber.34817 = INTEGER: 1
snmptable -c public localhost 25.3.3
sysModInfo modIndex modDescr modID modOperStatus modLastChange modName chNumber
"v1.36" 136 "Modul 1" "88" 0 0:0:00:00.00 "Profibus-Monitor(DP) (einkanalig) Modul 1" 1
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;
}
Norman
--
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
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.