- setup-glances.sh: Install Glances with web interface and systemd service - setup-netdata.sh: Install Netdata without nginx configuration changes - deploy-netdata-config.sh: Complete Netdata deployment with privacy config - Remove redundant iterative scripts from troubleshooting process - Each script handles one specific deployment task cleanly
51 lines
1.8 KiB
Bash
Executable File
51 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# Deploy Netdata configuration and nginx config for privacy-focused local monitoring
|
|
# Run with: sudo -A ./scripts/deploy-netdata-config.sh
|
|
|
|
set -e
|
|
|
|
echo "=== Deploying Netdata privacy configuration ==="
|
|
cp /home/hoborg/homelab/config/netdata/netdata.conf /etc/netdata/netdata.conf
|
|
echo "✅ Netdata configured for local-only operation (no cloud/telemetry)"
|
|
|
|
echo "=== Backing up nginx config ==="
|
|
BACKUP_FILE="/etc/nginx/sites-available/homelab.backup.$(date +%Y%m%d-%H%M%S)"
|
|
cp /etc/nginx/sites-available/homelab "$BACKUP_FILE"
|
|
echo "Backup created: $BACKUP_FILE"
|
|
|
|
echo "=== Deploying nginx configuration with Netdata support ==="
|
|
cp /home/hoborg/homelab/config/nginx/homelab.conf /etc/nginx/sites-available/homelab
|
|
|
|
echo "=== Testing nginx configuration ==="
|
|
nginx -t
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "=== Restarting Netdata with new config ==="
|
|
systemctl restart netdata
|
|
|
|
echo "=== Reloading nginx ==="
|
|
systemctl reload nginx
|
|
|
|
echo "✅ Configuration deployed successfully!"
|
|
else
|
|
echo "❌ ERROR: Nginx configuration test failed!"
|
|
echo "Restoring backup..."
|
|
cp "$BACKUP_FILE" /etc/nginx/sites-available/homelab
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Testing Netdata access ==="
|
|
echo "Direct access: http://127.0.0.1:19999/"
|
|
curl -s -o /dev/null -w "Direct Netdata: HTTP %{http_code}\\n" http://127.0.0.1:19999/ || echo "Direct test failed"
|
|
|
|
echo "Reverse proxy access: https://ak-homelab.duckdns.org/netdata/"
|
|
curl -k -s -o /dev/null -w "Proxied Netdata: HTTP %{http_code}\\n" https://ak-homelab.duckdns.org/netdata/ || echo "Proxy test failed"
|
|
|
|
echo ""
|
|
echo "=== Netdata Privacy Configuration Complete! ==="
|
|
echo "✅ Cloud features disabled"
|
|
echo "✅ Telemetry disabled"
|
|
echo "✅ Local-only monitoring"
|
|
echo "✅ Accessible via: https://ak-homelab.duckdns.org/netdata/"
|
|
echo "✅ Basic auth: admin / AdminPass2024!" |