Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I add my own MIB module to net-snmp.

I put my Mib txt file under - '/usr/local/share/snmp/mibs'

I see that if i change net-snmp files their the change is reflected , so this mibs are loaded correct. It seems that it not load my MIB file from there.

When i run snmptranslate on my Mib like this:

snmptranslate .

I get:


My MIB def:


    "First draft"
    ::= { enterprises 8077}

testMibObject              OBJECT IDENTIFIER ::= {testMib 1}

share|improve this question
up vote 0 down vote accepted

To find the location of snmp.conf you can use :

snmpd -Dread_config -H 2>&1 | grep "config path" | sort –u

then tell the tools to load this MIB


    snmpwalk -m +MY-MIB .....

        (load it for this command only)


    export MIBS=+MY-MIB

        (load it for this session only)


    echo "mibs +MY-MIB" >> $HOME/.snmp/snmp.conf

        (load it every time)
share|improve this answer

Here you can find references for all situations: Using and loading MIBS

I saved your MIB to a file TEST-MIB, placed it under /usr/share/snmp/mibs and snmptranslate is able to find the testMib object, although your MIB is missing some fields to properly conform to the standard:

$ snmptranslate .
No log handling enabled - using stderr logging
Expected LAST-UPDATED (DESCRIPTION): At line 6 in /usr/share/snmp/mibs/TEST-MIB

For making your MIBs conform you can use the tool smidump, which will tell you everything your MIB is missing to properly conform:

$ smidump /usr/share/snmp/mibs/TEST-MIB 
/usr/share/snmp/mibs/TEST-MIB:6: syntax error, unexpected DESCRIPTION, expecting LAST_UPDATED
/usr/share/snmp/mibs/TEST-MIB:13: missing MODULE-IDENTITY clause in SMIv2 MIB
/usr/share/snmp/mibs/TEST-MIB:10: unknown object identifier label `testMib'
smidump: module `/usr/share/snmp/mibs/TEST-MIB' contains errors, expect flawed output
smidump: aborting due to severe parsing errors
smidump: use the -k option to force continuation
share|improve this answer
This wasnt enough. i place it there, but in additional i need to create snmp.conf and define the mib file there – Avihai Marchiano Oct 31 '12 at 12:39
Did you already create this snmp.conf file with something like this inside? mibs +TEST-MIB (In my system it works without this, but it might help) – Claudio Oct 31 '12 at 12:41
I didnt have this file, so i added this file with 2 lines: mibfile and mibs (i think that mibfile is sufficient) , but without this file it wasnt work unless you do export for the session – Avihai Marchiano Oct 31 '12 at 12:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.