Reusable Actions For Alert
This example shows you how to check both database prod1
, prod2
and determines if any of them hit 90%
threshold of disk space then using an action template to send notification to two telegram channels.
Here is the full configurations:
Breakdown
Steps
In this example we can see two steps:
- db-prod1-no-space - checks db space of db prod1
- db-prod2-no-space - checkd db space of db prod2
Conditions
The action has two threshold conditions:
But now we’ve added an alias
to each condition, so it’ll be easier to check it in the action
itself.
Action
The action template is defined as.
The action uses the if
statement to alert if one of the databases has less than 10% disk space left.
Note that we don’t define any telegram chat_id
and bot_token
here because we want to define two separate telegram credentials for the two channels.
The credentials are defined in actions
definitions within the alert
configuration.
Note that we declare use: @trigger-telegram
to use the defined action template.