3

the MIB OID object have data type 'Bits':

object_OID
Composed Type: Bits
Base Type: BITS
Access: read-write
Kind: Scalar
SMI Type: OBJECT-TYPE
Value List: 
doc (0)
emta (1)
cpe (2)

From MIB description, default is DEFVAL { '00'h }. I want set value 2 (cpe). I tried to set the value with command

snmpset -v2c -c public 192.168.100.1  [object_OID] b 2

but got

Error in packet.
Reason: wrongValue (The set value is illegal or unsupported in some way)

tried also

snmpset -v2c -c public 192.168.100.1  [object_OID] i 2

again error

Error in packet.
Reason: wrongType (The set datatype does not match the data type the agent expects)

Snmpget against this object returns Hex-STRING: 00 What is proper format to set value 2 for BITS data type?

3 Answers3

2

You're using the correct syntax to set a BITS value. I would hazard a guess that the agent implementation is faulty (i.e. the agent is not following the MIB definition).

Jolta
  • 2,620
  • 1
  • 29
  • 42
1

A correct Syntax for Net-SNMP is:

snmpset -v2c -c public 192.168.100.1   $ObjectId   = 'emta cpe'
lathspell
  • 3,040
  • 1
  • 30
  • 49
0
i
INTEGER
u
UNSIGNED
s
STRING
x
HEX STRING
d
DECIMAL STRING
n
NULLOBJ
o
OBJID
t
TIMETICKS
a
IPADDRESS
b
BITS

Change the value according to data type

Example for trap IP Change -

snmpset -v2c -c private 192.168.0.1  OID  a  '10.12.14.190'
joanis
  • 10,635
  • 14
  • 30
  • 40