Skip to content

Commit

Permalink
Add telegram alerts to gatus
Browse files Browse the repository at this point in the history
  • Loading branch information
claha committed Jul 30, 2023
1 parent f133b87 commit ea19f6a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/gatus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
pip install ansible
ansible-galaxy install --role-file requirements.yaml
ansible-playbook main.yaml --limit localhost --tags gatus
ansible-playbook main.yaml --limit localhost --tags gatus \
--extra-vars "telegram_token=ci telegram_chatids=ci"
docker ps --filter name=gatus | grep --quiet gatus
18 changes: 18 additions & 0 deletions roles/gatus/templates/config.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
debug: true

ui:
header: "Gatus {{ ansible_hostname }}"

alerting:
telegram:
token: "{{ telegram_token }}"
id: "{{ telegram_chatids }}"
default-alert:
enabled: true
failure-threshold: 3
success-threshold: 3
send-on-resolved: true
description: "Sent from {{ ansible_hostname }}"

endpoints:
{% for endpoint in gatus_icmp_endpoints %}
- name: {{ endpoint.name }}
url: "icmp://{{ endpoint.url }}"
interval: 5m
conditions:
- "[CONNECTED] == true"
alerts:
- type: telegram
{% endfor %}
{% for endpoint in gatus_dns_endpoints %}
- name: {{ endpoint.name }}
Expand All @@ -17,4 +33,6 @@ endpoints:
conditions:
- "[BODY] == {{ endpoint.body }}"
- "[DNS_RCODE] == NOERROR"
alerts:
- type: telegram
{% endfor %}

0 comments on commit ea19f6a

Please sign in to comment.