qmalt
qmalt

Reputation: 23

SNMP Agent get table fail (getnext not increment)

everyone. I am new to snmp and faced following problem. I have snmp table on agent. It works only with flag -Cb (request new row by getnext command). When I using net-snmp int ubuntu, I am getting this table.

enter image description here

How it's doing in java snmp4j: it is performed by step by step getting every row by sending getnext request. But instead of pointing table OID, I point column's OIDs which I want to get. getnext return result and next incremented OID that will be in the next request. As I researched, during snmpgetnext query does not get incremental value. I receive "OIDs returned from a GETNEXT or GETBULK are less or equal than the requested one (which is not allowed by SNMP)". So I can't get it there. I suppose that net-snmp avoid this error by doing increment internally when getting this error.

I also tryied to do getnext manually via net-snmp in ubuntu instead of snmptable, but some of columns I got only first incremeted value and thats it, some does not increment at all.

But snmpget on increased value works

enter image description here

Is it a bug on snmp agent? So net-snmp increment by itself when getting snmp table?

Upvotes: 0

Views: 1219

Answers (1)

Jolta
Jolta

Reputation: 2725

Indeed it looks to me like you have a buggy SNMP Agent on your hands. You should report this to the agent vendor. The data in your first screenshot should be enough evidence for them to take it on as a bug report.

The correct behavior is specified for SNMPv1 in RFC 1157 section 4.1.3, and a few other RFCs for subsequent SNMP versions. However, the gist of it remains the same in v2 and v3.

I'm not sure how the snmptable command works, but it might be trying to guess the successor OID like you say, but more likely snmptable uses SNMP GetBulkRequest-PDUs in the background, and the Agent's implementation of GetBulk is better than its GetNext. I.e. the table traversal bug is not present in the code that handles GetBulk, which gives you the whole table.

Try traversing the table with the snmpwalk, which I think uses only the GetNext operation. My guess is that the snmpwalk will halt or loop, like your snmpgetnext command!

Upvotes: 0

Related Questions