From eb8c0ded5edffb5ffa690d2984b35c86feb57a6c Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 15 Mar 2026 18:35:21 -0400 Subject: [PATCH] Fix: only SSH into explicitly configured hosts for ethtool collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LinkStatsCollector.collect() was SSHing into every host reporting node_network_* metrics to Prometheus, including unrelated app servers like postgresql and matrix. Add instance_map membership check so ethtool collection via Pulse only runs on hosts defined in config.json. Prometheus metrics (traffic rates, errors) are still collected for all instances — only the SSH/ethtool step is gated. Co-Authored-By: Claude Sonnet 4.6 --- monitor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index 3a12544..9effb14 100644 --- a/monitor.py +++ b/monitor.py @@ -559,9 +559,11 @@ class LinkStatsCollector: host_ip = instance.split(':')[0] ifaces = list(iface_metrics.keys()) - # SSH ethtool collection via Pulse worker (one connection per host, all ifaces) + # SSH ethtool collection via Pulse worker — only for explicitly configured + # hosts (instance_map keys). Hosts like postgresql/matrix may report + # node_exporter metrics to Prometheus but don't need link diagnostics. ethtool_data: Dict[str, dict] = {} - if self.pulse.url and ifaces: + if self.pulse.url and ifaces and instance in instance_map: try: ethtool_data = self._ssh_batch(host_ip, ifaces) except Exception as e: