| 1 | # yamllint disable rule:line-length |
| 2 | --- |
| 3 | - id: 'notify-discord' |
| 4 | meta: |
| 5 | name: 'Discord' |
| 6 | link: 'https://discord.com/' |
| 7 | categories: |
| 8 | - notify.agent |
| 9 | icon_filename: 'discord.png' |
| 10 | keywords: |
| 11 | - Discord |
| 12 | overview: |
| 13 | notification_description: | |
| 14 | Send notifications to Discord using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more. |
| 15 | notification_limitations: '' |
| 16 | setup: |
| 17 | prerequisites: |
| 18 | list: |
| 19 | - title: '' |
| 20 | description: | |
| 21 | - The incoming webhook URL as given by Discord. Create a webhook by following the official [Discord documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks). You can use the same on all your Netdata servers (or you can have multiple if you like - your decision). |
| 22 | - One or more Discord channels to post the messages to |
| 23 | - Access to the terminal where Netdata Agent is running |
| 24 | configuration: |
| 25 | file: |
| 26 | name: 'health_alarm_notify.conf' |
| 27 | options: |
| 28 | description: 'The following options can be defined for this notification' |
| 29 | folding: |
| 30 | title: 'Config Options' |
| 31 | enabled: true |
| 32 | list: |
| 33 | - name: 'SEND_DISCORD' |
| 34 | default_value: 'YES' |
| 35 | description: "Set `SEND_DISCORD` to YES" |
| 36 | required: true |
| 37 | - name: 'DISCORD_WEBHOOK_URL' |
| 38 | default_value: '' |
| 39 | description: "set `DISCORD_WEBHOOK_URL` to your webhook URL." |
| 40 | required: true |
| 41 | - name: 'DEFAULT_RECIPIENT_DISCORD' |
| 42 | default_value: '' |
| 43 | description: "Set `DEFAULT_RECIPIENT_DISCORD` to the channel you want the alert notifications to be sent to. You can define multiple channels like this: `alerts` `systems`. " |
| 44 | required: true |
| 45 | detailed_description: | |
| 46 | All roles will default to this variable if left unconfigured. |
| 47 | You can then have different channels per role, by editing `DEFAULT_RECIPIENT_DISCORD` with the channel you want, in the following entries at the bottom of the same file: |
| 48 | ```text |
| 49 | role_recipients_discord[sysadmin]="systems" |
| 50 | role_recipients_discord[domainadmin]="domains" |
| 51 | role_recipients_discord[dba]="databases systems" |
| 52 | role_recipients_discord[webmaster]="marketing development" |
| 53 | role_recipients_discord[proxyadmin]="proxy-admin" |
| 54 | role_recipients_discord[sitemgr]="sites" |
| 55 | ``` |
| 56 | |
| 57 | The values you provide should already exist as Discord channels in your server. |
| 58 | examples: |
| 59 | folding: |
| 60 | enabled: true |
| 61 | title: '' |
| 62 | list: |
| 63 | - name: 'Basic Configuration' |
| 64 | folding: |
| 65 | enabled: false |
| 66 | description: '' |
| 67 | config: | |
| 68 | #------------------------------------------------------------------------------ |
| 69 | # discord (discordapp.com) global notification options |
| 70 | |
| 71 | SEND_DISCORD="YES" |
| 72 | DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/XXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
| 73 | DEFAULT_RECIPIENT_DISCORD="alerts" |
| 74 | troubleshooting: |
| 75 | problems: |
| 76 | list: [] |