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 3a3d8e0f authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

Delete electrical_energy.py

parent 57aa4518
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-29
# File : electrical_energy.py (WATO)
from cmk.gui.i18n import _
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
CheckParameterRulespecWithoutItem,
rulespec_registry,
RulespecGroupCheckParametersEnvironment,
)
from cmk.gui.valuespec import Dictionary, Integer, TextInput, Tuple
def _item_spec_energy():
return TextInput(
title=_("Phase"), help=_("The identifier of the phase the power is related to.")
)
def _parameter_valuespec_energy():
return Dictionary(
title=_('Parameters'),
elements=[
(
"levels_upper",
Tuple(
title=_("Upper levels for electrical energy"),
elements=[
Integer(title=_("warning at"), unit="Wh"),
Integer(title=_("critical at"), unit="Wh"),
],
),
),
(
"levels_lower",
Tuple(
title=_("Lower levels for electrical energy"),
elements=[
Integer(title=_("warning if below"), unit="Wh"),
Integer(title=_("critical if below"), unit="Wh"),
],
),
),
],
help=_(
"Levels for the electrical energy consumption of a device "
"like a UPS or a PDU. Several phases may be addressed independently."
),
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="energy_multiple",
group=RulespecGroupCheckParametersEnvironment,
item_spec=_item_spec_energy,
parameter_valuespec=_parameter_valuespec_energy,
title=lambda: TextInput(title=_("Electrical Energy (several phases)")),
)
)
rulespec_registry.register(
CheckParameterRulespecWithoutItem(
check_group_name="energy_single",
group=RulespecGroupCheckParametersEnvironment,
parameter_valuespec=_parameter_valuespec_energy,
title=lambda: _("Electrical Energy (single phase)"),
)
)
\ No newline at end of file
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