Skip to content

Commit

Permalink
Merge branch 'cmk2.2' of github.com:HeinleinSupport/check_mk_extensio…
Browse files Browse the repository at this point in the history
…ns into cmk2.2
  • Loading branch information
gurubert committed Jan 15, 2024
2 parents 89ef993 + 2d45c99 commit e75e1f7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
Binary file added ups/ups-2.0.0.mkp
Binary file not shown.
72 changes: 45 additions & 27 deletions ups/web/plugins/wato/active_checks_ups.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- encoding: utf-8; py-indent-offset: 4 -*-

#
Expand All @@ -17,33 +17,51 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.

group = "activechecks"
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Integer,
TextAscii,
)

register_rule(group,
"active_checks:ups",
Dictionary(
title = _("Check UPS"),
help = _("Checks UPS values"),
elements = [
( "hostname",
TextAscii(title = _("DNS Hostname or IP address"),
default_value = "$HOSTADDRESS$",
),
),
( "upsname",
TextAscii(title = _("UPS Name"),
allow_empty = False,
),
from cmk.gui.plugins.wato import (
rulespec_registry,
HostRulespec,
)

from cmk.gui.plugins.wato.active_checks.common import (
RulespecGroupIntegrateOtherServices,
)

def _valuespec_active_checks_ups():
return Dictionary(
title = _("Check UPS"),
help = _("Checks UPS values"),
elements = [
( "hostname",
TextAscii(title = _("DNS Hostname or IP address"),
default_value = "$HOSTADDRESS$",
),
( "port",
Integer(title = _("Port number"),
minvalue = 1,
maxvalue = 65535,
default_value = 3493,
),
),
( "upsname",
TextAscii(title = _("UPS Name"),
allow_empty = False,
),
]
),
match = 'all'
)
),
( "port",
Integer(title = _("Port number"),
minvalue = 1,
maxvalue = 65535,
default_value = 3493,
),
),
]
)

rulespec_registry.register(
HostRulespec(
group=RulespecGroupIntegrateOtherServices,
match_type="all",
name="active_checks:ups",
valuespec=_valuespec_active_checks_ups,
))

0 comments on commit e75e1f7

Please sign in to comment.