Hello @XP_Mai,
Let me try to clarify our documentation, I did not work with Discord, but I have worked with other Notification methods used with Netdata. Firstly it is necessary to edit the main variables for discord:
1 - Please, go to /etc/netdata
and run
$ sudo ./edit-config health_alarm_notify.conf
when your favorite editor opens, set the next variables:
# enable/disable sending discord notifications
SEND_DISCORD="YES"
# Create a webhook by following the official documentation -
# https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks
DISCORD_WEBHOOK_URL="https://discordapp.com/api/webhooks/XXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# if a role's recipients are not configured, a notification will be send to
# this discord channel (empty = do not send a notification for unconfigured
# roles):
DEFAULT_RECIPIENT_DISCORD="alarms"
According our documentation and some examples we have inside health_alarm_notify
the default values for the vector are:
role_recipients_discord[sysadmin]="${DEFAULT_RECIPIENT_DISCORD}"
role_recipients_discord[domainadmin]="${DEFAULT_RECIPIENT_DISCORD}"
role_recipients_discord[dba]="${DEFAULT_RECIPIENT_DISCORD}"
role_recipients_discord[webmaster]="${DEFAULT_RECIPIENT_DISCORD}"
role_recipients_discord[proxyadmin]="${DEFAULT_RECIPIENT_DISCORD}"
role_recipients_discord[sitemgr]="${DEFAULT_RECIPIENT_DISCORD}"
You add and change them according your necessity.
I took a look in the main script used to send data, and I observed that the spaces
are used to separate the channels, so if you have spaces, the words will be considered different channels.
The variable declaration role_recipients_discord[sysadmin]
means that you have a role
named sysadmin
that sends data to channel systems.
. I think our documentation needs an update here.
Finally you can also test if your configuration is delivering correctly the alarms running the following commands:
$ cd /usr/libexec/netdata/plugins.d/
$ ./alarm-notify test
Best regards!