Get uptime alerts in Telegram
You will be configuring 3 services. The assumption is that you have accounts already for these services.
- UptimeRobot — source of the uptime/downtime notifications. It currently supports email, Twitter, Slack, Pushover, Pushbullet and others but not Telegram. We will use the webhook notification as the way to send messages to Telegram.
- IFTTT — bridges UptimeRobot and Telegram by providing the webhook for UptimeRobot and triggering a message to Telegram. In IFTTT terminology: IF {event trigger from UptimeRobot}, then {send message to Telegram group}
- Telegram — destination of the notification. You will need to create a group for this.
Telegram Configuration
In Telegram, create a new group, if needed. You may opt to use an existing group.
Go to @IFTTT and follow the instruction so link your Telegram account to your IFTTT account.
Send /connect_group
to @IFTTT and connect the group where you want to send the notifications.
IFTTT Configuration
Sign in to IFTTT and add a new applet.
My Applets -> New Applet
- this -> Maker Webhooks -> Receive a web request
- Event Name:
uptime_alert
- that -> Telegram -> Send message
- Target chat: (select a Telegram group)
In the maker webhooks settings, look for your Account Info URL which is the following format:
https://maker.ifttt.com/use/{secret_key}
Visit that URL to get the POST URL that looks like this:
https://maker.ifttt.com/trigger/{event}/with/key/{secret_key}
where {event}
is the Event Name that you defined while creating your IFTTT dashlet — uptime_alert
https://maker.ifttt.com/trigger/uptime_alert/with/key/{secret_key}
Target Chat: <select Telegram group to send the message>
Message Text:
Monitor is <b>{{Value2}}</b>: {{Value1}}. {{Value3}}.<br>
{{EventName}} on {{OccurredAt}}
UptimeRobot Configuration
Sign in to your UptimeRobot account.
In My Settings, Add Alert Contact with type Web-Hook. Then configure the settings based on your IFTTT information above.
URL to Notify: (Include an ending ? character)
https://maker.ifttt.com/trigger/uptime_alert/with/key/{secret_key}?
POST Value (JSON Format):
{ "value1": "*monitorFriendlyName*",
"value2": "*alertTypeFriendlyName*",
"value3": "*alertDetails*" }
You may test posting to the webhook using the following curl command, replacing {event}
and {secret_key}
with the appropriate values.
curl -X POST -H "Content-Type: application/json" -d '{"value1":"monitorFriendlyName","value2":"UP or DOWN","value3":"alertDetails"}' https://maker.ifttt.com/trigger/{event}/with/key/{secret_key}