Please, help writing a MIB

Posted by facha on Server Fault See other posts from Server Fault or by facha
Published on 2012-02-09T13:00:28Z Indexed on 2012/07/02 3:18 UTC
Read the original article Hit count: 503

Filed under:

I have a problem with an snmpwalk query returning snmp variables in a non-uniform way:

.1.3.6.1.2.1.10.127.1.3.3.1.2.215 -> Hex-STRING: 24 37 4C 0C 65 0E 
.1.3.6.1.2.1.10.127.1.3.3.1.2.216 -> Hex-STRING: 24 37 4C 0B A2 DA 
.1.3.6.1.2.1.10.127.1.3.3.1.2.217 -> STRING: "$7L
                                                 f:"
.1.3.6.1.2.1.10.127.1.3.3.1.2.218 -> STRING: "$7L
                                                 k2"

As you can see, some variables are of a STRING type, others are Hex-STRING. So, I'm trying to write a simple MIB to force them all come out as Hex-STRING. This is where I've gotten so far:

TEST-MIB DEFINITIONS ::= BEGIN

PhysAddress ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "1x:"
    STATUS       current
    SYNTAX       OCTET STRING

test OBJECT-TYPE
    SYNTAX PhysAddresss
    MAX-ACCESS    read-only
    STATUS        current
    ::= { 1 3 6 1 2 1 10 127 1 3 3 1 2 }

END

However, snmpwalk doesn't seem to notice my textual convention (even though the "test" variable is being recognized). I still get a mixture of STIRNGs and Hex-STRINGs. Could anybody point to where is my mistake?

snmpwalk -v2c -cpublic 192.168.1.2 TEST-MIB::test
...
TEST-MIB::test.216 = Hex-STRING: 24 37 4C 0B A2 DA 
TEST-MIB::test.217 = STRING: "$7L
                                 f:"

© Server Fault or respective owner

Related posts about snmp