Alert Types
There are two types of alerts:
-
SQL Script: choose if your alert depends on the results of a SQL query; supply SQL script and configure MMTE to run it periodically and send result data by email and/or SMS
-
URL: choose URL if your alert depends on the results of a request to a specified URL; this action can, for instance, invoke some script; no result data can be sent.
SQL Script¶
This type is available for both Global and Environment-local alerts.
Example script that finds your servers with CPU utilization over 50%:
SELECT m.name host_name,
MAX(n.cpu) max_cpu
FROM metrics.tab_nodes n
INNER JOIN metrics.tab_machines m ON m.id = n.machine
WHERE n.created >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '10 minutes'
GROUP BY m.name
HAVING MAX(n.cpu) > 50
Tip
Use Meta Query to test and debug your script:
When the alert is Global, the SQL query can address tableau
or metrics
schemas of MMDB. In order to use metrics
, MetaMiner Tableau Agent (tabagent) must be set up and configured in your system.
When the alert is Environment-local, the SQL query will be executed in the Tableau Repository of the specified environment.
If this SQL query fails with an error (e. g., timeout is reached) and Alerts Error Email(s) notification setting is specified, an email about this error will be sent.
URL¶
This type is available for Global alerts only.
This URL must be accessible from the MMTE Server host.
You can specify HTTP or HTTPS protocol, TCP port, query-string parameters.
The URL can point to a script or a static resource.
Example:
https://someserver.mycompany.com:9999/test/test.php?parameter=value
If the URL is unreachable or request timeout is reached, the alert will be fired immediately.