Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Net-SNMP returned types

Tags:

snmp

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.

like image 238
user442920 Avatar asked Jan 28 '13 21:01

user442920


1 Answers

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

like image 121
Lex Li Avatar answered Dec 31 '22 18:12

Lex Li