Gatus Alerts to Telegram Without a Bot Token
push.tgGatus has a built-in Telegram provider, but it wants a bot token and a chat ID. If you'd rather skip BotFather, Gatus's custom alerting provider can POST any text to any URL. Point it at push.tg and the alert lands in your Telegram chat.
Step 1: get your endpoint (30 seconds)
Open @trafficRobot in Telegram and press Start. You get an address like k3x9q@push.tg. Your endpoint is the part before the @: https://push.tg/k3x9q. Every example below uses k3x9q, so swap in your own key.
There's no bot to create, no chat_id to look up and no token to keep safe. Add @trafficRobot to a group and the group gets its own address, so everyone on call sees the messages.
Step 2: add the custom provider to config.yaml
alerting:
custom:
url: "https://push.tg/k3x9q"
method: "POST"
headers:
Content-Type: text/plain
body: |
[ALERT_TRIGGERED_OR_RESOLVED] [ENDPOINT_GROUP]/[ENDPOINT_NAME]
[ALERT_DESCRIPTION]
[ENDPOINT_URL]
[RESULT_ERRORS]The square-bracket placeholders are filled in by Gatus: endpoint name, group, URL, the alert description and the errors from the failed check. [ALERT_TRIGGERED_OR_RESOLVED] becomes TRIGGERED or RESOLVED, but only for alerts that have send-on-resolved: true.
Step 3: attach the alert to your endpoints
endpoints:
- name: website
group: prod
url: "https://example.com/health"
interval: 1m
conditions:
- "[STATUS] == 200"
- "[RESPONSE_TIME] < 1000"
alerts:
- type: custom
failure-threshold: 3
success-threshold: 2
send-on-resolved: true
description: "health check failed"With these thresholds you get one message after three failed checks in a row, and one more when it has passed twice again. No flood of messages during a long outage.
Same alert for every endpoint
Instead of repeating thresholds on each endpoint, set a default once:
alerting:
custom:
url: "https://push.tg/k3x9q"
method: "POST"
body: "[ALERT_TRIGGERED_OR_RESOLVED] [ENDPOINT_NAME]: [ALERT_DESCRIPTION]"
default-alert:
failure-threshold: 3
send-on-resolved: true
description: "check failed"
endpoints:
- name: api
url: "https://api.example.com/health"
conditions:
- "[STATUS] == 200"
alerts:
- type: customGatus still needs type: custom on each endpoint that should alert; the default only fills in the rest.
Different chats for different teams
Each Telegram chat or group gets its own push.tg address. Use overrides to send one endpoint group somewhere else:
alerting:
custom:
url: "https://push.tg/k3x9q"
method: "POST"
body: "[ALERT_TRIGGERED_OR_RESOLVED] [ENDPOINT_NAME]: [RESULT_ERRORS]"
overrides:
- group: "database"
url: "https://push.tg/m7w2p"Check that the message really arrived. push.tg answers HTTP 200 even when the key is wrong; the body then says {"error":"no such user"}. Send one test by hand and look at Telegram before you trust it:
curl -d "test from $(hostname)" https://push.tg/k3x9q
Official reference for every option used here: Gatus docs: custom alerting.