diff --git a/logging/README.md b/logging/README.md index 75eac32..4423709 100644 --- a/logging/README.md +++ b/logging/README.md @@ -112,23 +112,25 @@ entries. ## Telemt / Zabbix monitoring The Zabbix server is `10.0.0.11` internally. The DEPOT router at `10.0.0.1` -publishes TCP `185.108.4.158:10051` only for the three proxy-host egress +publishes TCP `185.108.4.158:10051` only for the four proxy-host egress addresses, allowing Zabbix Agent 2 active checks without exposing the trapper to the whole internet. -Create the following Zabbix hosts with these exact technical **Host name** -values (visible names may be friendlier): +Create the following Zabbix hosts. The technical **Host name** must match the +Agent 2 `Hostname`; Grafana selects the **Visible name** shown below. -| Client | Zabbix Host name | -|---|---| -| 00-xserver | `00-xserver-fedora-xxx` | -| 11-nevafud | `11-nevafud-fedora` | -| 19-nutrilent | `19-nutrilent-docker` | +| Client | Zabbix Host name | Visible name | +|---|---|---| +| 00-xserver | `00-xserver-fedora-xxx` | `00-xserver-fedora-xxx` | +| 02-tekhnohim | `Fedora Kirochnaya` | `02-tekhnohim-docker` | +| 11-nevafud | `11-nevafud-fedora` | `11-nevafud-fedora` | +| 19-nutrilent | `19-nutrilent-docker` | `19-nutrilent-docker` | Import `zabbix-template-telemt-active.yaml`, link **Telemt proxy by active -agent** to all three hosts, and ensure each host is in the `Linux servers` -group. Do not add a passive-agent interface: these hosts are behind NAT and -send active checks to `185.108.4.158`. +agent** to all four hosts, and ensure each host is in the `Linux servers` +group. All four send active checks to `185.108.4.158`. Client 02 should have no +DEPOT passive-agent interface; its existing local Zabbix server continues to +perform the host's passive Linux checks independently. The matching host-side collector is in `zabbix-agent/`. It enters only the Telemt container network namespace for the control API, discards links and @@ -144,7 +146,7 @@ curl -fsS http://127.0.0.1:3000/api/health ``` The provisioned **Network / Telegram proxy fleet** dashboard selects one of -the three exact host names above and mirrors the Telemt section of the +the four visible host names above and mirrors the Telemt section of the client-02 dashboard: current IP count, active/total connections, IP list, traffic, and uptime. diff --git a/logging/grafana-dashboards/telemt-proxy-fleet.json b/logging/grafana-dashboards/telemt-proxy-fleet.json index b3352f9..b367e23 100644 --- a/logging/grafana-dashboards/telemt-proxy-fleet.json +++ b/logging/grafana-dashboards/telemt-proxy-fleet.json @@ -44,9 +44,14 @@ "selected": false, "text": "19-nutrilent-docker", "value": "19-nutrilent-docker" + }, + { + "selected": false, + "text": "02-tekhnohim-docker", + "value": "02-tekhnohim-docker" } ], - "query": "00-xserver-fedora-xxx,11-nevafud-fedora,19-nutrilent-docker", + "query": "00-xserver-fedora-xxx,11-nevafud-fedora,19-nutrilent-docker,02-tekhnohim-docker", "queryValue": "", "skipUrlSync": false, "type": "custom" diff --git a/logging/zabbix-agent/zabbix-telemt-collector b/logging/zabbix-agent/zabbix-telemt-collector index 9d2bb75..73827a6 100755 --- a/logging/zabbix-agent/zabbix-telemt-collector +++ b/logging/zabbix-agent/zabbix-telemt-collector @@ -14,11 +14,6 @@ if [[ -z "${container_pid}" || "${container_pid}" == "0" ]]; then exit 1 fi -host_ip="$(ip -4 route get 1.1.1.1 | awk '{for (i=1; i<=NF; i++) if ($i == "src") {print $(i+1); exit}}')" -if [[ -z "${host_ip}" ]]; then - exit 1 -fi - json_tmp="$(mktemp "${output_dir}/.telemt-active-ips.json.XXXXXX")" text_tmp="$(mktemp "${output_dir}/.telemt-active-ips.txt.XXXXXX")" metrics_tmp="$(mktemp "${output_dir}/.telemt-metrics.prom.XXXXXX")" @@ -53,10 +48,13 @@ nsenter -t "${container_pid}" -n \ ' "${json_tmp}" } > "${text_tmp}" -# Cache Prometheus output locally. Zabbix active checks read the cache, so the -# central server does not need a route to each private Docker host. -curl --fail --silent --show-error --max-time 5 \ - "http://${host_ip}:9092/metrics" > "${metrics_tmp}" +# Cache Prometheus output from inside Telemt's network namespace. This avoids +# depending on the host-published metrics port or its source allowlist. Zabbix +# active checks read the cache, so the central server still needs no route to +# the private Docker host. +nsenter -t "${container_pid}" -n \ + curl --fail --silent --show-error --max-time 5 \ + http://127.0.0.1:9090/metrics > "${metrics_tmp}" chown root:zabbix "${json_tmp}" "${text_tmp}" "${metrics_tmp}" chmod 0640 "${json_tmp}" "${text_tmp}" "${metrics_tmp}"