Skip to content

 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$6.99 $9.99 Paperback 
$22.99 $29.99

Design Patterns in TypeScript
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99

Design Patterns in Python
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99

Convert MIBs Files to Zabbix Templates

Video Lecture

Convert MIBs Files to Zabbix Templates Convert MIBs Files to Zabbix Templates Convert MIBs Files to Zabbix Templates


MIB files can be analysed and converted to Zabbix templates containing Items, Discovery Rules and Value Types.

One script for doing this is called mib2zabbix and can be downloaded from

Before running this script, you should already have the required SNMP dependencies installed and configured correctly.

On Ubuntu and other Debian based systems,

sudo apt-get update
sudo apt install snmp
sudo apt install snmp-mibs-downloader

On Centos and other Red-Hat based systems

yum check-update
yum install net-snmp-utils
yum install net-snmp-libs

Now configure the snmp.conf to return MIBs descriptions.

sudo nano /etc/snmp/snmp.conf

Comment out the mibs line like this,


Do a simple test.

The response should be

This is a MIB description of the OID

snmptranslate is now able to translate, and this is required before you can continue. is written in perl, so you will need to install the perl dependencies.

On Ubuntu

apt-get install perl libxml-simple-perl libsnmp-perl

On Centos

yum install "perl(SNMP)" "perl(XML::Simple)"


On CentOS 8, you may get the error that the perl snmp libs cannot be found. You can download the rpm first from rpm -ivh and then try again.

Next, get the mib2zabbix perl script

curl > mib2zabbix
wget -O mib2zabbix

Give the mib2zabbix file execute permissions.

chmod a+x mib2zabbix

Test it

./mib2zabbix -h

The response should be

Usage: -o <OID> [OPTIONS]...

    Export loaded SNMP MIB OIDs to Zabbix Template XML

        -f, --filename=PATH         output filename (default: stdout)

        -N, --name=STRING           template name (default: OID label)
        -G, --group=STRING          template group (default: 'Templates')
        -e, --enable-items          enable all template items (default: disabled)

        -o, --oid=STRING            OID tree root to export

        -v, --snmpver=1|2|3         SNMP version (default: 2)
        -p, --port=PORT             SNMP UDP port number (default: 161)

    SNMP Version 1 or 2c specific

        -c, --community=STRING      SNMP community string (default: 'public')

    SNMP Version 3 specific

        -L, --level=LEVEL           security level (noAuthNoPriv|authNoPriv|authPriv)
        -n, --context=CONTEXT       context name
        -u, --username=USERNAME     security name
        -a, --auth=PROTOCOL         authentication protocol (MD5|SHA)
        -A, --authpass=PASSPHRASE   authentication protocol passphrase
        -x, --privacy=PROTOCOL      privacy protocol (DES|AES)
        -X, --privpass=PASSPHRASE   privacy passphrase

    Zabbix item configuration

        --check-delay=SECONDS       check interval in seconds (default: 60)
        --disc-delay=SECONDS        discovery interval in seconds (default: 3600)
        --history=DAYS              history retention in days (default: 7)
        --trends=DAYS               trends retention in days (default: 365)

        -h, --help                  print this message

If you get anything else then perl was not installed properly or it cannot find mib2zabbix. Check the error in the console.

Now to ensure you have the required MIB file that you want to convert.

A good example may be the HUAWEI-MIB.mib.

You can usually find the MIB files you need on the internet.

You can download the HUAWEI-MIB.mib from here.

curl > HUAWEI-MIB.mib 
wget -O HUAWEI-MIB.mib

Next, see if snmptranslate can read this file.

snmptranslate -Tz -m ./HUAWEI-MIB.mib

You should see this plus many more lines showing the MIBs and their OIDs,

"org"                   "1.3"
"dod"                   "1.3.6"
"internet"              ""
"directory"             ""
"mgmt"                  ""
"mib-2"                 ""

Now it is time to convert it to a template for Zabbix by piping the snmptranslate response into mib2zabbix.

snmptranslate -Tz -m ./HUAWEI-MIB.mib | ./mib2zabbix -o . -f template-huawei-mib.xml -N huawei-mib

This will create a new file called template-huawei-mib.xml with the name huawei-mib within the xml.


<?xml version="1.0" encoding="UTF-8"?>
... etc, many more lines of xml

This new xml file can be imported into Zabbix


See video for a more detailed demonstration and recommendations. Also note that all items, discovery rules and their item prototypes will be disabled by default. You should decide which is important to enable for your needs based on the devices official documentation. Enabling all items, discovery rules and their item prototypes may put unnecessary strain on your Zabbix server resources and the SNMP device so it is important to check what you actually need.

Cisco SNMP V2 Public Mibs MIB files repository