Skip to content

Commit

Permalink
ups for CMK 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gurubert committed Jan 4, 2024
1 parent 26c412a commit 2d45c99
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
Binary file removed ups/ups-1.1.mkp
Binary file not shown.
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 2d45c99

Please sign in to comment.