Map definition file
The map definition file defines how the gateway maps data received from the OS tables into SNMP traps.
The default map definition file is $OMNIHOME/gates/snmp/snmp.map.
Syntax
You can configure the mapping functions of the gateway by using the mapper attributes.
Mappings for use with the SNMP Writer Gateway must use
the following syntax:
CREATE MAPPING mappingname
(
'varbindint' = ’@fieldname’,
['varbindint' = ’@fieldname’ [ ON INSERT ONLY ], ]...
) ;
where:- mappingname is the name of the mapping to be created.
- varbindint is the integer value for the
varbindfield in the SNMP trap. - fieldname is the name of a field in the ObjectServer
alerts.statustable.
Example mapping
The following
default mapping
is supplied in the
snmp.map file:CREATE MAPPING StatusMap
(
'0' = '@Summary',
'1' = '@Severity',
'2' = '@Location',
'3' = '@Node',
'4' = '@AlertGroup',
'Node' = '@Node'
);Defining a lookup table
You can define a lookup table within the map file and use it to transform values found in particular fields to a different set of values before constructing SNMP traps.
The following is an example lookup table
definition:
CREATE LOOKUP ExampleTable (
{ 'source1', 'target1'},
{ 'source2', 'target2'}
) DEFAULT = '' ;This example is used in the map as follows:
It is important to convert @myfield to be compatible with its respective CREATE LOOKUP datatype.
'3' = Lookup('@myfield', 'ExampleTable')
For example:
CREATE LOOKUP SeverityTable (
{'0','Clear'},
{'1','Indeterminate'},
{'2','Warning'},
{'3','Minor'},
{'4','Major'},
{'5','Critical'}
) DEFAULT = 'Unknown' ;
CREATE MAPPING StatusMap
(
'0' = '@Summary',
'1' = Lookup(TO_STRING('@Severity'), 'SeverityTable'),
'2' = '@Location',
'3' = '@Node',
'4' = '@AlertGroup',
'Node' = '@Node'
)
Note: Changes
or additions to the lookup table will only take effect after the gateway
is stopped and restarted.