bundles/zfs: import bundle from work repository

This commit is contained in:
Franzi 2020-08-29 21:10:59 +02:00
parent b690ae25b0
commit 4934eb46fb
Signed by: kunsi
GPG key ID: 12E3D2136B818350
11 changed files with 841 additions and 0 deletions

View file

@ -0,0 +1,33 @@
#!/bin/sh
monitoring=/var/tmp/zfs-auto-snapshot.status
crit_days=1
uptime=$(cut -d. -f1 /proc/uptime)
if [ "$uptime" -lt 3600 ]
then
echo 'OK - The system has just booted'
exit 0
fi
now=$(date +%s)
timestamp=$(cat "$monitoring")
if [ -z "$timestamp" ]
then
echo 'UNKNOWN - No status info found'
exit 3
fi
if [ "$timestamp" = 0 ]
then
echo 'OK - Snapshots disabled'
exit 0
elif [ $(( now - timestamp )) -gt $(( 60 * 60 * 24 * crit_days )) ]
then
echo "CRITICAL - Status file indicates age greater than $crit_days day(s)"
exit 2
else
echo 'OK'
exit 0
fi