Module: check_mk
Branch: master
Commit: 3dce7bb36f26100c1ab67eaede823654d5a26716
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dce7bb36f2610…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jul 3 11:57:37 2017 +0200
4841 FIX esx_vsphere_hostsystem.cpu_usage: fixed missing cpu checks when querying vcenter with windows agent
Change-Id: Ib8c4b01273033f10fcd21dc3bc818207e9056613
---
.werks/4841 | 10 ++++++++++
agents/special/agent_vsphere | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/4841 b/.werks/4841
new file mode 100644
index 0000000..9577877
--- /dev/null
+++ b/.werks/4841
@@ -0,0 +1,10 @@
+Title: esx_vsphere_hostsystem.cpu_usage: fixed missing cpu checks when querying vcenter with windows agent
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1499075778
+Class: fix
+
+
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index a162930..9424d01 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -1490,7 +1490,7 @@ if not error:
# Special handling. If the windows may report winperf_processor in the following call
# remove summary.quickStats.overallCpuUsage from the output. This would lead to a
# duplicate "CPU utlization" service
- if opt_agent and key == "summary.quickStats.overallCpuUsage":
+ if opt_direct and opt_agent and key == "summary.quickStats.overallCpuUsage":
postprocess_functions.append(("%s %s" % (key, " ".join(properties[key])), check_winperf_processor))
output("%s %s" % (key, " ".join(properties[key])))
Module: check_mk
Branch: master
Commit: ea4dc9079c1a14fda666235c77ca1f59ded46990
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ea4dc9079c1a14…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 3 08:43:01 2017 +0200
DropdownChoice: Identify choices by hash; complain invalid choices by default
Change-Id: I7a52abf84641fb865c6006ff31a701a1bf0f6c33
---
.bugs/2175 | 7 +++++--
web/htdocs/valuespec.py | 33 ++++++++++++++++++++++++++-------
2 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/.bugs/2175 b/.bugs/2175
index 0e2908b..7cb4b4a 100644
--- a/.bugs/2175
+++ b/.bugs/2175
@@ -1,9 +1,9 @@
Title: DropdownChoice: Selects incorrect value if the list of options changes
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2015-07-02 09:36:51
Targetversion: future
-Class: bug
1) Go to BI Rule editor
2) Create new rule, select Call-a-Rule
@@ -20,3 +20,6 @@ text that is displayed in the dropdown (i.e. the titles of the choices).
We ship that in an URL variable. If that is present and does not match the
actual choices then we can issue a MKUserError and the user must select
again.
+
+2017-07-03 08:40:39: changed state open -> done
+Fixed
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index bb58055..1aae06c 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1568,7 +1568,7 @@ class DropdownChoice(ValueSpec):
self._prefix_values = kwargs.get("prefix_values", False)
self._sorted = kwargs.get("sorted", False)
self._empty_text = kwargs.get("empty_text", _("There are no elements defined for this selection yet."))
- self._invalid_choice = kwargs.get("invalid_choice", "replace") # also possible: "complain"
+ self._invalid_choice = kwargs.get("invalid_choice", "complain") # also possible: "replace"
self._invalid_choice_title = kwargs.get("invalid_choice_title", _("Element does not exist anymore"))
self._invalid_choice_error = kwargs.get("invalid_choice_error",
_("The selected element is not longer available. Please select something else."))
@@ -1623,9 +1623,11 @@ class DropdownChoice(ValueSpec):
if len(options) == 0:
html.write(self._empty_text)
elif len(options[0]) == 3:
- html.icon_dropdown(varprefix, options, deflt=defval)
+ html.icon_dropdown(varprefix, self._options_for_html(options),
+ deflt=self._option_id(defval))
else:
- html.dropdown(varprefix, options, deflt=defval, onchange=self._on_change, sorted=self._sorted)
+ html.dropdown(varprefix, self._options_for_html(options),
+ deflt=self._option_id(defval),onchange=self._on_change, sorted=self._sorted)
def _get_invalid_choice_title(self, value):
@@ -1647,17 +1649,34 @@ class DropdownChoice(ValueSpec):
def from_html_vars(self, varprefix):
- sel = html.var(varprefix)
choices = self.choices()
+
for n, entry in enumerate(choices):
- val = entry[0]
- if sel == str(n):
+ val, title = entry[:2]
+ if self._is_selected_option_from_html(varprefix, val):
return val
if self._invalid_choice == "replace":
return self.default_value() # garbled URL or len(choices) == 0
else:
- return sel
+ raise MKUserError(varprefix, self._invalid_choice_error)
+
+
+ def _is_selected_option_from_html(self, varprefix, val):
+ selected_value = html.var(varprefix)
+ return selected_value == self._option_id(val)
+
+
+ def _options_for_html(self, orig_options):
+ options = []
+ for val, title in orig_options:
+ options.append((self._option_id(val), title))
+ return options
+
+
+ def _option_id(self, val):
+ return "%s" % hash(val)
+
def validate_value(self, value, varprefix):
if self._no_preselect and value == self._no_preselect_value:
Module: check_mk
Branch: master
Commit: 745a025e40452b35282b2c185f4d38590ab6bc5d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=745a025e40452b…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jun 26 10:45:53 2017 +0200
4840 Check parameters can now be bound to timeperiods
All parameters for discovered services, as well as manual checks, can now be assigned to specific timeperiods.
This makes it quite easy to configure exceptions, for example, when a data backup is running.
Each eligible WATO rule offers a button <i>Enable timespecific parameters</i>, which switches the rule into the timespecific mode.
In this mode you can configure a list of timeperiods and the related check parameters.
You can also configure a default check parameter, in case none of given the timeperiods matches.
The information, whether a timeperiod is active or not, is taken from the core during the check execution.
When the core is down/unreachable, the fall default check parameter will be used.
If a configured timeperiod name is now known, the default parameter will be used, too.
Change-Id: Ia2c6bdccf04cba761e3eee06969eb4b15b771c7b
---
.werks/4840 | 21 ++++++
cmk_base/checking.py | 24 ++++++-
web/htdocs/valuespec.py | 170 ++++++++++++++++++++++++++++++++++++++++++++++++
web/htdocs/wato.py | 8 +++
web/htdocs/watolib.py | 13 ----
5 files changed, 221 insertions(+), 15 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=745a025e40…