| 1 | # yamllint disable rule:line-length |
| 2 | --- |
| 3 | - id: 'notify-telegram' |
| 4 | meta: |
| 5 | name: 'Telegram' |
| 6 | link: 'https://telegram.org/' |
| 7 | categories: |
| 8 | - notify.agent |
| 9 | icon_filename: 'telegram.svg' |
| 10 | keywords: |
| 11 | - Telegram |
| 12 | overview: |
| 13 | notification_description: | |
| 14 | Send notifications to Telegram 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 | - A bot token. To get one, contact the [@BotFather](https://t.me/BotFather) bot and send the command `/newbot` and follow the instructions. Invite your bot to a group where you want it to send messages. |
| 22 | - The chat ID for every chat you want to send messages to. Invite [@myidbot](https://t.me/myidbot) bot to the group that will receive notifications, and write the command `/getgroupid@myidbot` to get the group chat ID. Group IDs start with a hyphen, supergroup IDs start with `-100`. |
| 23 | - Terminal access to the Agent you wish to configure. |
| 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_TELEGRAM' |
| 34 | default_value: 'YES' |
| 35 | description: "Set `SEND_TELEGRAM` to YES" |
| 36 | required: true |
| 37 | - name: 'TELEGRAM_API_URL' |
| 38 | default_value: 'https://api.telegram.org' |
| 39 | description: "Set `TELEGRAM_API_URL` to the corresponding URL if you have your own Telegram Bot API server (e.g., for privacy or local hosting). Defaults to the official Telegram API." |
| 40 | required: false |
| 41 | - name: 'TELEGRAM_BOT_TOKEN' |
| 42 | default_value: '' |
| 43 | description: "set `TELEGRAM_BOT_TOKEN` to your bot token." |
| 44 | required: true |
| 45 | - name: 'DEFAULT_RECIPIENT_TELEGRAM' |
| 46 | default_value: '' |
| 47 | description: "Set the `DEFAULT_RECIPIENT_TELEGRAM` variable in your config file to your Telegram chat ID (find it with @myidbot). Separate multiple chat IDs with spaces. To send alerts to a specific topic within a chat, use `chatID:topicID`." |
| 48 | required: true |
| 49 | detailed_description: | |
| 50 | All roles will default to this variable if left unconfigured. |
| 51 | |
| 52 | The `DEFAULT_RECIPIENT_CUSTOM` can be edited in the following entries at the bottom of the same file: |
| 53 | |
| 54 | ```text |
| 55 | role_recipients_telegram[sysadmin]="-49999333324" |
| 56 | role_recipients_telegram[domainadmin]="-49999333389" |
| 57 | role_recipients_telegram[dba]="-10099992222" |
| 58 | role_recipients_telegram[webmaster]="-10099992222 -49999333389" |
| 59 | role_recipients_telegram[proxyadmin]="-49999333344" |
| 60 | role_recipients_telegram[sitemgr]="-49999333876" |
| 61 | ``` |
| 62 | examples: |
| 63 | folding: |
| 64 | enabled: true |
| 65 | title: '' |
| 66 | list: |
| 67 | - name: 'Basic Configuration' |
| 68 | folding: |
| 69 | enabled: false |
| 70 | description: '' |
| 71 | config: | |
| 72 | #------------------------------------------------------------------------------ |
| 73 | # telegram (telegram.org) global notification options |
| 74 | |
| 75 | SEND_TELEGRAM="YES" |
| 76 | TELEGRAM_BOT_TOKEN="111122223:7OpFlFFRzRBbrUUmIjj5HF9Ox2pYJZy5" |
| 77 | DEFAULT_RECIPIENT_TELEGRAM="-49999333876" |
| 78 | troubleshooting: |
| 79 | problems: |
| 80 | list: [] |