Implemented systemctl error checker

This commit is contained in:
2023-04-15 14:31:18 +02:00
parent d8eb6a7dd3
commit 0f7a2fcb9e
10 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
#!/bin/sh
echo "Checking journalctl for error messages..."
journalctl_errors="$(journalctl --since '1 day ago' --no-pager | grep -i 'error')"
if [ ! -z "$journalctl_errors" ]
then
echo "Some errors where found: $journalctl_errors"
exit 1
fi
echo "All docker containers are healthy."
exit 0

View File

@@ -0,0 +1,8 @@
[Unit]
Description=starts journalctl-health-check.service
[Timer]
OnCalendar=00:00
[Install]
WantedBy=timers.target