diff --git a/config.json b/config.json index 5481549..531995e 100644 --- a/config.json +++ b/config.json @@ -31,7 +31,8 @@ "poll_interval": 300, "failure_threshold": 2, "cluster_threshold": 3, - "ping_hosts": [] + "ping_hosts": [], + "links_exclude_ips": ["10.10.10.29", "10.10.10.44", "10.10.10.3"] }, "hosts": [ { diff --git a/monitor.py b/monitor.py index 8f97934..fde0d84 100644 --- a/monitor.py +++ b/monitor.py @@ -553,10 +553,13 @@ class LinkStatsCollector: """ prom_metrics = self._collect_prom_metrics() result_hosts: Dict[str, Dict[str, dict]] = {} + exclude_ips = set(self.cfg.get('monitor', {}).get('links_exclude_ips', [])) for instance, iface_metrics in prom_metrics.items(): - host = instance_map.get(instance, instance.split(':')[0]) host_ip = instance.split(':')[0] + if host_ip in exclude_ips: + continue + host = instance_map.get(instance, host_ip) ifaces = list(iface_metrics.keys()) # SSH ethtool collection via Pulse worker — only for explicitly configured