简体   繁体   中英

Net-SNMP returned 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 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.

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.

在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM