- 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
21 lines
859 B
Bash
Executable File
21 lines
859 B
Bash
Executable File
#!/bin/bash
|
||
# Check for available system updates
|
||
set -euo pipefail
|
||
|
||
SEND_NTFY="/usr/local/bin/send-ntfy.sh"
|
||
|
||
# Update package cache
|
||
apt-get update -qq >/dev/null 2>&1 || true
|
||
|
||
# Count available updates
|
||
REGULAR_UPDATES=$(apt list --upgradable 2>/dev/null | grep -c "upgradable" || echo "0")
|
||
SECURITY_UPDATES=$(apt list --upgradable 2>/dev/null | grep -ic "security" || echo "0")
|
||
|
||
if [ "$SECURITY_UPDATES" -gt 0 ]; then
|
||
$SEND_NTFY warning "Security Updates Available" "🟡 WARNING: $SECURITY_UPDATES security update(s) available on PVE\nTotal updates: $REGULAR_UPDATES" "warning,package,shield"
|
||
elif [ "$REGULAR_UPDATES" -gt 10 ]; then
|
||
$SEND_NTFY info "System Updates Available" "ℹ️ INFO: $REGULAR_UPDATES system update(s) available on PVE" "package,info"
|
||
fi
|
||
|
||
logger -t updates-monitor "Updates: $REGULAR_UPDATES total, $SECURITY_UPDATES security"
|