Using Telegram as a platform and not only as an instant messaging app is one of the beauties of it. Why not also use it to receive notification coming from systems I manage? Here's a step by step on how you can use it on Synology's DSM version 7.2.
- You need to go to the BotFather and create a new bot to receive its token.
- Now, start a chat with your bot. Send the
/startcommand and another message afterwards. - On your CLI, run the following command to get your chat identifier:
curl https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates | jq '.result[].message.chat.id' - Access your DSM dashboard and open Control Panel.
- Go to Notification, click on the Webhooks tab and then
Add. - Set the provider as
Customand the rule as you wish. Click next. - The provider name as
Telegram, the subject as%DATE% at %TIME% - %HOSTNAME%and the Webhook URL ashttps://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage. - On the HTTP requests setting, go to
Parameterand set two fields:textwith@@TEXT@@andchat_idwith the value you got on step 3. - Save and send a test message.
Done, this should be enough to get you telegram notifications.