2011-10-05 187 views
0

我试图从netsnmp使用snmpset来设置Counter32类型的OID值,但我找不出要指定哪种数据类型?如何使用netsnmp snmpset counter32 OID

看着./snmpset -h我看到以下内容:

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

其中没有一个柜台,我已经试过整数和unsigned int没有成功:

./snmpset -v2c -cprivate 135.115.155.132 1.3.6.1.2.1.67.1.1.1.1.5.0 u 321 
Bad variable type (Type of attribute is Counter32, not Unsigned32) 

的思考?

感谢您的任何想法

回答

1

根据this man page您可以使用C:

./snmpset -v2c -cprivate 135.115.155.132 1.3.6.1.2.1.67.1.1.1.1.5.0 c 321 

我'不能尝试的时刻。我不确定它是否为Net-SNMP this tracker似乎表明它是一个请求的功能。