Alert Action Macros

Home  Previous  Next

A macro is a variable whose value is replaced when an Alert Action is triggered. Macros can be used to customize the content of each Alert Action. For example: %{VALUE} is replaced by the actual current value of the parameter that triggered the alert.

Each macro listed in the tables below contains information about what triggered the PATROL alert. Some macros are "general" or "common" - these can be used for any object, and some are "object-specific" macros that are specific to the object, such as databases or files or JMX applications etc.

General Macros

The macros given in the table below can be used on any object:

General Macros

Description

%{PARAMETER_NAME}

Name of the parameter triggering the alert.

%{VALUE}

Value of the parameter triggering the alert.

%{ALARM_TYPE}

Type of the alert triggered (ALARM, WARN or INFORMATION).

%{OBJECT_ID}

PATROL ID of the object triggering the alert.

%{OBJECT_LABEL}

Display name of the object triggering the alert.

%{OBJECT_CLASS}

Class (".KM") of the object triggering the alert.

%{OBJECT_TYPE}

Type of the object triggering the alert ("Process", "String", etc.).

%{PARENT_<PARENT MACRO>}

Gets the parent's object of a macro.

Example: In the case of String Search performed in Command Line, use the following macro to get complete command line return output:
%{PARENT_OSCOMMAND_RETURN_OUTPUT}

%{PARENT_ID}

ID of the object’s parent triggering the alert (the parent of a String object could be a LOG file, e.g.).

%{PARENT_LABEL}

Display name of the object’s parent triggering the alert.

%{PARENT_CLASS}

Class (".KM") of the object’s parent triggering the alert.

%{PARENT_TYPE}

Type of the object’s parent triggering the alert ("File", "OSCommand", etc.).

%{APPLICATION_ID}

PATROL ID of the application triggering the alert.

%{APPLICATION_LABEL}

Display name of the application triggering the alert.

%{APPLICATION_CLASS}

Class (".KM") of the application triggering the alert.

%{APPLICATION_TYPE}

Type of the application triggering the alert ("Application").

%{APPLICATION_CONTACT}

Contact information in case of an application failure.

%{APPLICATION_DESCRIPTION}

Description of the application.

%{APPLICATION_EXISTENCEFILES}

List of files that identify the application as present.

%{ASCTIME:…}

Current time when the Alert Action is performed. Specify a formatting as described under Format Symbols in the Reference section.

Example: %{TIME:%H:%M:%S} will be replaced by 09:45:17 at run time.

Note: %{TIME:…} is also accepted.

%{NEWLINE}

Inserts carriage return.

%{/...}

Recommended for advanced users only.

Provides an internal instance variable name to be inserted. The path is relative to the object triggering the alert.

Example: %{/worstParam} will  contain the name of the worst parameter on this instance, which is an application instance built-in variable (see the "PATROL Script Language Reference" document).

%{BORDER_TYPE}

Border alert type of the parameter triggering the alert (OK, WARN, ALARM).

%{BORDER_MIN}

Border minimum range of the parameter triggering the alert.

%{BORDER_MAX}

Border maximum range of the parameter triggering the alert.

%{BORDER_NTIMES}

Number of consecutive times the parameter triggering the alert must have a value outside the border range before the alert occurs.

%{ALARM1_TYPE}

Alarm alert type of the parameter triggering the alert (OK, WARN, ALARM).

%{ALARM1_MIN}

Alarm1 minimum range of the parameter triggering the alert.

%{ALARM1_MAX}

Alarm1 maximum range of the parameter triggering the alert.

%{ALARM1_NTIMES}

Number of consecutive times the parameter triggering the alert must have a value within the alarm1 range before the alert occurs.

%{ALARM2_TYPE}

Alarm2 alert type of the parameter triggering the alert (OK, WARN, ALARM).

%{ALARM2_MIN}

Alarm2 minimum range of the parameter triggering the alert.

%{ALARM2_MAX}

Alarm2 maximum range of the parameter triggering the alert

%{ALARM2_NTIMES}

Number of consecutive times the parameter triggering the alert must have a value within the alarm2 range before the alert occurs.

Object Specific Macros

Click the following sections to display the list of macros specific to each object type.

Click to expand section Database Macros

Macros

Description

%{DATABASE_TYPE}

Type of the database.

%{DATABASE_QUERY}

SQL statement sent for execution.

%{DATABASE_NAME}

Name of the database the SQL query is sent to. May be the database name for SQL Server, or the Oracle SID for Oracle.

%{DATABASE_RETURN_OUTPUT}

Output returned by the SQL statement.

%{SW_USERNAME}

Username configured to connect to the database and execute the SQL statement.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section Dynamic Objects Macros

Macros

Description

%{DYNAMIC_RETURN_OUTPUT}

Returns the output of the dynamic object.

Click to expand section File Macro

Macros

Description

%{FILE_CURRENT_NAME}

Current file being monitored when monitoring a file whose name changes over time).

%{FILE_NAME}

Name of the monitored file as entered in the GUI.

%{SW_USERNAME}

Username configured to monitor to the LOG file.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section File System Macro

Macro

Description

%{FILESYSTEM_NAME}

Name of the monitored file system.

Click to expand section Folder Macro

Macro

Description

%{FOLDER_PATH}

Folder being monitored.

%{FOLDER_OLDEST_REMAINING_FILE}

Name of the oldest remaining file in the folder.

Click to expand section HTTP Macros

Macros

Description

%{HTTP_RETURN_OUTPUT}

Result of the HTTP request.

%{HTTP_METHOD}

GET or POST depending on what was selected in the GUI.

%{HTTP_URL}

URL being tested.

Click to expand section JMX Macros

Macros

Description

%{JMXPOLLING_SERVER_TYPE}

Type of JMX server being polled.

%{JMXPOLLING_HOST}

Hostname of JMX server polled.

%{JMXPOLLING_PORT}

Port number of the JMX server polled.

%{JMXPOLLING_DOMAIN}

Domain of the JMX server polled.

%{JMXPOLLING_KEY_PROPERTY}

Key property of the JMX server polled.

%{JMXPOLLING_ATTRIBUTE}

Attribute of the JMX server polled.

%{JMXPOLLING_CONTENT}

Content of the result output of the JMX server polled.

%{SW_USERNAME}

Username configured to connect to the JMX server.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section Multi-Parameter Formula Macros

Macros

Description

%{MPF_FORMULA}

User-defined formula used to rescale the parameter value.

Click to expand section OS Command Macros

Macro

Description

%{OSCOMMAND_OSCOMMAND}

Command line being executed and analyzed.

%{OSCOMMAND_RETURN_OUTPUT}

Return output of the OS command.

%{OSCOMMAND_EXIT_STATUS_CODE}

Exit status returned by the system after executing the command.

%{SW_USERNAME}

Username configured to execute the OS command.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section Process Macros

Macro

Description

%{PROCESS_NAME}

Process name being searched for, as entered in the GUI.

%{PROCESS_COMMAND_LINE}

Process command line being searched for, as entered in the GUI.

%{PROCESS_USER_ID}

Process user ID being searched for, as entered in the GUI.

%{PROCESS_PID_FILE}

Path to the PID file whose corresponding process is being monitored.

Click to expand section SNMP Polling Macros

Macros

Description

%{SNMPPOLLING_OID}

SNMP OID being polled.

%{SNMPPOLLING_HOST}

SNMP Agent’s hostname being polled.

%{SNMPPOLLING_COMMUNITY}

SNMP community string being used to query the SNMP agent.

%{SNMPPOLLING_PORT}

UDP port being used to poll the SNMP agent. 161 by default.

%{SNMPPOLLING_CONTENT}

Value of the OID being polled.

Click to expand section SNMP Trap Macros

Macros

Description

%{SNMPTRAP_IP}

Originating IP Address of the SNMP traps being looked for.

%{SNMPTRAP_FOUNDIP}

Actual originating IP address of the trap that has been received.

%{SNMPTRAP_COMMUNITY}

SNMP community string of the SNMP traps being looked for.

%{SNMPTRAP_ENTERPRISEID}

Enterprise ID (OID) of the SNMP traps being looked for.

%{SNMPTRAP_TRAPNUMBER}

SNMP Trap numbers (specific numbers) being looked for.

%{SNMPTRAP_FOUNDTRAPNUMBER}

Actual SNMP trap number that has been received and matches the entered criteria.

%{SNMPTRAP_CONTENT}

Content of the found trap.

Click to expand section String Search Macros

Macros

Description

%{STRING_SEARCHED_1}

First regular expression being searched for.

%{STRING_SEARCHED_2}

Second regular expressions being searched for.

%{STRING_LAST_MATCHING_LINE}

Last line that match with the String search criteria.

%{STRING_LAST_MATCHING_LINES}

Last 10 lines that match with the String search criteria.

Click to expand section WBEM Macros

Macros

Description

%{WBEM_HOST}

Name of host where the WBEM query is being run.

%{WBEM_NAME_SPACE}

Namespace of the WBEM query.

%{WBEM_QUERY}

WBEM statement sent for execution.

%{WBEM_USERNAME}

WBEM execution username.

%{WBEM_RETURN_OUTPUT}

Content of the result output of the WBEM query.

%{SW_USERNAME}

WBEM execution username.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section WMI Macros

Macros

Description

%{WMI_HOST}

Name of host where the WMI query is being run.

%{WMI_NAME_SPACE}

Namespace of the WMI query.

%{WMI_QUERY}

WMI statement sent for execution.

%{WMI_USERNAME}

WMI execution username.

%{WMI_RETURN_OUTPUT}

Content of the result output of the WMI query.

%{SW_USERNAME}

WMI execution username.

%{SW_PASSWORD}

Password associated with the configured username.

Click to expand section Windows Event Macros

Macros

Description

%{NTEVENT_LOG}

Name of the Windows event log being monitored.

%{NTEVENT_SOURCE}

Windows Event source whose new entries are monitored.

%{NTEVENT_ID}

ID of the Windows events being searched for.

%{NTEVENT_LAST_MATCHING}

Last matching event found.

%{NTEVENT_LAST_MATCHING_CONTENT}

Content of the NT event.

Click to expand section Windows Performance Macros

Macros

Description

%{PERFORMANCE_INSTANCELIST}

Windows performance object instances being monitored.

%{PERFORMANCE_COUNTER}

Windows performance counter being monitored.

%{PERFORMANCE_PERFORMANCE}

Windows performance object name being monitored.

Click to expand section Windows Service Macros

Macros

Description

%{SERVICE_NAME}

Name of the service of an NT service class.

 

 


See Also

Alert Actions capabilities

Alert Actions example

Format symbols for %{ASCTIME:...}