| 1 | # yamllint disable rule:line-length |
| 2 | --- |
| 3 | - id: 'notify-matrix' |
| 4 | meta: |
| 5 | name: 'Matrix' |
| 6 | link: 'https://spec.matrix.org/unstable/push-gateway-api/' |
| 7 | categories: |
| 8 | - notify.agent |
| 9 | icon_filename: 'matrix.svg' |
| 10 | keywords: |
| 11 | - Matrix |
| 12 | overview: |
| 13 | notification_description: | |
| 14 | Send notifications to Matrix network rooms 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 url of the homeserver (`https://homeserver:port`). |
| 22 | - Credentials for connecting to the homeserver, in the form of a valid access token for your account (or for a dedicated notification account). These tokens usually don't expire. |
| 23 | - The Room ids that you want to sent the notification to. |
| 24 | - Access to the terminal where Netdata Agent is running |
| 25 | configuration: |
| 26 | file: |
| 27 | name: 'health_alarm_notify.conf' |
| 28 | options: |
| 29 | description: 'The following options can be defined for this notification' |
| 30 | folding: |
| 31 | title: 'Config Options' |
| 32 | enabled: true |
| 33 | list: |
| 34 | - name: 'SEND_MATRIX' |
| 35 | default_value: 'YES' |
| 36 | description: "Set `SEND_MATRIX` to YES" |
| 37 | required: true |
| 38 | - name: 'MATRIX_HOMESERVER' |
| 39 | default_value: '' |
| 40 | description: "set `MATRIX_HOMESERVER` to the URL of the Matrix homeserver." |
| 41 | required: true |
| 42 | - name: 'MATRIX_ACCESSTOKEN' |
| 43 | default_value: '' |
| 44 | description: "Set `MATRIX_ACCESSTOKEN` to the access token from your Matrix account." |
| 45 | required: true |
| 46 | detailed_description: | |
| 47 | To obtain the access token, you can use the following curl command: |
| 48 | ``` |
| 49 | curl -XPOST -d '{"type":"m.login.password", "user":"example", "password":"wordpass"}' "https://homeserver:8448/_matrix/client/r0/login" |
| 50 | ``` |
| 51 | - name: 'DEFAULT_RECIPIENT_MATRIX' |
| 52 | default_value: '' |
| 53 | description: "Set `DEFAULT_RECIPIENT_MATRIX` to the Rooms you want the alert notifications to be sent to. The format is `!roomid:homeservername`." |
| 54 | required: true |
| 55 | detailed_description: | |
| 56 | The Room ids are unique identifiers and can be obtained from the Room settings in a Matrix client (e.g. Riot). |
| 57 | |
| 58 | You can define multiple Rooms like this: `!roomid1:homeservername` `!roomid2:homeservername`. |
| 59 | |
| 60 | All roles will default to this variable if left unconfigured. |
| 61 | |
| 62 | You can have different Rooms per role, by editing `DEFAULT_RECIPIENT_MATRIX` with the `!roomid:homeservername` you want, in the following entries at the bottom of the same file: |
| 63 | |
| 64 | ```text |
| 65 | role_recipients_matrix[sysadmin]="!roomid1:homeservername" |
| 66 | role_recipients_matrix[domainadmin]="!roomid2:homeservername" |
| 67 | role_recipients_matrix[dba]="!roomid3:homeservername" |
| 68 | role_recipients_matrix[webmaster]="!roomid4:homeservername" |
| 69 | role_recipients_matrix[proxyadmin]="!roomid5:homeservername" |
| 70 | role_recipients_matrix[sitemgr]="!roomid6:homeservername" |
| 71 | ``` |
| 72 | examples: |
| 73 | folding: |
| 74 | enabled: true |
| 75 | title: '' |
| 76 | list: |
| 77 | - name: 'Basic Configuration' |
| 78 | folding: |
| 79 | enabled: false |
| 80 | description: '' |
| 81 | config: | |
| 82 | #------------------------------------------------------------------------------ |
| 83 | # Matrix notifications |
| 84 | |
| 85 | SEND_MATRIX="YES" |
| 86 | MATRIX_HOMESERVER="https://matrix.org:8448" |
| 87 | MATRIX_ACCESSTOKEN="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" |
| 88 | DEFAULT_RECIPIENT_MATRIX="!XXXXXXXXXXXX:matrix.org" |
| 89 | troubleshooting: |
| 90 | problems: |
| 91 | list: [] |