Add ZFS toggle setting, add comments
This commit is contained in:
parent
881f68c2d2
commit
6c0afb437a
@ -1,13 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Check various system health statistics and push them to Uptime Kuma
|
||||||
|
# Triggers a "down" alert if a stat is above the threshold,
|
||||||
|
# and sends info about what's wrong
|
||||||
|
# Also supports checking ZFS pool health
|
||||||
|
|
||||||
API_URL="https://status.netsyms.net/api/push/"
|
API_URL="https://status.netsyms.net/api/push/"
|
||||||
PUSH_KEY=""
|
PUSH_KEY="" # The random code in the URL generated by Uptime Kuma
|
||||||
DISK_FULL_ALERT_PERCENT_THRESHOLD=85
|
ENABLE_ZFS_MONITOR=1 # Set to 0 if you aren't using ZFS
|
||||||
CPU_USAGE_PERCENT_THRESHOLD=60
|
DISK_FULL_ALERT_PERCENT_THRESHOLD=85 # Alerts if any filesystem is fuller than this
|
||||||
MEM_USAGE_PERCENT_THRESHOLD=80
|
CPU_USAGE_PERCENT_THRESHOLD=60 # Alerts if CPU usage averages greater than this across 5 minutes
|
||||||
|
MEM_USAGE_PERCENT_THRESHOLD=80 # Alerts if RAM usage rises over this percentage, ZFS ARC counts as used
|
||||||
|
|
||||||
# ZFS health
|
# ZFS health
|
||||||
echo -n "Checking ZFS health: "
|
ZFS_STATUS="OK"
|
||||||
ZFS_STATUS=$(zpool status -x | grep -q "all pools are healthy" && echo "OK" || zpool status -x)
|
if [[ $ENABLE_ZFS_MONITOR == 1 ]]; then
|
||||||
echo "$ZFS_STATUS"
|
echo -n "Checking ZFS health: "
|
||||||
|
ZFS_STATUS=$(zpool status -x | grep -q "all pools are healthy" && echo "OK" || zpool status -x)
|
||||||
|
echo "$ZFS_STATUS"
|
||||||
|
fi
|
||||||
|
|
||||||
# Disk usage
|
# Disk usage
|
||||||
echo -n "Checking disk usage: "
|
echo -n "Checking disk usage: "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user