Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 30c76c5c authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

Delete fritzbox_smarthome.py

parent 097c6398
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2023-12-28
# File : fritzbox_smarthome.py (WATO check plugin)
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Integer,
Tuple,
TextAscii,
MonitoringState,
)
from cmk.gui.plugins.wato.utils import (
RulespecGroupCheckParametersApplications,
CheckParameterRulespecWithItem,
rulespec_registry,
)
def _levels_upper_lower(unit: str):
return [
('levels_upper',
Tuple(
title=_('Levels upper'),
orientation="horizontal",
elements=[
Integer(title=_('Warning at'), minvalue=0, unit=_(unit)),
Integer(title=_('Critical at'), minvalue=0, unit=_(unit)),
])),
('levels_lower',
Tuple(
title=_('Levels lower'),
orientation="horizontal",
elements=[
Integer(title=_('Warning blow'), minvalue=0, unit=_(unit)),
Integer(title=_('Critical below'), minvalue=0, unit=_(unit)),
])),
]
def _parameter_valuespec_fritzbox_smarthome():
return Dictionary(
title=_('Parameter'),
elements=[
('present',
MonitoringState(
title=_('Monitoring state for offline devices'),
default_value=1,
)),
('hkr',
Dictionary(
title=_('Thermostat'),
elements=[
('deviation',
Tuple(
orientation="horizontal",
title=_('Deviation from target temperature'),
help=_('Deviation form target temperature in °C'),
elements=[
Integer(title=_('Warning'), default_value=3, unit=_('°C')),
Integer(title=_('Critical'), default_value=5, unit=_('°C')),
])),
('battery_low',
MonitoringState(
title=_('Monitoring state on low battery'),
default_value=2,
)),
('state_on_error',
MonitoringState(
title=_('Monitoring state on error'),
default_value=1,
)),
])),
('power_meter',
Dictionary(
title=_('Power meter'),
elements=[
('voltage',
Dictionary(
title=_('Voltage'),
elements=_levels_upper_lower(unit='V'),
)),
('power',
Dictionary(
title=_('Electrical Power'),
elements=_levels_upper_lower(unit='W'),
)),
('energy',
Dictionary(
title=_('Electrical energy (consumption)'),
elements=_levels_upper_lower(unit='Wh'),
)),
])),
]
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="fritzbox_smarthome",
group=RulespecGroupCheckParametersApplications,
item_spec=lambda: TextAscii(title=_("Device-ID")),
match_type="dict",
parameter_valuespec=_parameter_valuespec_fritzbox_smarthome,
title=lambda: _('Settings for Fritz!Box Smarthome Devices')
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment