logging: add 02-tekhnohim proxy to Telemt fleet
Extend the provisioned Telegram proxy fleet selector with visible host name 02-tekhnohim-docker while retaining the existing Agent 2 technical identity Fedora Kirochnaya.\n\nMake the collector read Prometheus metrics from 127.0.0.1:9090 inside the Telemt network namespace. This avoids dependence on host port 9092 and preserves the existing source-restricted metrics publication.\n\nValidated the dashboard with jq, the collector with bash -n, and the deployed Agent 2 keys on Client 02. The unrelated .DS_Store changes remain unstaged.
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user