Returned Net-SNMP Types

Net-snmp has a small number of types:

i: INTEGER, u: unsigned INTEGER, t: TIMETICKS, a: IPADDRESS o: OBJID, s: STRING, x: HEX STRING, d: DECIMAL STRING U: unsigned int64, I: signed int64, F: float, D: double

Interestingly, the story does not end. For example, if I have an unsigned int64, I will get Gauge32 as the type after sending "snmpget". I am looking for a table that lists all the possible "type strings" (for example, "Gauge32" or "INTEGER") that Net-SNMP will return along with the actual type that the string is associated with. Thus, this table would have obvious entries, such as:

(return value from snmpget, type, snmpset symbol) → ("INTEGER", INTEGER, i)

If anyone knows where to find an exhaustive list, send a message.

+4
source share
1 answer

This is not a direct answer to your question.

RFC SNMP documents published by the IETF define only a limited set of types,

http://www.logmatrix.com/blog/bid/69744/Understanding-SNMP-Data-Types

They should be considered as built-in types.

enter image description here

Besides the built-in types, there are other derived types defined through MACRO, such as DisplayString, etc.

I created clones of NET-SNMP utilities based on #SNMP, and I learned that not all types in the NET-SNMP man pages are correct . So my snmpset clone only handles a subset of these types (U, I, F and D are not supported)

https://github.com/lextm/sharpsnmplib/blob/master/Samples/CSharp/snmpset/Program.cs

+9
source

All Articles