Module: check_mk
Branch: master
Commit: 77da232e2351b65d732e9259fb58f58b6c060010
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=77da232e2351b6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Dec 12 16:17:10 2016 +0100
4164 FIX livestatus_status: fixed ValueError for values in scientific notation
Change-Id: Idfde3d4ed7f4504ad9180d67aa705c6e207c7220
---
.werks/4164 | 10 ++++++++++
ChangeLog | 1 +
checks/livestatus_status | 32 ++++++++++++++++----------------
3 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/.werks/4164 b/.werks/4164
new file mode 100644
index 0000000..4027958
--- /dev/null
+++ b/.werks/4164
@@ -0,0 +1,10 @@
+Title: livestatus_status: fixed ValueError for values in scientific notation
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1481555731
+
+
diff --git a/ChangeLog b/ChangeLog
index a1d7cac..f0ad00a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -64,6 +64,7 @@
* 4161 FIX: emcvnx_sp_util: fixed empty data handling
* 4162 FIX: esx_vsphere_vm.heartbeat: fixed KeyError
* 4163 FIX: kernel: fixed empty data handling
+ * 4164 FIX: livestatus_status: fixed ValueError for values in scientific notation
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/livestatus_status b/checks/livestatus_status
index 48ebf63..81f0262 100644
--- a/checks/livestatus_status
+++ b/checks/livestatus_status
@@ -83,30 +83,30 @@ def check_livestatus_status(item, params, parsed):
# Check Performance counters
this_time = time.time()
status_counters = [
- # conv_func, factor, calc_rate, column, format, title
- (int, 1, True, "%.1f/s", "host_checks", "Host
Checks", ),
- (int, 1, True, "%.1f/s", "service_checks", "Service
Checks", ),
- (int, 1, True, "%.1f/s", "forks", "Process
Creations", ),
- (int, 1, True, "%.1f/s", "connections", "Livestatus
Connects", ),
- (int, 1, True, "%.1f/s", "requests", "Livestatus
Requests", ),
- (int, 1, True, "%.1f/s", "log_messages", "Log
Messages", ),
+ # factor, calc_rate, column, format, title
+ (1, True, "%.1f/s", "host_checks", "Host
Checks", ),
+ (1, True, "%.1f/s", "service_checks", "Service
Checks", ),
+ (1, True, "%.1f/s", "forks", "Process
Creations", ),
+ (1, True, "%.1f/s", "connections", "Livestatus
Connects", ),
+ (1, True, "%.1f/s", "requests", "Livestatus
Requests", ),
+ (1, True, "%.1f/s", "log_messages", "Log
Messages", ),
]
if status["program_version"].startswith("Check_MK"):
# We have a CMC here.
status_counters += [
- # conv_func, factor, calc_rate, format, column, title
- (float, 1, False, "%.3fs", "average_latency_generic",
"Average check latency"),
- (float, 1, False, "%.3fs", "average_latency_cmk",
"Average Check_MK latency"),
- (float, 100, False, "%.1f%%", "helper_usage_generic",
"Check helper usage"),
- (float, 100, False, "%.1f%%", "helper_usage_cmk",
"Check_MK helper usage"),
- (float, 100, False, "%.1f%%", "livestatus_usage",
"Livestatus usage"),
- (float, 1, False, "%.1f/s",
"livestatus_overflows_rate", "Livestatus overflow rate"),
+ # factor, calc_rate, format, column, title
+ (1, False, "%.3fs", "average_latency_generic",
"Average check latency"),
+ (1, False, "%.3fs", "average_latency_cmk",
"Average Check_MK latency"),
+ (100, False, "%.1f%%", "helper_usage_generic",
"Check helper usage"),
+ (100, False, "%.1f%%", "helper_usage_cmk",
"Check_MK helper usage"),
+ (100, False, "%.1f%%", "livestatus_usage",
"Livestatus usage"),
+ (1, False, "%.1f/s", "livestatus_overflows_rate",
"Livestatus overflow rate"),
]
- for conv_func, factor, calc_rate, fmt, counter, title in status_counters:
- value = factor * conv_func(status[counter])
+ for factor, calc_rate, fmt, counter, title in status_counters:
+ value = factor * float(status[counter])
if calc_rate:
value = get_rate("livestatus_status.%s.%s" % (item, counter),
this_time, value)