added debug options

This commit is contained in:
Ralf Mellis 2025-04-12 15:21:46 +02:00
parent 2e8733a1b3
commit 5677bb1c64
3 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,10 @@
#!/usr/bin/env python3
# pylint: disable=missing-module-docstring, unused-argument, missing-function-docstring
from pprint import pprint
from cmk.utils import debug
# import necessary elements from API version 2
from cmk.agent_based.v2 import (
AgentSection,
@ -30,6 +34,8 @@ def discover_hal9002_status(section):
def check_hal9002_status(params, section):
"""the check function"""
if debug.enabled():
pprint(section)
# print(params["state_if_update_is_available"])
status = section["status"]
version = section["version"]

View File

@ -3,6 +3,9 @@
"""HAL9002 check for storages"""
import time
from pprint import pprint
from cmk.utils import debug
# import necessary elements from API version 2
from cmk.agent_based.v2 import (
@ -41,6 +44,8 @@ def discover_hal9002_storages(section):
def check_hal9002_storages(item, params, section):
"""the check function"""
if debug.enabled():
pprint(section)
curr_time = time.time() # needed for calculating rates
attr = section.get(item)
if not attr:

View File

@ -2,6 +2,10 @@
# pylint: disable=line-too-long
"""HAL9002 checks for users"""
from pprint import pprint
from cmk.utils import debug
# import necessary elements from API version 2
from cmk.agent_based.v2 import (
AgentSection,
@ -38,6 +42,8 @@ def discover_hal9002_users(section):
def check_hal9002_users(item, params, section):
"""the check function"""
if debug.enabled():
pprint(section)
attr = section.get(item)
if not attr:
# if a previously found user does not exist anymore, create a meaningful result