|
@@ -16,20 +16,18 @@ from cmk.agent_based.v2 import (
|
|
Result,
|
|
Result,
|
|
State,
|
|
State,
|
|
Metric,
|
|
Metric,
|
|
- get_rate,
|
|
|
|
get_value_store,
|
|
get_value_store,
|
|
)
|
|
)
|
|
|
|
|
|
from cmk_addons.plugins.edirectory_monitor.lib import (
|
|
from cmk_addons.plugins.edirectory_monitor.lib import (
|
|
- format_partition_agent,
|
|
|
|
convert_timestamp,
|
|
convert_timestamp,
|
|
parse_ldap_data,
|
|
parse_ldap_data,
|
|
discover_edirectory_items,
|
|
discover_edirectory_items,
|
|
uptime_attributes,
|
|
uptime_attributes,
|
|
time_attributes,
|
|
time_attributes,
|
|
time_attributes_ignored,
|
|
time_attributes_ignored,
|
|
- non_graphable,
|
|
|
|
- total_counters,
|
|
|
|
|
|
+ non_graphable_attributes,
|
|
|
|
+ total_counter_attributes,
|
|
)
|
|
)
|
|
|
|
|
|
def check_edirectory_items(item: str, section) -> CheckResult:
|
|
def check_edirectory_items(item: str, section) -> CheckResult:
|
|
@@ -54,13 +52,13 @@ def check_edirectory_items(item: str, section) -> CheckResult:
|
|
else:
|
|
else:
|
|
'''create a default result if above does not apply'''
|
|
'''create a default result if above does not apply'''
|
|
yield Result(state=State(0), summary=f"{item_detail}_{key}: {value}", details=f"{key}: {value}")
|
|
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'''
|
|
'''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)
|
|
value_difference = float(value) - float(previous_value)
|
|
yield Metric((item_detail + "_" + key), abs(value_difference), boundaries=(0, None))
|
|
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'''
|
|
'''Only create a metric for graphable values'''
|
|
yield Metric((item_detail + "_" + key), float(value))
|
|
yield Metric((item_detail + "_" + key), float(value))
|
|
|
|
|