Alert templates v10.3
An alert template is a prototype that defines the properties of an alert. An alert instructs the server to compare the current state of the monitored object to a threshold specified in the alert template to determine if a situation requires administrative attention.
You can use the Alert Templates tab to define a custom alert template or view the definitions of existing alert templates. To open the Alert Templates tab, select Management > Alerts > Manage Alerts. From the Manage Alerts tab, on the Quick Links toolbar, select Alert Templates.
Use the Show System Template list to filter the alert templates that are displayed in the Alert Templates table. From the list, select a level of the PEM hierarchy to view all of the templates for that level.
Defining a new alert template
To define a new alert template, from the Show System Template list, select None. Then click the plus sign (+) in the upper-right corner of the alert template table. The alert template editor opens.
Use fields on the General tab to specify general information about the template:
Use the Template name field to specify a name for the new alert template.
Use the Description field to provide a description of the alert template.
Use the Target type list to select the type of object that is the focus of the alert.
Use the Applies to server list to specify the server type (EDB Postgres Advanced Server or PostgreSQL) to which to apply the alert. You can specify a single server type or ALL.
Use the History retention field to specify the number of days to store the result of the alert execution on the PEM server.
Use the Threshold unit field to specify the unit type of the threshold value.
Use fields in the Auto create box to specify for PEM to use the template to generate an automatic alert. If you enable this option, PEM creates an alert when a new server or agent, as specified by the Target type list, is added and deletes that alert when the target object is dropped.
- Move the Auto create? slider to Yes to specify for PEM to create alerts based on the template.
- Use the Operator list to select the operator for PEM to use when evaluating the current system values.
Select a greater-than sign (>) to trigger the alert when the system values are greater than the values entered in the Threshold values fields.
Select a less-than sign (<) to indicate to trigger the alert when the system values are less than the values entered in the Threshold values fields.
Use the threshold fields to specify the values for PEM to compare to the system values to determine whether to raise an alert. You must specify values for all three thresholds (Low, Medium, and High).
Use the Check frequency field to specify the default number of minutes between alert executions. This value specifies how often the server invokes the SQL code specified in the definition and compares the result to the threshold value specified in the template.
Use the fields on the Probe Dependency tab to specify the names of probes referred to in the SQL query specified on the SQL tab:
Use the Probes list to select from a list of the available probes.
- To add the probe to the list of probes used by the alert template, select a probe name and select Add.
- To remove a probe from the selected probes list, select the probe name and select Delete.
Use the Parameters tab to define the parameters to use in the SQL code specified on the SQL tab. Select the plus sign (+). Then:
Use the Name field to specify the parameter name.
Use the Data type list to specify the type of parameter.
Use the Unit field to specify the type of unit specified by the parameter.
Use the Code field on the SQL tab to provide the text of the SQL query for the server to invoke when executing the alert. The SQL query provides the result against which to compare the threshold value. If the alert result deviates from the specified threshold value, an alert is raised.
In the query, reference parameters defined on the Parameters tab sequentially by using the variable param_x. The x indicates the position of the parameter definition in the parameter list. For example, param_1 refers to the first parameter in the parameter list, param_2 refers to the second parameter in the parameter list, and so on.
The query can also include the following variables:
| Variable description | Variable name |
|---|---|
| agent identifier | '${agent_id}' |
| server identifier | '${server_id}' |
| database name | '${database_name}' |
| schema name | '${schema_name}' |
| Table | '${object_name}' |
| index | '${object_name}' |
| sequence | '${object_name}' |
| function name | '${object_name}' |
- Use the Detailed Information SQL field to provide a SQL query to invoke if the alert is triggered. The result set of the query might be displayed as part of the detailed alert information on the Alerts dashboard or Global Overview dashboard.
Note
If the specified query depends on one or more probes from different levels in the PEM hierarchy (server, database, schema, and so on), and a probe becomes disabled, any resulting alerts are displayed as follows:
- If the alert definition and the probe referenced by the query are from the same level in the PEM hierarchy, the server displays any alerts that reference the alert template on the Alert Error table of the Global Alert dashboard.
- If the alert definition and the probe referenced by the query are from different levels of the PEM hierarchy, the server displays any triggered alerts that reference the alert template on the Alert Details table of the hierarchy on which the alert was defined.
To save your changes, select Done on the template creation panel. This will return you to the main Alert templates list, where you can then select Save. This "bulk save" approach allows you to create or edit multiple templates in one session and commit all your changes with a single click. Once saved, your custom alert templates will be available in the Alerting dialog box for defining new alerts.
Exporting or importing alert templates
To export the alert template:
Select any alert template from the Alert Templates tab.
Select Export in the upper-right corner of the table.
This exports the alert template as a JSON file in the downloads folder. You can use the exported JSON file to import the alert template to another PEM server or to keep it as a backup.
To import the Alert Template:
On the Alert Templates tab, select Import in the upper-right corner.
To select the JSON file with the code import, select Browse, and then select Import.
After selecting the file to import, you can select the following check boxes:
Skip existing — Skip the alert template if it already exists.
Skip existing dependent probe — The alert templates depend on probes. Select this check box to skip the dependent probe if it already exists.
If both the check boxes are selected and the alert template already exists, then it skips importing the alert template.
If you don't select the Skip existing check box, select Skip dependent probe, and the alert template already exists, then the alert template imports successfully.
If both the check boxes are cleared and the alert template doesn't exist, then it successfully imports the alert template.
Modifying or deleting an alert template
To view the definition of an existing template (including PEM predefined alert templates), use the Show System Template list to select the type of object monitored. When you select the object type, the Alert Templates table displays the alert templates that correspond with that object type.
Select a template name in the list, and select Edit at the left end of the row to review the template definition.
Use the Alert Templates dialog box to view detailed information about the alert template:
- The General tab displays general information.
- The Probe Dependency tab lists the names of probes that provide data for the template.
- The Parameters tab lists the names of any parameters referred to in the SQL code.
- The SQL tab displays the SQL code that defines the behavior of the alert.
To delete an alert template, select the template name in the alert templates table and select Delete, located in the upper-right corner of the table. The alert history persists for the time specified in the History Retention field in the template definition.
Note
You cannot delete a predefined system alert template. You can only delete custom alert templates that you create.