Administer > Policies > Perl Script Policies > Perl Policy User Interface > Configuring Mappings in Perl Script Policies

Configuring Mappings in Perl Policies (Events and Metrics Only)

The Mappings page enables you to map attribute keys gathered with the Perl script to custom variables.

To access

  • In the Operations Connector user interface, click Create in the toolbar. Then click Event > REST Web service listener Perl Script.

  • In the Operations Connector user interface, click Create in the toolbar. Then click Metric > REST Web service listener Perl Script.

Alternatively, double-click an existing policy to edit it.

Click Mappings to open the policy Mappings page.

Mappings overview

A custom variable consists of a map name, a key attribute name, and one or more source and target value pairs. For example, you can assign the data key name Severity to the map name mapSeverity, and add a source value of 2. You can then assign the target value Critical to the variable so that Operations Connector inserts the value Critical into the event in all places where the variable is used.

Perl attribute key names use the following syntax:

<$DATA:<AttributeName>>

where <AttributeName> is the data key name in a Perl hash array.

Tasks

How to configure Perl mappings (events and metrics)

This task describes how to map result data key names to custom variables.

  1. Create one or more custom variables.

    Drag the data keys from the Data Key names list to the Map Name column. Operations Connector automatically adds the default prefix map to the map name and inserts the correct Input Data Property.

    Alternatively, click above the Map Name column and type the Data key name in the map name field.

  2. Add source and target value pairs to each custom variable.

    • Click above the Source Value column and type the source and target values in the corresponding fields.

    • Optional. In the Indicators tab, add indicators to the source or target value fields. After loading the indicators from the OMi server, the Indicators tab shows a hierarchy of configuration item types.

      To insert an indicator in a source or target value field, drag the indicator state (for example, HTTPServer:Normal) from the Indicators tab and drop it on the corresponding field.

    • Optional. In the Policy Variables tab, add policy variables to event or metric attributes. Operations Connector replaces the variables with the appropriate values in the generated event or metric.

      Use quotation marks to surround variables, for example "<$MSG_NODE>" or "<$MSG_GEN_NODE>", at least for those variables whose values can contain space characters.

Related tasks

UI Descriptions

Default Value Mappings

UI Element Description
Create new mapping definition. Adds a new mapping definition to the list of mappings.
Delete mapping definition. Deletes the selected mapping definition.
Copy Mapping Definition. Creates a copy of the selected mapping definition.
Move Up. Moves the selected mapping definition up to a higher position.
Move Down. Moves the selected mapping definition down to a lower position.
Map Name Name of the custom variable. Operations Connector automatically adds the default prefix map to the map name if the variable has been created from sample data.
Input Data Property

Data key assigned to the custom variable.

Perl attribute key names use the following syntax:

<$DATA:<AttributeName>>

where <AttributeName> is the data key name in a Perl hash array.

Operations Connector replaces the attribute name at runtime with the value of the specified key.

Create new mapping. Adds a new pair of source and target values to the mapping definition.
Delete mapping. Deletes the selected source and target value pair.
Copy Value Mapping. Creates a copy of the selected value mapping.
Move Up. Moves the selected value mapping up to a higher position.
Move Down. Moves the selected value mapping down to a lower position.
Source Value

Original value of the input data reference.

Target Value

New value of the input data reference.

Data Key names Tab

UI Element Description
Data key names

Displays the names of the data keys.

Indicators Tab

UI Element

Description

Refresh. Loads the configured indicators from the connected OMi server.

  • Loading indicators from the OMi server may take a few seconds.

  • The Operations Connector server must be configured as an Operations Connector integration server in OMi for the indicators to load successfully.

<Search …>

Entered search string is used to search the indicators and highlight only the indicators containing the specified string.

To search for indicators with specific text strings in the name, type the string in the <Search …> field and click the button. The first matching indicator is selected in the list of rules. Click the and buttons to move to the previous and next matching indicator.

<Indicators>

Hierarchy of configuration item types with associated health indicators (HIs), which are applicable for the event integration only, and event type indicators (ETIs). To insert an indicator with a state in a policy, drag and drop the indicator from the Indicators tab to the relevant field in the policy.

Policy VariablesTab

Policy Variables Tab for Database and REST Web Service Listener Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.
<$MSG_TEXT> Returns the full text of the event. For open message interface policies, this value is the msg_text parameter submitted by the opcmsg command. For the Windows Event Log this value is the event ID and description. Sample output: SU 03/19 16:13 + ttyp7 bill-root

Policy Variables Tab for XML File and Structured Log File Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.

Policy Variables Tab for Open Message Interface, Scheduled Task, and SNMP Interceptor Policies (Events only)

Variable Description
<$MSG_NODE> Returns the IP address of the node on which the original event took place. Sample output: 192.168.1.123
<$MSG_NODE_NAME> Returns the name of the node on which the original event took place. This is the hostname that the agent resolves for the node. This variable is not fixed, however, and can be changed by a policy on a per-event basis.
<$MSG_TEXT> Returns the full text of the event. For open message interface policies, this value is the msg_text parameter submitted by the opcmsg command. For the Windows Event Log this value is the event ID and description. Sample output: SU 03/19 16:13 + ttyp7 bill-root
<$NAME> (Scheduled Task Only) Returns the name of the policy that sent the event. Sample output: cpu_util
<$OPTION(N)> (Open Message Interface Only) Returns the value of an optional variable that is set by opcmsgor opcmon (for example, <$OPTION(A)>, < $OPTION(B)>, and so on.).
<$PROG> (Scheduled Task Only) Returns the name of the program executed by the scheduled task policy Sample output: check_for_upgrade.bat
<$USER> (Scheduled Task Only) Returns the name of the user under which the scheduled task was executed. Sample output: administrator

Policy Variables Tab for All Policy Types (Metrics only)

Variable Description
<$MSG_GEN_NODE>

Returns the IP address of the node that sends the event. Sample output: 192.168.1.123.

<$MSG_GEN_NODE_NAME> Returns the host name of the node that sends the event. Sample output: node123.example.com.