Module: check_mk
Branch: master
Commit: 0e70f8a3c90b9105831205d8b94edb093bc5330c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e70f8a3c90b91…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jul 24 09:10:00 2017 +0200
updated werk #5028
Change-Id: Ie192e4a0df51490b5ce58c59ea1338fea8e3e3e1
---
checks/fortigate_sensors | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/checks/fortigate_sensors b/checks/fortigate_sensors
index bb0149e..94595d7 100644
--- a/checks/fortigate_sensors
+++ b/checks/fortigate_sensors
@@ -30,14 +30,19 @@ def inventory_fortigate_sensors(info):
def check_fortigate_sensors(item, params, info):
+ amount_of_sensors = []
sensors_in_alarm = []
- infotexts = ["%s sensors" % len(info)]
for name, value, dev_status in info:
- if value != "0" and dev_status == "1":
- sensors_in_alarm.append(name)
+ # We assume that sensors with value "0" are not connected.
+ # The related MIB includes no other hint for that.
+ if value != "0":
+ amount_of_sensors.append(name)
+ if dev_status == "1":
+ sensors_in_alarm.append(name)
- count_ok_sensors = len(info) - len(sensors_in_alarm)
+ infotexts = ["%s sensors" % len(amount_of_sensors)]
+ count_ok_sensors = len(amount_of_sensors) - len(sensors_in_alarm)
if count_ok_sensors:
infotexts.append("%s OK" % count_ok_sensors)