Преглед изворни кода

Update 'plugins/edirectory_monitor/agent_based/edirectory_monitor.py'

Michael Honkoop пре 4 месеци
родитељ
комит
de7999c900
1 измењених фајлова са 6 додато и 8 уклоњено
  1. 6 8
      plugins/edirectory_monitor/agent_based/edirectory_monitor.py

+ 6 - 8
plugins/edirectory_monitor/agent_based/edirectory_monitor.py

@@ -16,20 +16,18 @@ from cmk.agent_based.v2 import (
     Result,
     State,
     Metric,
-    get_rate,
     get_value_store,
 )
 
 from cmk_addons.plugins.edirectory_monitor.lib import (
-    format_partition_agent,
     convert_timestamp,
     parse_ldap_data,
     discover_edirectory_items,
     uptime_attributes,
     time_attributes,
     time_attributes_ignored,
-    non_graphable,
-    total_counters,
+    non_graphable_attributes,
+    total_counter_attributes,
 )
 
 def check_edirectory_items(item: str, section) -> CheckResult:
@@ -54,13 +52,13 @@ def check_edirectory_items(item: str, section) -> CheckResult:
         else:
             '''create a default result if above does not apply'''
             yield Result(state=State(0), summary=f"{item_detail}_{key}: {value}", details=f"{key}: {value}")
-        if (item_detail + "_" + key) in total_counters:
+        if (item_detail + "_" + key) in total_counter_attributes:
             '''create a metric which is the difference between previous check value and current check value'''
-            previous_value = value_store.get((item_detail + "_" + key), 0)
-            value_store[(item_detail + "_" + key)] = value
+            previous_value = value_store.get(key, 0)
+            value_store[key] = value
             value_difference = float(value) - float(previous_value)
             yield Metric((item_detail + "_" + key), abs(value_difference), boundaries=(0, None))
-        elif (item_detail + "_" + key) not in non_graphable:
+        elif (item_detail + "_" + key) not in non_graphable_attributes:
             '''Only create a metric for graphable values'''
             yield Metric((item_detail + "_" + key), float(value))