Module: check_mk
Branch: master
Commit: d19a762099e459dbba641c1c0966e12dc6d28340
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d19a762099e459…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 3 10:07:53 2015 +0200
This also might have affected other checks. Integer values had not been accepted
here but created as default parameters.
Conflicts:
ChangeLog
checks/cpu
---
.werks/2575 | 11 +++++++++++
ChangeLog | 1 +
checks/cpu | 4 ++--
checks/hpux_cpu | 2 +-
checks/ucd_cpu_load | 2 +-
web/htdocs/valuespec.py | 12 ++++++++----
6 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/.werks/2575 b/.werks/2575
new file mode 100644
index 0000000..53926c4
--- /dev/null
+++ b/.werks/2575
@@ -0,0 +1,11 @@
+Title: cpu.loads: Fix exception in displaying parameters for CPU load check
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441267525
+
+This also might have affected other checks. Integer values had not been accepted
+here but created as default parameters.
diff --git a/ChangeLog b/ChangeLog
index 9a5e7e5..c0bc7c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -151,6 +151,7 @@
* 2546 FIX: brocade_mlx_power: Only discover power supplies in state normal/failure,
skip other states...
* 2547 FIX: mysql mysql_capacity mysql_ping mysql_slave: Fixed broken service
discovery when instance id is empty...
* 2564 FIX: logins: missing manpage
+ * 2575 FIX: cpu.loads: Fix exception in displaying parameters for CPU load check...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/cpu b/checks/cpu
index 8523fff..d276ba0 100644
--- a/checks/cpu
+++ b/checks/cpu
@@ -38,8 +38,8 @@
# '----------------------------------------------------------------------'
-cpuload_default_levels = (5, 10)
-
+cpuload_default_levels = (5.0, 10.0)
+threads_default_levels = (2000, 4000)
def inventory_cpu_load(info):
if len(info) == 1 and len(info[0]) >= 5:
diff --git a/checks/hpux_cpu b/checks/hpux_cpu
index 6588ab1..ef04acb 100644
--- a/checks/hpux_cpu
+++ b/checks/hpux_cpu
@@ -28,7 +28,7 @@
# 2:23pm up 196 days, 4:47, 5 users, load average: 0.05, 0.04, 0.04
# 8 logical processors (2 per socket)
-cpuload_default_levels = (5, 10)
+cpuload_default_levels = (5.0, 10.0)
def inventory_hpux_cpu_load(info):
if len(info) >= 1 and 'load' in info[0]:
diff --git a/checks/ucd_cpu_load b/checks/ucd_cpu_load
index 51b7f14..653b062 100644
--- a/checks/ucd_cpu_load
+++ b/checks/ucd_cpu_load
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
-cpuload_default_levels = (5, 10)
+cpuload_default_levels = (5.0, 10.0)
def inventory_ucd_cpu_load(info):
if len(info) == 3:
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index e9833aa..49743ea 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1117,10 +1117,14 @@ class Float(Integer):
_("The text <b><tt>%s</tt></b> is not a valid
floating point number." % html.var(varprefix)))
def validate_datatype(self, value, varprefix):
- if type(value) != float and not \
- (type(value) not in [ int, long ] and self._allow_int):
- raise MKUserError(varprefix, _("The value %r has type %s, but must be of
type float%s") %
- (value, type_name(value), self._allow_int and _(" or int") or
""))
+ if type(value) == float:
+ return
+
+ if type(value) in [ int, long ] and self._allow_int:
+ return
+
+ raise MKUserError(varprefix, _("The value %r has type %s, but must be of
type float%s") %
+ (value, type_name(value), self._allow_int and _(" or int") or
""))
class Percentage(Float):