yum install "perl(SNMP)" "perl(XML::Simple)" -yFor Ubuntu:apt-get install perl libxml-simple-perl libsnmp-perl -yInstall mib2zabbix binary::curl -skL -o /usr/local/bin/mib2zabbix https://raw.githubusercontent.com/cavaliercoder/mib2zabbix/master/mib2zabbix.plSet the binary executable:chmod +x /usr/local/bin/mib2zabbixEnter default mibs directory:cd /usr/share/snmp/mibsDownload example mib:curl -s http://download2.mikrotik.com/Mikrotik.mib > MIKROTIK-MIB.txtTake a look if anything inside:snmptranslate -Tz -m ./MIKROTIK-MIB.txtTranslate to template:snmptranslate -Tz -m ./MIKROTIK-MIB.txt | mib2zabbix -o .1.3.6.1 -f ~/file.xml -e -G custom -N "Mikrotik auto" --disc-delay=60 --history=1 --trends=1Other options:mib2zabbix.pl -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 (must start with '.')
-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 messageRelated:https://github.com/cavaliercoder/mib2zabbix