From b873b584c5251ab1bce33489d74eb80e7ac52fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20G=C3=B3mez?= Date: Sun, 10 Nov 2024 11:32:23 +0000 Subject: [PATCH] skip child proxy sensors --- resources/libraries/get_sensors_info.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index 7801ac9..ef92308 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -11,6 +11,11 @@ def get_sensors_info sensors = search(:node, "role:#{s_type}").sort sensors_info[s_type] = {} sensors.each do |s| + # skip child proxy sensors + if s['redborder']['parent_id'] + parent_sensor = search(:node, "sensor_id:#{s['redborder']['parent_id']}").first + next if parent_sensor && parent_sensor.to_s.include?('proxy') + end info = {} info['name'] = s.name info['ip'] = s['ipaddress']