DEPOT logging: add Telemt fleet monitoring via Zabbix
Install and persist Grafana Zabbix plugin 6.5.0, provision the internal Zabbix datasource, and add a fleet dashboard modeled on client 02 Telemt panels. Add an active-agent Zabbix 7 template plus a 30-second sanitized collector for active IP count/list, connections, traffic, and uptime. Active checks avoid inbound polling of client-private Docker hosts. The exact Zabbix host names and required ZABBIX_API_TOKEN Portainer variable are documented. Compose validation passed on 10.0.0.6; the live plugin registered successfully under Grafana 13.1.0.
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
json_file="/var/lib/zabbix/telemt-active-ips.json"
|
||||
metrics_file="/var/lib/zabbix/telemt-metrics.prom"
|
||||
|
||||
case "${1:-}" in
|
||||
active_ips_count)
|
||||
jq '[.users[].active_unique_ips[]] | unique | length' "${json_file}"
|
||||
;;
|
||||
connections_current)
|
||||
awk '$1 ~ /^telemt_user_connections_current\{/ {sum += $2} END {print sum + 0}' "${metrics_file}"
|
||||
;;
|
||||
connections_total)
|
||||
awk '$1 ~ /^telemt_user_connections_total\{/ {sum += $2} END {print sum + 0}' "${metrics_file}"
|
||||
;;
|
||||
bytes_received)
|
||||
awk '$1 ~ /^telemt_user_octets_from_client\{/ {sum += $2} END {printf "%.0f\n", sum + 0}' "${metrics_file}"
|
||||
;;
|
||||
bytes_sent)
|
||||
awk '$1 ~ /^telemt_user_octets_to_client\{/ {sum += $2} END {printf "%.0f\n", sum + 0}' "${metrics_file}"
|
||||
;;
|
||||
uptime)
|
||||
awk '$1 == "telemt_uptime_seconds" {printf "%.0f\n", $2; found=1} END {if (!found) exit 1}' "${metrics_file}"
|
||||
;;
|
||||
*)
|
||||
printf 'unsupported Telemt value: %s\n' "${1:-}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user