Alert Actions 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 attribute that triggered the alert.

Each macro listed in the tables below contains information about what triggered the 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.

ImportantPlease note that macros are case sensitive and should then always be written in upper case.

General Macros

The macros listed in the table below can be used with alert actions on any object.

General Macro

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}

Username of the Host as provided in CMA for a Monitor Group.

%{SEN_DATE}

Date on which the alert action is performed (YYYY-MM-DD format).

%{SEN_GROUP_CLASS}

Class name of the Monitor Group.

%{SEN_GROUP_COLLECTIONERRORS}

All collection errors collected for the Monitor Group at the time of the alert action.

%{SEN_GROUP_CONTACT}

Contact information for the Monitor Group, if set under PATROL configuration /SENTRY/STUDIO/<groupID>/contact.

%{SEN_GROUP_DESCRIPTION}

Description for the Monitor Group, if set under PATROL configuration /SENTRY/STUDIO/<groupID>/description.

%{SEN_GROUP_ID}

PATROL identifier of the Monitor Group.

%{SEN_GROUP_LABEL}

Name of the Monitor Group triggering the alert action.

%{SEN_GROUP_TYPE}

Type of the Monitor Group triggering the alert.

%{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 CMA.

%{SEN_INFORMATION}

Detailed information about the alert.

%{SEN_INFORMATIONONELINE}

Detailed information about the alert in a single line (no carriage return).

%{SEN_NEWLINE}

Inserts carriage return.

%{SEN_OBJECT_CLASS}

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

%{SEN_OBJECT_ID}

PATROL identifier 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}

Display 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's object's macro. The name of the parent's macro is copied in the syntax without the SEN_

Example: In the case of a String Search performed on a Command Line (parent) output, to read the full output from the alert action in LastMatchingLines, the solution needs 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}

Name of the object’s parent triggering the alert.

%{SEN_PARENT_TYPE}

Type of the object’s parent triggering the alert ("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 detailed information about the Status attribute of the monitored object, when available.

%{SEN_TIME}

Time of the alert action (in HH-MM-SS format).

%{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.

%{/...}

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

Object Specific Macros

Click the following sections to display the list of macros that can be used with alert actions specifically for their respective object type.

Click to expand section Command Line Macros

Macros

Description

%{SEN_COMMANDLINE}

Command line being executed and analyzed.

%{SEN_EXITSTATUSCODE}

Exit status returned by the system after executing the command.

Click to expand section Database Macros

Macros

Description

%{SEN_DATABASENAME}

Name of the database the SQL query is sent to. For example, 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.

Click to expand section File Macros

Macros

Description

%{SEN_FILENAME}

Name of the monitored file as entered in CMA.

%{SEN_MONITOREDFILE}

Current file being monitored.

Click to expand section File System Macros

Macros

Description

%{SEN_FILESYSTEM}

Name of the monitored file system.

Click to expand section Folder Macro

Macros

Description

%{SEN_FOLDER}

Name of the folder being monitored.

%{SEN_OLDESTREMAININGINFOLDER}

Name of the oldest remaining file in the folder.

Click to expand section Host 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 to perform the TCP availability check.

Click to expand section Multi-Parameter Formula Macro

Macros

Description

%{SEN_FORMULA}

User-defined formula used to calculate the parameter value.

Click to expand section Process Macros

Macros

Description

%{SEN_COMMANDLINE}

Process command line being searched for, as entered in CMA.

%{SEN_MATCHINGPROCESSES}

List of all the processes that match the search criteria.

%{SEN_PIDFILE}

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

%{SEN_PROCESSNAME}

Process name being searched for, as entered in CMA.

%{SEN_USERID}

Process user ID being searched for, as entered in CMA.

%{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}

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

Click to expand section SNMP Polling Macros

Macros

Description

%{SEN_CONTENT}

Content of the OID being polled.

%{SEN_OID}

SNMP OID being polled.

Click to expand section SNMP 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.

Click to expand section String 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.

Click to expand section Web Request Macros

Macros

Description

%{SEN_HTTPMETHOD}

Displays whether the GET or POST request type is used to perform the query.

%{SEN_URL}

URL of the targeted Web page.

Click to expand section WBEM Macros

Macros

Description

%{SEN_NAMESPACE}

Namespace of the WBEM query.

%{SEN_QUERY}

Executed WBEM query.

Click to expand section Windows Event Macros

Macros

Description

%{SEN_MATCHINGEVENTS}

List of matching events.

%{SEN_PROVIDER}

Name of the event provider.

%{SEN_EVENTID}

Monitored event IDs as configured in the Monitor.

%{SEN_EVENTLOG}

Name of the monitored event log.

%{SEN_CONTENT}

Message content of the last matching event.

%{SEN_RECORDNUMBER}

Last matching event record number.

Click to expand section Windows 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.

Click to expand section Windows Service Macros

Macros

Description

%{SEN_SERVICENAME}

Name of the monitored Windows service.

Click to expand section WMI Macros

Macros

Description

%{SEN_NAMESPACE}

Namespace of the WMI query.

%{SEN_QUERY}

Executed WMI query.