|
@@ -89,6 +89,7 @@ def discover_edirectory_items(section) -> DiscoveryResult:
|
|
yield Service(item=key)
|
|
yield Service(item=key)
|
|
|
|
|
|
def check_edirectory_items(item: str, section) -> CheckResult:
|
|
def check_edirectory_items(item: str, section) -> CheckResult:
|
|
|
|
+ value_store = get_value_store()
|
|
data = section.get(item)
|
|
data = section.get(item)
|
|
if not data:
|
|
if not data:
|
|
return
|
|
return
|
|
@@ -109,11 +110,10 @@ def check_edirectory_items(item: str, section) -> CheckResult:
|
|
yield Result(state=State(0), summary=f"{key}: {value}", details=f"{key}: {value}")
|
|
yield Result(state=State(0), summary=f"{key}: {value}", details=f"{key}: {value}")
|
|
if key in total_counters:
|
|
if key in total_counters:
|
|
'''create a metric which is the difference between previous check value and current check value'''
|
|
'''create a metric which is the difference between previous check value and current check value'''
|
|
- try:
|
|
|
|
- value = get_rate(get_value_store(), key, time.time(), float(value), raise_overflow=True)
|
|
|
|
- except GetRateError:
|
|
|
|
- value = 0
|
|
|
|
- yield Metric(key, value, boundaries=(0, None))
|
|
|
|
|
|
+ previous_value = value_store.get(key, 0)
|
|
|
|
+ value_store[key] = value
|
|
|
|
+ value_difference = float(value) - float(previous_value)
|
|
|
|
+ yield Metric(key, value_difference, boundaries=(0, None))
|
|
elif key not in non_graphable:
|
|
elif key not in non_graphable:
|
|
'''Only create a metric for graphable values'''
|
|
'''Only create a metric for graphable values'''
|
|
yield Metric(key, float(value))
|
|
yield Metric(key, float(value))
|