- 18 comprehensive monitoring checks - 5 systemd timers (5min, 15min, hourly, daily, weekly) - Complete documentation - NTFY secure notification system - Fixed debianvm disk space (91% to 57%) - Fixed CloudReve integration - Date: 2026-01-07
17 lines
559 B
Bash
Executable File
17 lines
559 B
Bash
Executable File
#!/bin/bash
|
|
# Check for OOM killer events
|
|
SEND_NTFY="/usr/local/bin/send-ntfy.sh"
|
|
STATE_FILE="/var/run/oom-check.state"
|
|
|
|
OOM_COUNT=$(dmesg 2>/dev/null | grep -c "killed process" || echo 0)
|
|
LAST_COUNT=0
|
|
[ -f "$STATE_FILE" ] && LAST_COUNT=$(cat "$STATE_FILE" 2>/dev/null || echo 0)
|
|
|
|
if [ "$OOM_COUNT" -gt "$LAST_COUNT" ]; then
|
|
NEW_KILLS=$((OOM_COUNT - LAST_COUNT))
|
|
$SEND_NTFY critical "OOM Killer Active" "🔴 CRITICAL: OOM killed $NEW_KILLS process(es)!" "skull,error"
|
|
fi
|
|
|
|
echo $OOM_COUNT > "$STATE_FILE"
|
|
logger -t oom-monitor "OOM: $OOM_COUNT kills"
|