- 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
32 lines
759 B
Bash
Executable File
32 lines
759 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
SEVERITY="${1:-info}"
|
|
TITLE="${2:-Notification}"
|
|
MESSAGE="${3:-No message}"
|
|
TAGS="${4:-server}"
|
|
|
|
# Read topics from config
|
|
source /root/.ntfy-topics
|
|
|
|
# Route to appropriate topic based on severity
|
|
case "$SEVERITY" in
|
|
critical)
|
|
TOPIC="$TOPIC_CRITICAL"
|
|
PRIORITY="urgent"
|
|
;;
|
|
warning)
|
|
TOPIC="$TOPIC_WARNING"
|
|
PRIORITY="high"
|
|
;;
|
|
info)
|
|
TOPIC="$TOPIC_INFO"
|
|
PRIORITY="default"
|
|
;;
|
|
esac
|
|
|
|
# Send notification WITHOUT authentication (security by obscurity)
|
|
curl -s -H "Title: $TITLE" -H "Priority: $PRIORITY" -H "Tags: $TAGS" -d "$MESSAGE" "https://ntfy.sh/$TOPIC" >/dev/null 2>&1 || true
|
|
|
|
logger -t homelab-monitor "[$SEVERITY] $TITLE: $MESSAGE"
|