2011-10-05 189 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似乎表明它是一個請求的功能。