|
@@ -7,7 +7,7 @@
|
|
|
# License: GNU General Public License v2
|
|
|
|
|
|
import datetime
|
|
|
-
|
|
|
+from typing import Mapping, Any
|
|
|
from cmk.agent_based.v2 import (
|
|
|
AgentSection,
|
|
|
CheckPlugin,
|
|
@@ -31,11 +31,14 @@ from cmk_addons.plugins.edirectory_monitor.lib import (
|
|
|
idm_nongraphable_attributes,
|
|
|
)
|
|
|
|
|
|
-def check_edirectory_items(item: str, section) -> CheckResult:
|
|
|
+def check_edirectory_items(item: str, params: Mapping[str, Any], section) -> CheckResult:
|
|
|
value_store = get_value_store()
|
|
|
'''Split the item key and store the last part for making the returned result and/or metric more unique'''
|
|
|
item_detail = item.split()[-1]
|
|
|
data = section.get(item)
|
|
|
+ warn, crit = params.get("levels", ("fixed", (None, None)))[1]
|
|
|
+ # The warn and crit you can use than later inside a check_levels function
|
|
|
+ # print(f"Levels - {warn} - {crit}")
|
|
|
if not data:
|
|
|
return
|
|
|
for key, value in data.items():
|
|
@@ -78,4 +81,6 @@ check_plugin_edirectory_monitor = CheckPlugin(
|
|
|
service_name="%s",
|
|
|
discovery_function=discover_edirectory_items,
|
|
|
check_function=check_edirectory_items,
|
|
|
+ check_default_parameters={},
|
|
|
+ check_ruleset_name="edirectory_monitor",
|
|
|
)
|