From 4d59856c1eccc1321edbbd2fbe294da5be4ebb90 Mon Sep 17 00:00:00 2001 From: MajorLinux Date: Wed, 18 Mar 2026 11:00:41 -0400 Subject: [PATCH] wiki: add Netdata new server deployment guide (49 articles) --- 02-selfhosting/index.md | 1 + .../monitoring/netdata-new-server-setup.md | 117 ++++++++++++++++++ MajorWiki-Deploy-Status.md | 11 +- README.md | 6 +- SUMMARY.md | 1 + index.md | 6 +- 6 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 02-selfhosting/monitoring/netdata-new-server-setup.md diff --git a/02-selfhosting/index.md b/02-selfhosting/index.md index 48300bf..282ff3e 100644 --- a/02-selfhosting/index.md +++ b/02-selfhosting/index.md @@ -24,6 +24,7 @@ Guides for running your own services at home, including Docker, reverse proxies, - [Tuning Netdata Web Log Alerts](monitoring/tuning-netdata-web-log-alerts.md) - [Tuning Netdata Docker Health Alarms](monitoring/netdata-docker-health-alarm-tuning.md) +- [Deploying Netdata to a New Server](monitoring/netdata-new-server-setup.md) ## Security diff --git a/02-selfhosting/monitoring/netdata-new-server-setup.md b/02-selfhosting/monitoring/netdata-new-server-setup.md new file mode 100644 index 0000000..c086f6d --- /dev/null +++ b/02-selfhosting/monitoring/netdata-new-server-setup.md @@ -0,0 +1,117 @@ +--- +title: "Deploying Netdata to a New Server" +domain: selfhosting +category: monitoring +tags: [netdata, monitoring, email, notifications, netdata-cloud, ubuntu, debian] +status: published +created: 2026-03-18 +updated: 2026-03-18 +--- + +# Deploying Netdata to a New Server + +This covers the full Netdata setup for a new server in the fleet: install, email notification config, and Netdata Cloud claim. Applies to Ubuntu/Debian servers. + +## 1. Install + +Use the official kickstart script: + +```bash +wget -O /tmp/netdata-install.sh https://get.netdata.cloud/kickstart.sh +sh /tmp/netdata-install.sh --non-interactive --stable-channel --disable-telemetry +``` + +Verify it's running: + +```bash +systemctl is-active netdata +curl -s http://localhost:19999/api/v1/info | python3 -c "import sys,json; d=json.load(sys.stdin); print('Netdata', d['version'])" +``` + +## 2. Configure Email Notifications + +Copy the default config and set the three required values: + +```bash +cp /usr/lib/netdata/conf.d/health_alarm_notify.conf /etc/netdata/health_alarm_notify.conf +``` + +Edit `/etc/netdata/health_alarm_notify.conf`: + +```ini +EMAIL_SENDER="netdata@majorshouse.com" +SEND_EMAIL="YES" +DEFAULT_RECIPIENT_EMAIL="marcus@majorshouse.com" +``` + +Or apply with `sed` in one shot: + +```bash +sed -i 's/^#\?EMAIL_SENDER=.*/EMAIL_SENDER="netdata@majorshouse.com"/' /etc/netdata/health_alarm_notify.conf +sed -i 's/^#\?SEND_EMAIL=.*/SEND_EMAIL="YES"/' /etc/netdata/health_alarm_notify.conf +sed -i 's/^#\?DEFAULT_RECIPIENT_EMAIL=.*/DEFAULT_RECIPIENT_EMAIL="marcus@majorshouse.com"/' /etc/netdata/health_alarm_notify.conf +``` + +Restart and test: + +```bash +systemctl restart netdata +/usr/libexec/netdata/plugins.d/alarm-notify.sh test 2>&1 | grep -E '(OK|FAILED|email)' +``` + +You should see three `# OK` lines (WARNING → CRITICAL → CLEAR test cycle) and confirmation that email was sent to `marcus@majorshouse.com`. + +> [!note] Delivery via local Postfix +> Email is relayed through the server's local Postfix instance. Ensure Postfix is installed and `/usr/sbin/sendmail` resolves. + +## 3. Claim to Netdata Cloud + +Get the claim command from **Netdata Cloud → Space Settings → Nodes → Add Nodes**. It will look like: + +```bash +wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh +sh /tmp/netdata-kickstart.sh --stable-channel \ + --claim-token \ + --claim-rooms \ + --claim-url https://app.netdata.cloud +``` + +Verify the claim was accepted: + +```bash +cat /var/lib/netdata/cloud.d/claimed_id +``` + +A UUID will be present if claimed successfully. The node should appear in Netdata Cloud within ~60 seconds. + +## 4. Verify Alerts + +Check that no unexpected alerts are active after setup: + +```bash +curl -s 'http://localhost:19999/api/v1/alarms?active' | python3 -c " +import sys, json +d = json.load(sys.stdin) +active = [v for v in d.get('alarms', {}).values() if v.get('status') not in ('CLEAR', 'UNINITIALIZED', 'UNDEFINED')] +print(f'{len(active)} active alert(s)') +for v in active: + print(f' [{v[\"status\"]}] {v[\"name\"]} on {v[\"chart\"]}') +" +``` + +## Fleet-wide Alert Check + +To audit all servers at once (requires Tailscale SSH access): + +```bash +for host in majorlab majorhome majormail majordiscord majortoot majorlinux tttpod dca teelia; do + echo "=== $host ===" + ssh root@$host "curl -s 'http://localhost:19999/api/v1/alarms?active' | python3 -c \ + \"import sys,json; d=json.load(sys.stdin); active=[v for v in d.get('alarms',{}).values() if v.get('status') not in ('CLEAR','UNINITIALIZED','UNDEFINED')]; print(str(len(active))+' active')\"" +done +``` + +## Related + +- [Tuning Netdata Web Log Alerts](tuning-netdata-web-log-alerts.md) +- [Tuning Netdata Docker Health Alarms](netdata-docker-health-alarm-tuning.md) diff --git a/MajorWiki-Deploy-Status.md b/MajorWiki-Deploy-Status.md index 6929b5d..407453f 100644 --- a/MajorWiki-Deploy-Status.md +++ b/MajorWiki-Deploy-Status.md @@ -128,7 +128,7 @@ Every time a new article is added, the following **MUST** be updated to maintain **Updated:** `updated: 2026-03-17` -## Session Update — 2026-03-18 +## Session Update — 2026-03-18 (morning) **Article count:** 48 (was 47) @@ -136,3 +136,12 @@ Every time a new article is added, the following **MUST** be updated to maintain - `02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md` — tuning docker_container_unhealthy alarm to prevent flapping during Nextcloud AIO updates **Updated:** `updated: 2026-03-18` + +## Session Update — 2026-03-18 (afternoon) + +**Article count:** 49 (was 48) + +**New articles added:** +- `02-selfhosting/monitoring/netdata-new-server-setup.md` — full Netdata deployment guide: install via kickstart.sh, email notification config, Netdata Cloud claim + +**Updated:** `updated: 2026-03-18` diff --git a/README.md b/README.md index 32da4a2..68101e3 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ > A growing reference of Linux, self-hosting, open source, streaming, and troubleshooting guides. Written by MajorLinux. Used by MajorTwin. > **Last updated:** 2026-03-18 -**Article count:** 48 +**Article count:** 49 ## Domains | Domain | Folder | Articles | |---|---|---| | 🐧 Linux & Sysadmin | `01-linux/` | 11 | -| 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 10 | +| 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 11 | | 🔓 Open Source Tools | `03-opensource/` | 9 | | 🎙️ Streaming & Podcasting | `04-streaming/` | 2 | | 🔧 General Troubleshooting | `05-troubleshooting/` | 16 | @@ -65,6 +65,7 @@ ### Monitoring - [Tuning Netdata Web Log Alerts](02-selfhosting/monitoring/tuning-netdata-web-log-alerts.md) — tuning web_log_1m_redirects threshold for HTTPS-forcing servers - [Tuning Netdata Docker Health Alarms](02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md) — preventing false alerts during nightly Nextcloud AIO container update cycles +- [Deploying Netdata to a New Server](02-selfhosting/monitoring/netdata-new-server-setup.md) — install, email notifications, and Netdata Cloud claim for Ubuntu/Debian servers ### Security - [Linux Server Hardening Checklist](02-selfhosting/security/linux-server-hardening-checklist.md) — non-root user, SSH key auth, sshd_config, firewall, fail2ban @@ -129,6 +130,7 @@ | Date | Article | Domain | |---|---|---| +| 2026-03-18 | [Deploying Netdata to a New Server](02-selfhosting/monitoring/netdata-new-server-setup.md) | Self-Hosting | | 2026-03-18 | [Tuning Netdata Docker Health Alarms](02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md) | Self-Hosting | | 2026-03-17 | [Ollama Drops Off Tailscale When Mac Sleeps](05-troubleshooting/ollama-macos-sleep-tailscale-disconnect.md) | Troubleshooting | | 2026-03-17 | [Windows OpenSSH Server (sshd) Stops After Reboot](05-troubleshooting/networking/windows-sshd-stops-after-reboot.md) | Troubleshooting | diff --git a/SUMMARY.md b/SUMMARY.md index 3590afc..81ea689 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -20,6 +20,7 @@ * [rsync Backup Patterns](02-selfhosting/storage-backup/rsync-backup-patterns.md) * [Tuning Netdata Web Log Alerts](02-selfhosting/monitoring/tuning-netdata-web-log-alerts.md) * [Tuning Netdata Docker Health Alarms](02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md) + * [Deploying Netdata to a New Server](02-selfhosting/monitoring/netdata-new-server-setup.md) * [Linux Server Hardening Checklist](02-selfhosting/security/linux-server-hardening-checklist.md) * [Standardizing unattended-upgrades with Ansible](02-selfhosting/security/ansible-unattended-upgrades-fleet.md) * [Open Source & Alternatives](03-opensource/index.md) diff --git a/index.md b/index.md index 30a2d1d..e807071 100644 --- a/index.md +++ b/index.md @@ -3,14 +3,14 @@ > A growing reference of Linux, self-hosting, open source, streaming, and troubleshooting guides. Written by MajorLinux. Used by MajorTwin. > > **Last updated:** 2026-03-18 -> **Article count:** 48 +> **Article count:** 49 ## Domains | Domain | Folder | Articles | |---|---|---| | 🐧 Linux & Sysadmin | `01-linux/` | 11 | -| 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 10 | +| 🏠 Self-Hosting & Homelab | `02-selfhosting/` | 11 | | 🔓 Open Source Tools | `03-opensource/` | 9 | | 🎙️ Streaming & Podcasting | `04-streaming/` | 2 | | 🔧 General Troubleshooting | `05-troubleshooting/` | 16 | @@ -65,6 +65,7 @@ ### Monitoring - [Tuning Netdata Web Log Alerts](02-selfhosting/monitoring/tuning-netdata-web-log-alerts.md) — tuning web_log_1m_redirects threshold for HTTPS-forcing servers - [Tuning Netdata Docker Health Alarms](02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md) — preventing false alerts during nightly Nextcloud AIO container update cycles +- [Deploying Netdata to a New Server](02-selfhosting/monitoring/netdata-new-server-setup.md) — install, email notifications, and Netdata Cloud claim for Ubuntu/Debian servers ### Security - [Linux Server Hardening Checklist](02-selfhosting/security/linux-server-hardening-checklist.md) — non-root user, SSH key auth, sshd_config, firewall, fail2ban @@ -129,6 +130,7 @@ | Date | Article | Domain | |---|---|---| +| 2026-03-18 | [Deploying Netdata to a New Server](02-selfhosting/monitoring/netdata-new-server-setup.md) | Self-Hosting | | 2026-03-18 | [Tuning Netdata Docker Health Alarms](02-selfhosting/monitoring/netdata-docker-health-alarm-tuning.md) | Self-Hosting | | 2026-03-17 | [Ollama Drops Off Tailscale When Mac Sleeps](05-troubleshooting/ollama-macos-sleep-tailscale-disconnect.md) | Troubleshooting | | 2026-03-17 | [Windows OpenSSH Server (sshd) Stops After Reboot](05-troubleshooting/networking/windows-sshd-stops-after-reboot.md) | Troubleshooting |