SNMP Oddity

Home » CentOS » SNMP Oddity
CentOS 2 Comments

Hi all,

Not sure if this is on topic or not.

I’m trying to query an SNMP value from CentOS 6 and I get a bad response if I don’t specify the MIB to use:

0 digimer@pulsar:~/anvil/striker$ snmpget -v2c -c public -m
RFC1213-MIB::ifPhysAddress.2 = Hex-STRING: 00 C0 B7 5F 8A 85

0 digimer@pulsar:~/anvil/striker$ snmpget -v2c -c public
IF-MIB::ifPhysAddress.2 = STRING: 0:c0:b7:5f:8a:85

Note the second reply is not returning the first character (should be
’00:’, returning ‘0:’.

Trying to request Hex doesn’t seem to help, either:

0 digimer@pulsar:~/anvil/striker$ snmpget -v2c -c public -Ox .
IF-MIB::ifPhysAddress.2 = STRING: 0:c0:b7:5f:8a:85

Any SNMP folks know what I might be doing wrong?


Digimer Papers and Projects:
“I am, somehow, less interested in the weight and convolutions of Einstein’s brain than in the near certainty that people of equal talent have lived and died in cotton fields and sweatshops.” – Stephen Jay Gould

2 thoughts on - SNMP Oddity

  • use

    net-snmp-config –default-mibdirs

    to locate where the mib file can be dropped so that snmp can use them. copy the mib file to one of the paths returned. mine usually end up in:


    net-snmp-config –snmpconfpath

    To find the snmp config files

    Add the mib to the snmp.conf file. Mine looks like this:

    mibs +ALL
    mibs +ASTERISK-MIB
    mibs /usr/share/snmp/mibs/powernet419.mib

    you can simplify the line by looking at the mib file for this:


    and then the config file can be this:

    mibs +ALL
    mibs +ASTERISK-MIB
    mibs +PowerNet-MIB

    To use the form above, the file has to be like this


    You can also use the MIBS environment variable to specify things:

    export MIBS

  • I’d guess this is the raw string transported over the wire. The MIB likely translates to proper MAC formatting. `tcpdump’ should uncover this.