Notifier#
Description | Notifier creates and delivers custom notifications from a variety of sources to multiple destinations. |
Author | Nokia |
Supported OS | SR Linux, SR OS |
Catalog | nokia-eda/catalog |
Language | Go |
Source Code | coming soon |
Installation#
Notifier app can be installed using EDA App Store or by running the app-installer workflow with kubectl
:
Configuration#
After installing the app, you can configure your notification sources and destinations. You have the option to choose between two sources - Alarm or Query - and can send notifications to multiple destinations.
Sources are defined using the Notifier Custom Resource (CR), while destinations1 (referred to as Providers) are set up using the Provider CR. You can mix and match sources, as well as send notifications to multiple destinations.
Notification source#
To configure the source of the notifications, you need to create a Notifier CR. The example below shows a configuration for the notification source that will:
- use all Alarms as notification source
- send notifications to the
discord
provider.
Provider reference#
The Notification Source references the Notification Destination by its name. In the example above, the discord
provider referenced in the Notifier CR is the name of the Provider CR that should exist in the same namespace as the Notifier CR.
Notification destination#
The Provider CR defines the destination for the notifications produced by the Notification Source (aka Notifier CR). The below example shows a configuration for the notification destination that sends notification to the Discord webhook:
Note, that the Provider name in the .metadata.name
field should match the provider name referenced in the Notifier CR.
Providers#
Notifier supports multiple notification destinations (aka providers), and leverages the shoutrrr package to send notifications to the supported providers. The full list of supported providers is available at the shouterrr docs.
Notifier app knows which provider to use based on the uri
field in the Provider CR.
Discord#
To send notifications to Discord a user needs to create a Discord webhook2. The webhook URL should look like this:
Transform the original webhook URL into the format expected by the Notifier app:
- Pay attention to the order of the
webhookid
andtoken
in the URL. The original webhook URL has thetoken
after thewebhookid
, and the Notifier app expects thetoken
to be before thewebhookid
.
Now everything is ready for the Provider CR creation with the following configuration:
Slack#
To send notifications to Slack a user may create a Slack application. Refer to Slack's API documentation to create an app.
Once the app is created, and the right scope is given to it, extract the Bot User OAuth Token as explain in the shouterrr docs. The token should look similar to this:
-
The full list of supported destinations/providers is available here. ↩
-
Refer to the Discord docs for more information on how to create a Discord webhook. ↩