| 1 | # yamllint disable rule:line-length |
| 2 | --- |
| 3 | - id: 'notify-ntfy' |
| 4 | meta: |
| 5 | name: 'ntfy' |
| 6 | link: 'https://ntfy.sh/' |
| 7 | categories: |
| 8 | - notify.agent |
| 9 | icon_filename: 'ntfy.svg' |
| 10 | keywords: |
| 11 | - ntfy |
| 12 | overview: |
| 13 | notification_description: | |
| 14 | [ntfy](https://ntfy.sh/) (pronounce: notify) is a simple HTTP-based [pub-sub](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also [open source](https://github.com/binwiederhier/ntfy) if you want to run your own server. |
| 15 | You can send alerts to an ntfy server using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more. |
| 16 | notification_limitations: '' |
| 17 | setup: |
| 18 | prerequisites: |
| 19 | list: |
| 20 | - title: '' |
| 21 | description: | |
| 22 | - (Optional) A [self-hosted ntfy server](https://docs.ntfy.sh/faq/#can-i-self-host-it), in case you don't want to use https://ntfy.sh |
| 23 | - A new [topic](https://ntfy.sh/#subscribe) for the notifications to be published 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_NTFY' |
| 35 | default_value: 'YES' |
| 36 | description: "Set `SEND_NTFY` to YES" |
| 37 | required: true |
| 38 | - name: 'DEFAULT_RECIPIENT_NTFY' |
| 39 | default_value: '' |
| 40 | description: "URL formed by the server-topic combination you want the alert notifications to be sent to. Unless hosting your own server, the server should always be set to https://ntfy.sh." |
| 41 | required: true |
| 42 | detailed_description: | |
| 43 | You can define multiple recipient URLs like this: `https://SERVER1/TOPIC1` `https://SERVER2/TOPIC2` |
| 44 | |
| 45 | All roles will default to this variable if left unconfigured. |
| 46 | |
| 47 | You can then have different servers and/or topics per role, by editing DEFAULT_RECIPIENT_NTFY with the server-topic combination you want, in the following entries at the bottom of the same file: |
| 48 | ```text |
| 49 | role_recipients_ntfy[sysadmin]="https://SERVER1/TOPIC1" |
| 50 | role_recipients_ntfy[domainadmin]="https://SERVER2/TOPIC2" |
| 51 | role_recipients_ntfy[dba]="https://SERVER3/TOPIC3" |
| 52 | role_recipients_ntfy[webmaster]="https://SERVER4/TOPIC4" |
| 53 | role_recipients_ntfy[proxyadmin]="https://SERVER5/TOPIC5" |
| 54 | role_recipients_ntfy[sitemgr]="https://SERVER6/TOPIC6" |
| 55 | ``` |
| 56 | - name: 'NTFY_USERNAME' |
| 57 | default_value: '' |
| 58 | description: "The username for netdata to use to authenticate with an ntfy server." |
| 59 | required: false |
| 60 | detailed_description: | |
| 61 | Only useful on self-hosted ntfy instances. See [users and roles](https://docs.ntfy.sh/config/#users-and-roles) for details. |
| 62 | Ensure that your user has proper read/write access to the provided topic in `DEFAULT_RECIPIENT_NTFY` |
| 63 | - name: 'NTFY_PASSWORD' |
| 64 | default_value: '' |
| 65 | description: "The password for netdata to use to authenticate with an ntfy server." |
| 66 | required: false |
| 67 | detailed_description: | |
| 68 | Only useful on self-hosted ntfy instances. See [users and roles](https://docs.ntfy.sh/config/#users-and-roles) for details. |
| 69 | Ensure that your user has proper read/write access to the provided topic in `DEFAULT_RECIPIENT_NTFY` |
| 70 | - name: 'NTFY_ACCESS_TOKEN' |
| 71 | default_value: '' |
| 72 | description: "The access token for netdata to use to authenticate with an ntfy server." |
| 73 | required: false |
| 74 | detailed_description: | |
| 75 | This can be used in place of `NTFY_USERNAME` and `NTFY_PASSWORD` to authenticate with a self-hosted ntfy instance. See [access tokens](https://docs.ntfy.sh/config/?h=access+to#access-tokens) for details. |
| 76 | Ensure that the token user has proper read/write access to the provided topic in `DEFAULT_RECIPIENT_NTFY` |
| 77 | examples: |
| 78 | folding: |
| 79 | enabled: true |
| 80 | title: '' |
| 81 | list: |
| 82 | - name: 'Basic Configuration' |
| 83 | folding: |
| 84 | enabled: false |
| 85 | description: '' |
| 86 | config: | |
| 87 | SEND_NTFY="YES" |
| 88 | DEFAULT_RECIPIENT_NTFY="https://ntfy.sh/netdata-X7seHg7d3Tw9zGOk https://ntfy.sh/netdata-oIPm4IK1IlUtlA30" |
| 89 | troubleshooting: |
| 90 | problems: |
| 91 | list: [] |