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, etc.

informationMacro syntax supports white spaces.

ImportantMacros are case sensitive and should then always be written in uppercase.

General Macros

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

General Macros

Description

%{SEN_ALERT_DEFAULTCONTENT}

Default alert content suitable for events and annotations, which resolves to the following macro syntax:

%{SEN_GROUP_NAME}: %{SEN_HOST_NAME} %{SEN_PARAMETER_STATUS} on %{SEN_PARAMETER_NAME} of %{SEN_OBJECT_LABEL};

or

%{SEN_GROUP_NAME}: %{SEN_PARAMETER_STATUS} on %{SEN_PARAMETER_NAME} (When the macros is used at Group level).

%{SEN_ALERT_DEFAULTLOGMESSAGE}

Default alert content suitable for log files, which resolves to the following macro syntax:

%{SEN_TIME:%Y-%m-%d %H:%M:%S} %{SEN_GROUP_ID} %{SEN_PARAMETER_STATUS} on %{SEN_PARAMETER_NAME} of %{SEN_OBJECT_LABEL}.

%{SEN_CREDENTIALS}

System Crendentials.

%{SEN_HOST_DOMAIN}

Domain of the targeted host.

%{SEN_HOST_FQDN}

Fully qualified domain name of the targeted host.

%{SEN_HOST_IPADDRESS}

IP address of the targeted host.

%{SEN_HOST_NAME}

Name of the targeted host.

%{SEN_HOST_SNMPCOMMUNITY}

SNMP community set for the SNMP Agent on the targeted host.

%{SEN_HOST_SYSTEMTYPE}

Operating system type of the targeted host.

%{SEN_HOSTNAME}

Name of the monitored host as provided in the GUI.

%{SEN_INFORMATION}

Provides additional information about the problem/alert.

%{SEN_INFORMATIONONELINE}

Provides additional information about the problem/alert in a single line.

%{SEN_NEWLINE}

Inserts carriage return.

%{SEN_OBJECT_CLASS}

Class name of the object to which the alert action belongs.

%{SEN_OBJECT_ID}

PATROL ID of the object triggering the alert.

%{SEN_OBJECT_LABEL}

Display name of the object triggering the alert.

%{SEN_OBJECT_TYPE}

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

%{SEN_PARAMETER_ALARM1MAX}

Alarm1 maximum range of the parameter triggering the alert.

%{SEN_PARAMETER_ALARM1MIN}

Alarm1 minimum range of the parameter triggering the alert.

%{SEN_PARAMETER_ALARM1NTIMES}

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

%{SEN_PARAMETER_ALARM1TYPE}

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

%{SEN_PARAMETER_ALARM2MAX}

Alarm2 maximum range of the parameter triggering the alert.

%{SEN_PARAMETER_ALARM2MIN}

Alarm2 minimum range of the parameter triggering the alert.

%{SEN_PARAMETER_ALARM2NTIMES}

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

%{SEN_PARAMETER_ALARM2TYPE}

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

%{SEN_PARAMETER_BORDERMAX}

Border maximum range of the parameter triggering the alert.

%{SEN_PARAMETER_BORDERMIN}

Border minimum range of the parameter triggering the alert.

%{SEN_PARAMETER_BORDERNTIMES}

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

%{SEN_PARAMETER_BORDERTYPE}

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

%{SEN_PARAMETER_NAME}

Name of the parameter triggering the alert.

%{SEN_PARAMETER_STATUS}

Status of the parameter.

%{SEN_PARAMETER_VALUE}

Value of the parameter triggering the alert.

%{SEN_PARENT_<macro-name-without-SEN_>}

Gets the parent object's macro. The name of the parent's macro is copied in the syntax without the SEN_.

Example: In the case of String Search performed on a Command Line (parent) output, to read the full output from the alert action in LastMatchingLines, we need to read parent's %{SEN_RESULT}, which can be accessed using %{SEN_PARENT_RESULT}.

%{SEN_PARENT_CLASS}

Class name of the parent object to which the alert action belongs.

%{SEN_PARENT_ID}

PATROL identifier of the object's parent.

%{SEN_PARENT_LABEL}

Display name of the object’s parent.

%{SEN_PARENT_TYPE}

Type of the object’s parent. ("File", "CommandLine", etc.).

%{SEN_PASSWORD}

Encrypted password of the targeted host.

%{SEN_RESULT}

Query result received for the monitored object during data collection, when available.

%{SEN_STATUSINFORMATION}

Provides additional information about the Status, as reported by the StatusInformation parameter (where available).

%{SEN_TIME:<date-time-format>}

Time of the alert action with a configurable time format as described in the Format Symbols chapter.

Example: %{SEN_TIME:%H%M%S} may read 094517 at run time.

%{SEN_USERNAME}

Username to use to connect to the targeted host.

%{/...}

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).

Object Specific Macros

The macros listed below can be used with alert actions specifically for their respective object type.

hmtoggle_plus1Command Line Macros

Macros

Description

%{SEN_COMMANDLINE}

Command line being executed and analyzed.

%{SEN_EXITSTATUSCODE}

Exit status returned by the system after executing the command.

hmtoggle_plus1Database Macros

Macros

Description

%{SEN_DATABASENAME}

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

%{SEN_DATABASETYPE}

Type of the database.

%{SEN_QUERY}

SQL statement sent for execution.

hmtoggle_plus1Dynamic Object Macros

Macros

Description

%{SEN_RESULT}

Returns the output of the dynamic object.

hmtoggle_plus1Dynamic Value Map Macros

Macros

Description

% {SEN_RETAINEDVALUE}

Value retained by the collect and mapped to a status.

% {SEN_MAPPEDSTATUSINFORMATION}

Provides additional information about the Status of the value mapping result, as reported by the StatusInformation parameter.

hmtoggle_plus1File Macros

Macros

Description

%{SEN_FILENAME}

Name of the monitored file as entered in the GUI.

%{SEN_MONITOREDFILE}

Current file being monitored.

 

hmtoggle_plus1MFile System Macro

Macro

Description

%{SEN_FILESYSTEM}

Name of the monitored file system.

hmtoggle_plus1Folder Macros

Macro

Description

%{SEN_FOLDER}

Folder being monitored.

%{SEN_OLDESTFILESINFOLDER}

Name of the oldest file in the folder.

hmtoggle_plus1Group Macros

Macros

Description

%{SEN_GROUP_CLASS}

Class name of the Monitor Group.

%{SEN_GROUP_COLLECTIONERRORS}

List of collection errors that occurred between the current collect and the previous one

%{SEN_GROUP_CONTACT}

Contact information in case of a Group failure.

%{SEN_GROUP_DESCRIPTION}

Description of the Group.

%{SEN_GROUP_ID}

PATROL ID of the Group triggering the alert.

%{SEN_GROUP_LABEL}

Display name of the Group triggering the alert action.

%{SEN_GROUP_TYPE}

Type of the Group triggering the alert ("Group").

hmtoggle_plus1Host Macros

Macros

Description

%{SEN_AVAILABILITYCHECKS}

List of availability checks, separated by commas.

%{SEN_CREDENTIALSLIST}

List of credentials, separated by commas.

%{SEN_SIGNATUREFILES}

List of signatures files, separated by commas.

%{SEN_TCPPORT}

Port number used for the TCP availability check.

hmtoggle_plus1Multi-Parameter Formula Macro

Macros

Description

%{SEN_FORMULA}

User-defined formula used to calculate the parameter value.

hmtoggle_plus1 Process Macros

Macros

Description

%{SEN_COMMANDLINE}

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

%{SEN_MATCHINGPROCESSES}

List of all matching processes.

%{SEN_PIDFILE}

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

%{SEN_PROCESSNAME}

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

%{SEN_USERID}

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

%{SEN_WORSTPROCESS_COMMANDLINE}

Command line of the first worst process.

%{SEN_WORSTPROCESS_NAME}

Name of the first worst process.

%{SEN_WORSTPROCESS_PID}

PID of the first worst process.

%{SEN_WORSTPROCESS_PPID}

PPID of the first worst process.

%{SEN_WORSTPROCESS_STATE}

State of the first worst process.

%{SEN_WORSTPROCESS_USERNAME}

Username of the first worst process.

%{SEN_WORSTPROCESSES}

List of worst processes, semicolon delimited, containing PID, process name, username, PPID, state and command line.

hmtoggle_plus1SNMP Polling Macros

Macros

Description

%{SEN_CONTENT}

Value of the OID being polled.

%{SEN_OID}

SNMP OID being polled.

hmtoggle_plus1SNMP Trap Macros

Macros

Description

%{SEN_CONTENT}

Content of the found trap.

%{SEN_ENTERPRISEID}

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

%{SEN_FOUNDIP}

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

%{SEN_FOUNDTRAPNUMBER}

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

%{SEN_TRAPNUMBER}

SNMP Trap numbers (specific numbers) being looked for.

hmtoggle_plus1String Search Macros

Macros

Description

%{SEN_LASTMATCHINGLINE}

Last line that matches with the string search criteria.

%{SEN_LASTMATCHINGLINES}

Last 10 lines that match with the string search criteria.

%{SEN_STRING1}

First regular expression being searched for.

%{SEN_STRING2}

Second regular expressions being searched for.

hmtoggle_plus1Value Map Macros

Macros

Description

% {SEN_RETAINEDVALUE}

Value retained by the collect and mapped to a status.

% {SEN_MAPPEDSTATUSINFORMATION}

Provides additional information about the status of the value mapping result, as reported by the StatusInformation parameter.

 

hmtoggle_plus1WBEM Query Macros

Macros

Description

%{SEN_NAMESPACE}

Namespace of the WBEM query.

%{SEN_QUERY}

WBEM statement sent for execution.

 

hmtoggle_plus1Web Request Macros

Macros

Description

%{SEN_HTTPMETHOD}

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

%{SEN_URL}

URL being tested.

 

hmtoggle_plus1WMI Macros

 

Macros

Description

%{SEN_NAMESPACE}

Namespace of the WMI query.

%{SEN_QUERY}

WMI statement sent for execution.

 

 

hmtoggle_plus1Windows Event Macros

Macros

Description

%{SEN_CONTENT}

Message content of the last matching event.

%{SEN_EVENTID}

ID of the Windows events being searched for.

%{SEN_EVENTLOG}

Name of the Windows event log being monitored.

%{SEN_MATCHINGEVENTS}

List of matching events.

%{SEN_PROVIDER}

Windows Event source whose new entries are monitored.

%{SEN_RECORDNUMBER}

Last matching event record number

hmtoggle_plus1Windows Performance Macros

Macros

Description

%{SEN_PERFORMANCECOUNTER}

Windows performance counter being monitored.

%{SEN_PERFORMANCEINSTANCE}

Windows performance object instances being monitored.

%{SEN_PERFORMANCEOBJECT}

Windows performance object name being monitored.

hmtoggle_plus1Windows Service Macro

Macros

Description

%{SEN_SERVICENAME}

Name of the service of a Windows service class.