Replies: 1 comment
-
I created a script on It loads the env named #! /bin/bash
set -euo pipefail
# $1=EXIT_CODE (After running backup routine)
# $2=DBXX_TYPE (Type of Backup)
# $3=DBXX_HOST (Backup Host)
# #4=DBXX_NAME (Name of Database backed up
# $5=BACKUP START TIME (Seconds since Epoch)
# $6=BACKUP FINISH TIME (Seconds since Epoch)
# $7=BACKUP TOTAL TIME (Seconds between Start and Finish)
# $8=BACKUP FILENAME (Filename)
# $9=BACKUP FILESIZE
# $10=HASH (If CHECKSUM enabled)
# $11=MOVE_EXIT_CODE
echo "---------Running Uptime Kuma ping---------"
if [ "$1" != "0" ]; then
echo "Backup failed with exit code $1 (EXIT_CODE)"
exit $1
fi
if [ "${11}" != "0" ]; then
echo "Backup failed with exit code ${11} (MOVE_EXIT_CODE)"
exit ${11}
fi
DB_PREFIX=$(env | grep -E "^DB[0-9]+_HOST" | grep -E "$3" | cut -d '_' -f1)
UPTIME_KUMA_ENV_NAME="${DB_PREFIX}_UPTIME_KUMA_URL"
UPTIME_KUMA_URL=${!UPTIME_KUMA_ENV_NAME}
if [ -z "$UPTIME_KUMA_URL" ]; then
echo "Uptime Kuma not configured for $DB_PREFIX."
exit 0
fi
curl $UPTIME_KUMA_URL
echo "Uptime Kuma ping success"
exit 0 If all the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can you add push notifications for Uptime Kuma?
From what I can tell, in Uptime Kuma we'd need to just create a push notification monitor with a x hour (time between backups plus some slack for slower backup runs) heartbeat interval. And from this container, it's just a matter of pushing:
https://uptimekuma.domain.com:3002/api/push/SECRETCODE?status=up&msg=OK (if it succeeded)
https://uptimekuma.domain.com:3002/api/push/SECRETCODE?status=down&msg=ERRORMESSAGE INFO (If failed).
And this could either be a global thing (in which case the error message would need info on which DB it is related to for a failure), or a unique monitor per DBxx
(The variable to provide to this container would be the Push URL (Uptime Kuma provides it as "https://uptimekuma.domain.com:3002/api/push/SECRETCODE?status=up&msg=OK&ping=", so that's what most people would copy/paste from Uptime Kuma)
Beta Was this translation helpful? Give feedback.
All reactions