Last active
June 24, 2026 16:48
-
-
Save lukapaunovic/e13bffadb55d390589b10d38f5c5d227 to your computer and use it in GitHub Desktop.
HealthChecks.io tako jednostavno a tako dobro!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root@zver:/etc/systemd/system# cat healthcheck-ping.service | |
| [Unit] | |
| Description=Healthchecks.io ping | |
| [Service] | |
| Type=oneshot | |
| ExecStart=/usr/local/bin/healthcheck-ping.sh | |
| root@zver:/etc/systemd/system# cat healthcheck-ping.timer | |
| [Unit] | |
| Description=Healthchecks.io ping every 2 min | |
| [Timer] | |
| OnBootSec=60 | |
| OnUnitActiveSec=2min | |
| AccuracySec=10s | |
| [Install] | |
| WantedBy=timers.target | |
| root@zver:/etc/systemd/system# cat /usr/local/bin/healthcheck-ping.sh | |
| #!/bin/bash | |
| for i in 1 2 3; do | |
| curl -fsS \ | |
| --connect-timeout 5 \ | |
| --max-time 15 \ | |
| https://hc-ping.com/XXXX-XXXX-XXXX-XXXX-XXXXXXXX && exit 0 | |
| sleep 2 | |
| done | |
| exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment