Hi,
I've got a problem when I do a get request on a table that contains
Counter64 values.
My agent registers my private MIB file with the master agent, the MIB
contains scalar objects and tables.
Parity errors and hdlcAbort are part of table and they have 256 rows.
If I do a get request on a single value Counter64 the response is correct:
snmpget -v 3 -a MD5 -A "passw" -l authPriv -u username -x DES -X "passw"
udp:xxx.xxx.xxx.xxx:161 xxx-MIB::parityErrors.2
xxx-MIB::parityErrors.2 = Counter64: 0
If I do a snmpwalk it work fine
snmpwalk -v 3 -a MD5 -A "passw" -l authPriv -u username -x DES -X "passw"
udp:xxx.xxx.xxx.xxx:161 xxx-MIB::parityErrors
xxx-MIB::parityErrors.1 = Counter64: 0
....
xxx-MIB::parityErrors.256 = Counter64: 0
I get the same result with the hdlcAborts.
When I try to do:
snmpget -v 3 -a MD5 -A "passw" -l authPriv -u username -x DES -X "passw"
udp:xxx.xxx.xxx.xxx:161 xxx-MIB::parityErrors.2 xxx-MIB::hdlsAborts.2
I receive
xxx-MIB::parityErrors.2 = Counter64: 0
xxx-MIB::hdlcAborts.2 = No Such Instance currently exists at this OID
The same kind of request (so multiple oids) made on a Integer or
DisplayString will return the correct value.
I noticed the the problem is the counter64.
This is the part of the code that deals with the table and rows:
for (pRequestInfo = requests; pRequestInfo; pRequestInfo =
pRequestInfo->next)
{
pEndDeviceEntry = (struct EndDeviceDataSegment *)
netsnmp_tdata_extract_entry(pRequestInfo);
pTableRequestInfo = netsnmp_extract_table_info(pRequestInfo);
pTableRow = netsnmp_tdata_extract_row(pRequestInfo);
// If the row exists i'll proceed to retrieve the informations
nacessary
if (pTableRow)
{
index = *(pTableRow->indexes->val.integer);
switch (reqinfo->mode)
{
//Read-support (also covers GetNext requests)
case MODE_GET:
case MODE_GETNEXT:
case MODE_GETBULK:
{
switch (pTableRequestInfo->colnum) {
case COLUMN_PARITYERRORS:
{
if (!pEndDeviceEntry)
{
netsnmp_set_request_error(reqinfo, pRequestInfo, SNMP_NOSUCHINSTANCE);
continue;
}
value = convertCounter64(getParityErrors(index));
snmp_set_var_typed_value(requests->requestvb,ASN_COUNTER64,reinterpret_cast<const
u_char *>(&value), sizeof(value));
break;
}
case COLUMN_HDLCABORTS:
{
if (!pEndDeviceEntry)
{
netsnmp_set_request_error(reqinfo, pRequestInfo, SNMP_NOSUCHINSTANCE);
continue;
}
value = convertCounter64(getParityErrors(index));
snmp_set_var_typed_value(requests->requestvb,ASN_COUNTER64,reinterpret_cast<const
u_char *>(& value), sizeof(value));
break;
}
}
.....
}
Could you please help?
Thanks
Elisa
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
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