Add Uptime Kuma monitoring integration with dedicated hooks
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled
Implement Uptime Kuma Push Monitor support with separate hook files following separation of concerns principle. Changes: - Add UPTIME_KUMA_PUSH_URL to .env.example - Create dedicated uptime-kuma-success.sh hook - Create dedicated uptime-kuma-error.sh hook - Update config.yaml to call both ntfy and Uptime Kuma hooks - Each notification service has its own file for modularity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
28
hooks/uptime-kuma-error.sh
Executable file
28
hooks/uptime-kuma-error.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Hook Borgmatic - Ping Uptime Kuma en cas d'erreur
|
||||
# Borgmatic 2.0 utilise des variables d'environnement
|
||||
#
|
||||
|
||||
# Charger les variables d'environnement
|
||||
if [ -f /etc/borgmatic/.env ]; then
|
||||
source /etc/borgmatic/.env
|
||||
fi
|
||||
|
||||
# Vérifier que l'URL Uptime Kuma est configurée
|
||||
if [ -z "$UPTIME_KUMA_PUSH_URL" ]; then
|
||||
echo "UPTIME_KUMA_PUSH_URL non configuré, ping ignoré"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Ping Uptime Kuma avec status=down
|
||||
curl -s "${UPTIME_KUMA_PUSH_URL}?status=down&msg=Backup%20failed&ping=" > /dev/null 2>&1
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Ping Uptime Kuma envoyé (error)"
|
||||
else
|
||||
echo "Erreur lors du ping Uptime Kuma"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
28
hooks/uptime-kuma-success.sh
Executable file
28
hooks/uptime-kuma-success.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Hook Borgmatic - Ping Uptime Kuma en cas de succès
|
||||
# Borgmatic 2.0 utilise des variables d'environnement
|
||||
#
|
||||
|
||||
# Charger les variables d'environnement
|
||||
if [ -f /etc/borgmatic/.env ]; then
|
||||
source /etc/borgmatic/.env
|
||||
fi
|
||||
|
||||
# Vérifier que l'URL Uptime Kuma est configurée
|
||||
if [ -z "$UPTIME_KUMA_PUSH_URL" ]; then
|
||||
echo "UPTIME_KUMA_PUSH_URL non configuré, ping ignoré"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Ping Uptime Kuma avec status=up
|
||||
curl -s "${UPTIME_KUMA_PUSH_URL}?status=up&msg=Backup%20successful&ping=" > /dev/null 2>&1
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Ping Uptime Kuma envoyé (success)"
|
||||
else
|
||||
echo "Erreur lors du ping Uptime Kuma"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user