Automatically generate template xml file from MIB, zabbix

Install additional support for CentOS:
yum install "perl(SNMP)" "perl(XML::Simple)" -y
For Ubuntu:
apt-get install perl libxml-simple-perl libsnmp-perl -y
Install mib2zabbix binary::
curl -skL -o /usr/local/bin/mib2zabbix https://raw.githubusercontent.com/cavaliercoder/mib2zabbix/master/mib2zabbix.pl
Set the binary executable:
chmod +x /usr/local/bin/mib2zabbix
Enter default mibs directory:
cd /usr/share/snmp/mibs
Download example mib:
curl -s http://download2.mikrotik.com/Mikrotik.mib > MIKROTIK-MIB.txt
Take a look if anything inside:
snmptranslate -Tz -m ./MIKROTIK-MIB.txt
Translate 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=1
Other 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 message
Related:
https://github.com/cavaliercoder/mib2zabbix