diff --git a/docs/roadmap.md b/docs/roadmap.md index 0189d9c..0da742f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,50 +1,47 @@ - - -```markdown # Project Roadmap -## Phase 1 — Repo Foundation +## Phase 1 Repo Foundation -- [ ] Create repo -- [ ] Add README -- [ ] Add architecture document -- [ ] Add setup guide -- [ ] Add roadmap +- [x] Create repo +- [x] Add README +- [x] Add architecture document +- [x] Add setup guide +- [x] Add roadmap - [ ] Add troubleshooting guide --- -## Phase 2 — Metrics Foundation +## Phase 2 Metrics Foundation -- [ ] Install node exporter -- [ ] Add Prometheus config -- [ ] Add K3s node targets -- [ ] Add Proxmox target -- [ ] Add service uptime checks +- [x] Install node exporter +- [x] Add Prometheus config +- [x] Add K3s node targets +- [x] Add Proxmox target +- [x] Add service uptime checks --- -## Phase 3 — Grafana Dashboards +## Phase 3 Grafana Dashboards -- [ ] Add Prometheus datasource -- [ ] Build infrastructure dashboard -- [ ] Build K3s dashboard -- [ ] Build Proxmox dashboard -- [ ] Build service uptime dashboard +- [x] Add Prometheus datasource +- [x] Build infrastructure dashboard +- [x] Build K3s dashboard +- [x] Build Proxmox dashboard +- [x] Build service uptime dashboard --- -## Phase 4 — Alerting +## Phase 4 Alerting - [ ] Add alert rules -- [ ] Add Alertmanager +- [x] Add Alertmanager - [ ] Test node down alert - [ ] Test service down alert - [ ] Document alert response process --- -## Phase 5 — Advanced Observability +## Phase 5 Advanced Observability - [ ] Add Loki for logs - [ ] Add Cloudflare access logs @@ -54,11 +51,11 @@ --- -## Phase 6 — Portfolio Polish +## Phase 6 Portfolio Polish -- [ ] Add screenshots -- [ ] Add architecture diagram image -- [ ] Add demo dashboard image -- [ ] Link to Ced’s HomeLab repo -- [ ] Link to Ced’s NOC repo +- [x] Add screenshots +- [x] Add architecture diagram image +- [x] Add demo dashboard image +- [x] Link to Ced's HomeLab repo +- [x] Link to Ced's NOC repo - [ ] Add project summary to portfolio website \ No newline at end of file diff --git a/docs/unifi-exporter-setup.md b/docs/unifi-exporter-setup.md index 606bec0..ada9c35 100644 --- a/docs/unifi-exporter-setup.md +++ b/docs/unifi-exporter-setup.md @@ -20,71 +20,87 @@ Unpoller --- -## Step 1 — Create UniFi Monitoring User +## Step 1 Create UniFi Monitoring User In the UniFi Network application, create a local monitoring user. Recommended settings: -Username: prometheus -Role: Read-only or limited admin +Username: prometheus +Role: Read-only or limited admin Do not commit the password to GitHub. --- -## Step 2 — Run UniFi Exporter / Unpoller +## Step 2 Run UniFi Exporter / Unpoller Replace the password before running: +```bash docker run -d \ --name unifi-exporter \ --restart unless-stopped \ -p 9130:9130 \ - -e UP_UNIFI_DEFAULT_URL="https://10.10.1.1" \ + -e UP_UNIFI_DEFAULT_URL="https://" \ -e UP_UNIFI_DEFAULT_USER="prometheus" \ -e UP_UNIFI_DEFAULT_PASS="REPLACE_WITH_YOUR_PASSWORD" \ -e UP_UNIFI_DEFAULT_VERIFY_SSL="false" \ -e UP_PROMETHEUS_HTTP_LISTEN="0.0.0.0:9130" \ ghcr.io/unpoller/unpoller:latest +``` --- -## Step 3 — Verify Container Is Running +## Step 3 Verify Container Is Running +```bash docker ps --format "table {{.Names}}\t{{.Ports}}\t{{.Status}}" +``` Expected result: +``` unifi-exporter 0.0.0.0:9130->9130/tcp Up +``` --- -## Step 4 — Test Metrics Endpoint +## Step 4 Test Metrics Endpoint -curl http://10.10.30.140:9130/metrics +```bash +curl http://:9130/metrics +``` Expected result: +``` UniFi metrics output +``` --- -## Step 5 — Restart Prometheus +## Step 5 Restart Prometheus +```bash systemctl restart prometheus +``` --- -## Step 6 — Confirm in Prometheus +## Step 6 Confirm in Prometheus Open: -http://10.10.30.140:9090/targets +``` +http://:9090/targets +``` Expected: +``` unifi-exporter UP +``` --- @@ -92,16 +108,18 @@ unifi-exporter UP Add this to prometheus.yml if not present: +```yaml - job_name: "unifi-exporter" static_configs: - targets: - - "10.10.30.140:9130" + - ":9130" labels: instance: "unifi-exporter" service: "unifi" role: "network" vendor: "unifi" site: "ceds-homelab" +``` --- @@ -114,8 +132,10 @@ Exporter not running or not bound to port 9130. Fix: +```bash docker ps --format "table {{.Names}}\t{{.Ports}}\t{{.Status}}" docker restart unifi-exporter +``` --- @@ -133,15 +153,21 @@ Update credentials and restart container. Test exporter: -curl http://10.10.30.140:9130/metrics +```bash +curl http://:9130/metrics +``` Check Prometheus config: +```bash promtool check config /etc/prometheus/prometheus.yml +``` Restart Prometheus: +```bash systemctl restart prometheus +``` --- @@ -157,7 +183,9 @@ Never commit: Use placeholders: +``` REPLACE_WITH_YOUR_PASSWORD +``` --- @@ -165,6 +193,8 @@ REPLACE_WITH_YOUR_PASSWORD When complete, Prometheus should show: +``` unifi-exporter UP +``` Grafana dashboards can now use UniFi metrics. \ No newline at end of file diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index edb3bcd..d86101a 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -14,27 +14,27 @@ scrape_configs: - job_name: "proxmox" static_configs: - targets: - - "10.10.30.250:9221" + - ":9221" - job_name: "k3s-control-plane" static_configs: - targets: - - "10.10.30.72:9100" - - "10.10.30.245:9100" - - "10.10.30.128:9100" + - ":9100" + - ":9100" + - ":9100" - job_name: "k3s-workers" static_configs: - targets: - - "10.10.30.101:9100" - - "10.10.30.102:9100" - - "10.10.30.103:9100" - - "10.10.30.104:9100" - - "10.10.30.105:9100" - - "10.10.30.106:9100" - - "10.10.30.107:9100" - - "10.10.30.108:9100" - - "10.10.30.109:9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" + - ":9100" - job_name: "homelab-services" metrics_path: /probe @@ -42,15 +42,15 @@ scrape_configs: module: [tcp_connect] static_configs: - targets: - - "10.10.30.250:8006" - - "10.10.30.143:80" - - "10.10.30.210:81" - - "10.10.30.61:4000" - - "10.10.30.143:30013" + - ":8006" + - ":80" + - ":81" + - ":4000" + - ":30013" relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ - replacement: "blackbox-exporter:9115" + replacement: "blackbox-exporter:9115" \ No newline at end of file