Module: check_mk
Branch: master
Commit: 5d351db0341afe0e91e959f498ba98da7ee9f02f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d351db0341afe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun May 6 12:25:35 2012 +0200
Updated bug entries #0613
---
.bugs/613 | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/613 b/.bugs/613
index 47df7c9..84b23ef 100644
--- a/.bugs/613
+++ b/.bugs/613
@@ -1,11 +1,14 @@
Title: Actions nach Service search funktionieren nicht
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2012-05-02 12:47:15
Targetversion: 1.1.12
-Class: bug
im aktuellen Multisite gibt es einen Bug im Service Search View wenn man
von dort aus mit den gefundenen Elementen irgend eine Aktion ausführen
will passiert einfach nix (es wird einfach ein leerer View nur mit WATO
Button angezeigt.
+
+2012-05-06 12:25:32: changed state open -> done
+Already fixed by Lars recently.
Module: check_mk
Branch: master
Commit: b3172bdfb48e6a64f59667bf1766ba73e5d496f4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3172bdfb48e6a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun May 6 12:17:42 2012 +0200
Fixed command execution in mobile GUI
---
.bugs/614 | 7 +++++--
web/htdocs/mobile.py | 6 +++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/.bugs/614 b/.bugs/614
index 8cae906..b6cd858 100644
--- a/.bugs/614
+++ b/.bugs/614
@@ -1,9 +1,9 @@
Title: Error sending commands in Mobile UI
Component: mobile
-State: open
+Class: bug
+State: done
Date: 2012-05-05 13:41:00
Targetversion: 1.1.12
-Class: bug
I am receiving this error in the Check_MK Mobile interface:
@@ -28,3 +28,6 @@ After this, the screen just displays the message: "ERROR showing view: too
many values to unpack".
The alert remains unacknowledged as well.
+
+2012-05-06 12:17:19: changed state open -> done
+Should work now.
diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py
index a4a3c05..87e83af 100644
--- a/web/htdocs/mobile.py
+++ b/web/htdocs/mobile.py
@@ -353,7 +353,7 @@ def show_command_form(view, datasource, rows):
def do_commands(view, what, rows):
command = None
- title = views.core_command(what, rows[0])[1] # just get the title
+ title, executor = views.core_command(what, rows[0])[1:3] # just get the title
r = html.confirm(_("Do you really want to %s the %d %ss?") %
(title, len(rows), what), action=html.req.myfile + ".py#commands")
if r != True:
@@ -361,11 +361,11 @@ def do_commands(view, what, rows):
count = 0
for row in rows:
- nagios_commands, title = views.core_command(what, row)
+ nagios_commands, title, executor = views.core_command(what, row)
for command in nagios_commands:
if type(command) == unicode:
command = command.encode("utf-8")
- html.live.command(command, row["site"])
+ executor(command, row["site"])
count += 1
if command:
Module: check_mk
Branch: master
Commit: 1cab789fdae27956647d6f78f602151c7e01aa73
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1cab789fdae279…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun May 6 12:02:46 2012 +0200
ps and ps.perf configurable via WATO now (without inventory)
---
ChangeLog | 2 +
web/htdocs/valuespec.py | 61 +++++++++++++++++++++++++++++-
web/htdocs/wato.py | 2 +-
web/plugins/wato/check_parameters.py | 68 +++++++++++++++++++++++++++++++++-
4 files changed, 129 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5ef3d9f..32c7546 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
1.2.0b4:
+ WATO:
+ * ps and ps.perf configurable via WATO now (without inventory)
1.2.0b3:
Core:
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index a1ecff0..6dde3a7 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1343,6 +1343,7 @@ class Optional(ValueSpec):
self._none_label = kwargs.get("none_label", _("(unset)"))
self._none_value = kwargs.get("none_value", None)
self._sameline = kwargs.get("sameline", False)
+ self._indent = kwargs.get("indent", True)
def canonical_value(self):
return self._none_value
@@ -1375,14 +1376,18 @@ class Optional(ValueSpec):
if self._sameline:
html.write(" ")
else:
- html.write("<br><br>")
+ html.write("<br>")
html.write("</span>")
if checked == self._negate:
display = "none"
else:
display = ""
+ if self._indent:
+ indent = 40
+ else:
+ indent = 0
- html.write('<span id="%s" style="display: %s">' % (div_id, display))
+ html.write('<span id="%s" style="margin-left: %dpx; display: %s">' % (div_id, indent, display))
if value == self._none_value:
value = self._valuespec.default_value()
if self._valuespec.title():
@@ -1418,11 +1423,15 @@ class Alternative(ValueSpec):
def __init__(self, **kwargs):
ValueSpec.__init__(self, **kwargs)
self._elements = kwargs["elements"]
+ self._match = kwargs.get("match") # custom match function
# Return the alternative (i.e. valuespec)
# that matches the datatype of a given value. We assume
# that always one matches. No error handling here.
def matching_alternative(self, value):
+ if self._match:
+ return self._elements[self._match(value)]
+
for vs in self._elements:
try:
vs.validate_datatype(value, "")
@@ -1762,4 +1771,52 @@ class Foldable(ValueSpec):
self._valuespec.validate_value(value, varprefix)
+# Transforms the value from one representation to
+# another while being completely transparent to the user.
+# forth: function that converts a value into the representation
+# needed by the encapsulated vs
+# back: function that converts a value created by the encapsulated
+# vs back to the outer representation
+
+class Transform(ValueSpec):
+ def __init__(self, valuespec, **kwargs):
+ ValueSpec.__init__(self, **kwargs)
+ self._valuespec = valuespec
+ self._back = kwargs.get("back")
+ self._forth = kwargs.get("forth")
+
+ def forth(self, value):
+ if self._forth:
+ return self._forth(value)
+ else:
+ return value
+
+ def back(self, value):
+ if self._back:
+ return self._back(value)
+ else:
+ return value
+
+ def render_input(self, varprefix, value):
+ self._valuespec.render_input( varprefix, self.forth(value))
+
+ def set_focus(*args):
+ self._valuespec.set_focus(*args)
+
+ def canonical_value(self):
+ return self._valuespec.canonical_value()
+
+ def default_value(self):
+ return self._valuespec.default_value()
+
+ def value_to_text(self, value):
+ return self._valuespec.value_to_text(self.forth(value))
+
+ def from_html_vars(self, varprefix):
+ return self.back(self._valuespec.from_html_vars(varprefix))
+ def validate_datatype(self, value, varprefix):
+ self._valuespec.validate_datatype(self.forth(value), varprefix)
+
+ def validate_value(self, value, varprefix):
+ self._valuespec.validate_value(self.forth(value), varprefix)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4eed7ca..1f3892c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9559,7 +9559,7 @@ def create_rule(rulespec, hostname=None, item=NO_ITEM):
new_rule = []
valuespec = rulespec["valuespec"]
if valuespec:
- new_rule.append(valuespec.canonical_value())
+ new_rule.append(valuespec.default_value())
if hostname:
new_rule.append([hostname])
else:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 385ecc0..3c947f2 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1151,7 +1151,7 @@ checkgroups.append((
None,
TextAscii(
title = _("Name of the service"),
- help = _("Pleae Please note, that the agent replaces spaces in "
+ help = _("Pleae Please note, that the agent replaces spaces in "
"the service names with underscores. If you are unsure about the "
"correct spelling of the name then please look at the output of "
"the agent (cmk -d HOSTNAME). The service names are in the first "
@@ -1305,6 +1305,72 @@ register_rulegroup("static", _("Manual Checks"),
"on your hosts."))
group = "static"
+# Add checks that have parameters but are only configured as manual checks
+checkgroups.append((
+ subgroup_ps,
+ "ps",
+ _("State and count of processes"),
+ Tuple(
+ elements = [
+ Alternative(
+ title = _("Name of the process"),
+ elements = [
+ TextAscii(
+ title = _("Exact name of the process without argments"),
+ size = 50,
+ ),
+ Transform(
+ RegExp(size = 50),
+ title = _("Regular expression matching command line"),
+ help = _("This regex must match the <i>beginning</i> of the complete "
+ "command line of the process including arguments"),
+ forth = lambda x: x[1:], # remove ~
+ back = lambda x: "~" + x, # prefix ~
+ ),
+ FixedValue(
+ None,
+ totext = "",
+ title = _("Match all processes"),
+ )
+ ],
+ match = lambda x: (not x and 2) or (x[0] == '~' and 1 or 0)
+ ),
+ TextAscii(
+ title = _("Name of operating system user"),
+ help = _("Leave this empty, if the user does not matter"),
+ none_is_empty = True,
+ ),
+ Integer(
+ title = _("Minimum number of matched process for WARNING state"),
+ default_value = 1,
+ ),
+ Integer(
+ title = _("Minimum number of matched process for OK state"),
+ default_value = 1,
+ ),
+ Integer(
+ title = _("Maximum number of matched process for OK state"),
+ default_value = 1,
+ ),
+ Integer(
+ title = _("Maximum number of matched process for WARNING state"),
+ default_value = 1,
+ ),
+ ]),
+ TextAscii(
+ title = _("Name of service"),
+ help = _("This name will be used in the description of the service"),
+ allow_empty = False,
+ regex = "^[a-zA-Z_0-9 _.-]*$",
+ regex_error = _("Please use only a-z, A-Z, 0-9, space, underscore, "
+ "dot and hyphon for your service description"),
+ ),
+ "first"))
+
+
+
+
+
for subgroup, checkgroup, title, valuespec, itemspec, matchtype in checkgroups:
elements = [
CheckTypeGroupSelection(
Module: check_mk
Branch: master
Commit: be2f6f2bd3613c482150def1b0e2b7c81127aa91
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be2f6f2bd3613c…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Sat May 5 13:41:46 2012 +0200
Updated bug entries #0614
---
.bugs/614 | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/.bugs/614 b/.bugs/614
new file mode 100644
index 0000000..8cae906
--- /dev/null
+++ b/.bugs/614
@@ -0,0 +1,30 @@
+Title: Error sending commands in Mobile UI
+Component: mobile
+State: open
+Date: 2012-05-05 13:41:00
+Targetversion: 1.1.12
+Class: bug
+
+I am receiving this error in the Check_MK Mobile interface:
+
+ ERROR showing view: too many values to unpack
+
+I am using Check_MK version 1.2.0b2. Here are the steps I am taking to
+receive this error:
+
+- Log in to Mobile interface using a Blackberry, Android, or Google Chrome
+- Click on "Hosts > Problems (unhandled)"
+- Click on the hostname of a downed host
+- Click on "context"
+- Click on "Host status"
+- Click "Commands" at the bottom of the page
+- Expand the "Acknowledge" section
+- Enter a comment (Ex. "Known issue")
+- Click the "Acknowledge" button
+- Select yes at the prompt > "Do you really want to acknowledge the
+problems of the 1 hosts?"
+
+After this, the screen just displays the message: "ERROR showing view: too
+many values to unpack".
+
+The alert remains unacknowledged as well.