oid2valuemapping
Perl script which converts SNMP enumerations to XML template, which you will be able to import in Zabbix as values mapping.
Feature
- SNMP oid enumeration to zabbix mapping convertion
Requirements
- snmp package installed
- Perl with SNMP and XML::Simple
- echo.something module (thanks to Jean-Jacques Martrès)
Installation
- Install libsnmp-perl and libxml-simple-perl packages on Debian like systems
- Make sure that snmp configured correctly
Usage
oid2valuemapping.pl --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 .1.3.6.1.2.1.2.2.1.3 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 mapping will be printed in XML on STDOUT, if you specify 'dir' option, script will create XML file in that directory
Examples
oid2valuemapping.pl --oid .1.3.6.1.2.1.11.30
Output
<?xml version='1.0' standalone='yes'?>
<zabbix_export>
<date>2016-08-25T14:50:03Zdate>
<value_maps>
<value_map>
<name>snmpEnableAuthenTrapsname>
<mappings>
<mapping>
<newvalue>disablednewvalue>
<value>2value>
.....
</zabbix_export>
oid2valuemapping.pl --oid .1.3.6.1.2.1.11.30 --dir /tmp
Will write same xml in /tmp/snmpEnableAuthenTraps.xml
Listing Details
1 version, '2018-07-02 12:41' modified