Notifications➧
About the Component➧
The Notifications component allows you to send individual notifications to system users via Telegram and Email. Notifications can be of two types - events (Events) and notifications (logs of actions in the system).
One of the features of this component is the ability to send notifications to a specific user (and not to a group). The user can also configure which notifications and through which channel (Email/Telegram) should be received.
General scheme of interaction➧
Notes:
- Events have two dates - start and end (alert and resolved)
- Actions (notifications) have one date - the time of the action.
For this reason, they are divided into different groups and have different settings.
Notifications in the web interface➧
Setting up a sending channel - Telegram➧
- Tab selection
- Bot name - here you need to enter the name of your bot, which was entered during registration in @BotFather
- API key - received key from @BotFather
- Template alert(create event)*
- Template resolved(completion of event)*
- Template notification(action)*
- An example of an object generated for a notification. If this is an action (notification), the parameter event = null. In case this event is action = null. These variables can be used to generate notification text.
*Use twig
Setting up the sending channel - Email➧
- Address of your SMTP server (IP or domain)
- SMTP port
- What encryption to use (usually the port also depends on the type of encryption)
- Your username for authorization on the SMTP server. This is usually your email
- Password for authorization on the SMTP server
- From which email to send (header From in the email body). This is usually your email
- What name to specify when sending (From header)
- Setting up templates (more detailed description in the telegram block)
Configuring rules for sending by actions (notifications) ➧
On the page for setting actions for sending, you can specify which actions should generate a notification. You can also add some conditions, for example, send only if the action ended with an error.
- Remove the rule
- The name of the action. This is an input field with a hint (the system prompts based on actions that have already taken place)
- Enable/disable the rule
- Send if action fails
- Send if the action was successful
Configuring rules for sending on events ➧
- Remove the rule
- Event name. This is an input field with a hint (the system prompts based on events that have already occurred)
- Enable/disable the rule
- Whether to generate a notification when the event ends. Relevant, for example, when creating an event about a hardware restart.
- How many seconds to wait before sending a notification. If the event ends earlier, the notification will be canceled. This setting only applies to alert notifications, resolved is always sent immediately.
Configuring contacts and sending rules in user account ➧
- Click edit contact in account settings / edit user to get a popup window with contact settings
- You can disable a contact if you do not want to receive notifications for some time
- At what levels to send notifications through this contact. There is also Notify for levels - these are notifications (actions)
- List of events that DO NOT send through this contact
- List of actions that DO NOT send through this contact
Setting up notifications via telegram➧
Channel setup➧
- Go to the settings of the telegram sending channel
- Specify the name of the bot, the key and save
- Restart the bot with the
wca supervisor:control telegram-bot restart
command (so that the incoming message handler receives new settings)
Add contacts➧
- Go to account settings / change user and add the phone number used in telegram.
- After adding a contact - go to your bot and send /start or any other message. In response, the bot should request the transfer of a contact number. After transmitting the contact number, the bot should respond with the following:
- Reload the account settings page - a new contact with the Telegram type should appear.
Sending notifications via Telegram is configured! Further, you can fine-tune which notifications you want to receive for this contact, what events and what actions