Script that generate value mapping for Zabbix from specified oid
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Since Zabbix 3.0 it's possible to import/export value mappings in XML format or manage it via API. That script create mappings in XML format which you could import in Zabbix, all that you need - specify OID.


Perl: You need next perl modules: SNMP, XML::Simple In debian/ubuntu (tested on Jessie 8.3 and Trusty 14.04 respectively) you need next packages: libsnmp-perl and libxml-simple-perl

SNMP: You need to have properly configured SNMP. First check that snmp 'know' about OID in which you are interesting for. For example:

snmpget -v 2c -c public localhost   ifType.1
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)

Here you see that host return integer value 6 that was mapped to 'ethernetCsmacd'.

You can specify additional MIB directory, but i didn't test it, sorry.

Usage --oid OID::to_map [--name values_mappings_name] [--mibs-dir /path/to/mibs] [--dir] [--help] 

--oid - is mandatory option, you can specify it by name or in numerical form so for example IF-MIB::ifType, ifType or . will work in same way

--name - you can choose the name for your mapping, if not specified textual convention name or label will be used

--mibs-dir - you can add additional MIBs dir

--dir - by default script will write XML document right on your screen, if you will specify 'dir' option, script will create file in that directory

Examples: --oid .

Will print on display next xml:

<?xml version='1.0' standalone='yes'?>
</zabbix_export> --oid . --dir /tmp

Will write same xml in /tmp/snmpEnableAuthenTraps.xml