Net-SNMP returned types
Asked Answered
P

1

6

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 there. For instance, if I have an unsigned int64, I will receive Gauge32 as the type after sending "snmpget". I am looking for a table which lists all the possible "type strings" (like "Gauge32", or "INTEGER") which Net-SNMP will return along with the actual type that the string is associated with. So this table would have obvious entries like:

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

If anyone knows where to find the comprehensive list, please post.

Panjabi answered 28/1, 2013 at 21:58 Comment(0)
G
11

This is not a straight answer to your question.

SNMP RFC documents published on IETF only define 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-int types, there are other derived types defined via MACRO, such as DisplayString, and so on.

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

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

Grevera answered 29/1, 2013 at 2:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.