added debug options
This commit is contained in:
parent
c0f4490b89
commit
ddb0ca92c9
@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from typing import NotRequired, TypedDict
|
from typing import NotRequired, TypedDict
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
from cmk.utils import debug
|
||||||
|
|
||||||
from cmk.agent_based.v2 import (
|
from cmk.agent_based.v2 import (
|
||||||
AgentSection,
|
AgentSection,
|
||||||
@ -43,6 +46,8 @@ def discover_nextcloud_database(section) -> DiscoveryResult:
|
|||||||
|
|
||||||
|
|
||||||
def check_nextcloud_database(params, section) -> CheckResult:
|
def check_nextcloud_database(params, section) -> CheckResult:
|
||||||
|
if debug.enabled():
|
||||||
|
pprint(section)
|
||||||
for key in section:
|
for key in section:
|
||||||
if key == "database":
|
if key == "database":
|
||||||
opcache_hit_rate = section[key]["opcache_hit_rate"]
|
opcache_hit_rate = section[key]["opcache_hit_rate"]
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
# pylint: disable=line-too-long, too-many-branches, too-many-locals, too-many-statements
|
# pylint: disable=line-too-long, too-many-branches, too-many-locals, too-many-statements
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
from cmk.utils import debug
|
||||||
from cmk.agent_based.v2 import (
|
from cmk.agent_based.v2 import (
|
||||||
AgentSection,
|
AgentSection,
|
||||||
CheckPlugin,
|
CheckPlugin,
|
||||||
@ -42,6 +44,8 @@ def discover_nextcloud_info(section) -> DiscoveryResult:
|
|||||||
|
|
||||||
def check_nextcloud_info(params, section) -> CheckResult:
|
def check_nextcloud_info(params, section) -> CheckResult:
|
||||||
for key in section:
|
for key in section:
|
||||||
|
if debug.enabled():
|
||||||
|
pprint(section)
|
||||||
if key == "nextcloud":
|
if key == "nextcloud":
|
||||||
_level_type, levels_free_space = params["levels_free_space"]
|
_level_type, levels_free_space = params["levels_free_space"]
|
||||||
_level_type, levels_number_of_files = params["levels_number_of_files"]
|
_level_type, levels_number_of_files = params["levels_number_of_files"]
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
# pylint: disable=line-too-long, too-many-locals
|
# pylint: disable=line-too-long, too-many-locals
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
from cmk.utils import debug
|
||||||
|
|
||||||
from cmk.agent_based.v2 import (
|
from cmk.agent_based.v2 import (
|
||||||
AgentSection,
|
AgentSection,
|
||||||
@ -42,6 +45,8 @@ def discover_nextcloud_users(section) -> DiscoveryResult:
|
|||||||
|
|
||||||
|
|
||||||
def check_nextcloud_users(item, params, section) -> CheckResult:
|
def check_nextcloud_users(item, params, section) -> CheckResult:
|
||||||
|
if debug.enabled():
|
||||||
|
pprint(section)
|
||||||
userid = item
|
userid = item
|
||||||
quota_used_percent = section[item][0]
|
quota_used_percent = section[item][0]
|
||||||
quota_used_bytes = section[item][1]
|
quota_used_bytes = section[item][1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user