Custom Alert Templates

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 exists that 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 Template tab, select the Manage Alerts… menu option from the Management menu; when the Manage Alerts tab opens, select Alert Templates from the Quick Links menu.

_images/pem_alert_templates_tab.png

Use the Show System Template drop-down listbox to filter the alert templates; select a type from the listbox to view all of the templates for that level of the PEM hierarchy.

Reviewing an Existing Alert Template

To view the definition of an existing template (including PEM pre-defined alert templates), use the Show System Template drop-down listbox to select the type of object monitored. When you select the object type, the Alert Templates table will display the currently defined alert templates that correspond with that object type. Highlight a template name and click the edit icon (at the left end of the row) to review the template definition.

_images/pem_alert_templates_pre-def.png

Use the edit button to the left of a template name to view detailed information about the template:

  • General information is displayed on the General tab.
  • The names of probes that provide data for the template are listed on the Probe Dependency tab.
  • The names of any parameters referred to in the SQL code are listed on the Parameters tab.
  • The SQL code that defines the behavior of the alert is displayed on the SQL tab.

Defining a New Alert Template

To define a new alert template, use the Show System Template drop-down listbox to select None, and click the Add icon (+) located in the upper-right corner of the alert template table.

_images/pem_alert_templates_general.png

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; this field is required.

  • Use the Description field to provide a description of the alert template; this field is required.

  • Use the Target type drop-down listbox to select the type of object that will be the focus of the alert.

  • Use the Applies to server drop-down listbox to specify the server type (EDB Postgres Advanced Server or PostgreSQL) to which the alert will be applied; you can specify a single server type, or ALL.

  • Use the History retention field to specify the number of days that the result of the alert execution will be stored 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 indicate if PEM should use the template to generate an automatic alert. If enabled, PEM will automatically create an alert when a new server or agent (as specified by the Target type drop-down listbox) is added, and delete that alert when the target object is dropped.

    • Move the Auto create? slider to Yes to indicate that PEM should automatically create alerts based on the template. If you modify an existing alert template, changing the Auto create? slider from No to Yes, PEM will create alerts on the existing agents and servers. Please note that if you change the slider from Yes to No, the default threshold values in existing alerts will be erased, and cannot be recovered.

    • Use the Operator drop-down listbox to select the operator that PEM will use when evaluating the current system values.

      Select a greater-than sign (>) to indicate that the alert should be triggered when the system values are greater than the values entered in the Threshold values fields.

      Select a less-than sign (<) to indicate that the alert should be triggered when the system values are less than the values entered in the Threshold values fields.

    • Use the threshold fields to specify the values that PEM will compare to the system values to determine if an alert should be raised. Please note that you must specify values for all three thresholds (Low, Medium, and High):

      • Enter a value that will trigger a low-severity alert in the Low field.
      • Enter a value that will trigger a medium-severity alert in the Medium field.
      • Enter a value that will trigger a high-severity alert in the High field.
  • Use the Check frequency field to specify the default number of minutes between alert executions. This value specifies how often the server will invoke the SQL code specified in the definition and compare the result to the threshold value specified in the template.

_images/pem_alert_templates_pdtab.png

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 drop-down listbox to select from a list of the available probes; highlight a probe name, and click the Add button to add the probe to the list of probes used by the alert template. To remove a probe from the selected probes list, highlight the probe name, and click the Delete icon.
_images/pem_alert_templates_paramtab.png

Use fields on the Parameters tab to define the parameters that will be used in the SQL code specified on the SQL tab. Click the Add icon, and:

  • Use the Name field to specify the parameter name.
  • Use the Data type drop-down listbox to select the type of parameter.
  • Use the Unit field to specify the type of unit specified by the parameter.

When you’ve defined a new parameter, click the Add/Change button to save the definition and add the parameter to the parameter list.

To modify an existing parameter definition, highlight a parameter name in the list, modify the parameter values in the fields at the bottom of the tab, and click Add/Change to preserve the changes. To remove one or more parameter definitions, highlight the parameter name(s) and click the Remove button.

_images/pem_alert_templates_sqltab.png

Use the Code field on the SQL tab to provide the text of the SQL query that the server will invoke when executing the alert. The SQL query will provide the result against which the threshold value is compared; if the alert result deviates from the specified threshold value, an alert will be raised.

Within the query, parameters defined on the Parameters tab should be referenced (sequentially) by the variable param_x, where x indicates the position of the parameter definition within 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 pre-defined variables:

Variable Description Variable Name
agent identifier ‘${agent_id}’
server identifier ‘${server_id}’
database name ‘${database_name}’
schema name ‘${schema_name}’
table, index, sequence or function name ‘${object_name}’

Please Note: If the specified query is dependent on one or more probes from different levels within the PEM hierarchy (server, database, schema, etc.), and a probe becomes disabled, any resulting alerts will be displayed as follows:

  • If the alert definition and the probe referenced by the query are from the same level within the PEM hierarchy, the server will display 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 will display any triggered alerts that reference the alert template on the Alert Details table of the hierarchy on which the Alert was defined.

Use the Detailed Information SQL field to provide a SQL query that will be invoked if the alert is triggered. The result set of the query may be displayed as part of the detailed alert information on the Alerts dashboard or Global Overview dashboard.

After defining a new alert template, click the Add/Change button to save the definition and add the template to the Alert Templates list. Click Cancel to exit the Alert Templates dialog without saving changes.

After defining a template, you can use the Manage Alerts tab to create and enable an alert based on the template.

Deleting an Alert Template

To delete an alert template, highlight the template name in the alert templates table, and click the Delete icon (located to the left of the alert template name). The alert history will persist for the length of time specified on the History Retention field in the template definition.