Initial backup: 18 monitoring scripts + timers + docs
- 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
This commit is contained in:
31
scripts/send-ntfy.sh
Executable file
31
scripts/send-ntfy.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user