Module: check_mk
Branch: master
Commit: 0155f3d03aa26ce0a707299bc877cd79e2ef69a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0155f3d03aa26c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 27 11:46:00 2016 +0200
3741 FIX omd_status: Fix labelling and structure of several metric graphs
---
.werks/3741 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/lib.py | 13 ++++++++++---
web/plugins/metrics/check_mk.py | 39 ++++++++++++++++++++++++++++++---------
4 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/.werks/3741 b/.werks/3741
new file mode 100644
index 0000000..9f682cc
--- /dev/null
+++ b/.werks/3741
@@ -0,0 +1,10 @@
+Title: omd_status: Fix labelling and structure of several metric graphs
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i2
+Date: 1477561533
+
+
diff --git a/ChangeLog b/ChangeLog
index 2c9c0a2..6e1b24f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,7 @@
* 3831 FIX: ucd_cpu_util: no longer reports an UNKNOWN error when the counter data
wasn't updated...
* 3985 FIX: mrpe: fixed broken long output when using the CMC...
* 4035 FIX: df_zos: Fixed ignoring last filesystem after new discovery...
+ * 3741 FIX: omd_status: Fix labelling and structure of several metric graphs
Multisite:
* 3959 Two new filters for the comment view: author and comment text field
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index f654dea..668e70a 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -744,10 +744,17 @@ def metric_number_with_precision(v, *args, **kwargs):
if v < 0:
return "-" + metric_number_with_precision(-v, *args, **kwargs)
- kwargs["base"] = 1000.0
- scale_symbol, places_after_comma, scale_factor = calculate_scaled_number(v, *args,
**kwargs)
+ subargs = {
+ "base": 1000.0,
+ "precision": kwargs.get("precision", 2),
+ }
+ scale_symbol, places_after_comma, scale_factor = calculate_scaled_number(v, *args,
**subargs)
scaled_value = float(v) / scale_factor
- return (u"%%.%df %%s" % places_after_comma) % (scaled_value, scale_symbol)
+ text = ((u"%%.%df %%s" % places_after_comma) % (scaled_value,
scale_symbol)).rstrip()
+ if kwargs.get("drop_zeroes"):
+ text = text.rstrip("0").rstrip(".")
+ return text
+
def metric_number_with_precision_list(values, *args, **kwargs):
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 479e065..6fbbbf1 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -71,7 +71,7 @@ unit_info[""] = {
unit_info["count"] = {
"title" : _("Count"),
"symbol" : "",
- "render" : lambda v: metric_number_with_precision(v),
+ "render" : lambda v: metric_number_with_precision(v, drop_zeroes=True),
"stepping" : "integer", # for vertical graph labels
}
@@ -2191,8 +2191,8 @@ metric_info["host_check_rate"] = {
metric_info["monitored_hosts"] = {
"title" : _("Monitored hosts"),
- "unit" : "1/s",
- "color" : "52/a",
+ "unit" : "count",
+ "color" : "52/b",
}
metric_info["hosts_active"] = {
@@ -2233,8 +2233,8 @@ metric_info["service_check_rate"] = {
metric_info["monitored_services"] = {
"title" : _("Monitored services"),
- "unit" : "1/s",
- "color" : "21/a",
+ "unit" : "count",
+ "color" : "21/b",
}
metric_info["livestatus_connect_rate"] = {
@@ -6767,18 +6767,39 @@ graph_info.append({
})
graph_info.append({
- "title" : _("Check helper usage"),
"metrics" : [
- ( "helper_usage_cmk", "area" ),
+ ( "livestatus_usage", "area" ),
+ ],
+ "range" : (0, 100),
+})
+
+
+graph_info.append({
+ "metrics" : [
+ ( "livestatus_overflows_rate", "area" ),
+ ],
+})
+
+
+graph_info.append({
+ "metrics" : [
+ ( "helper_usage_cmk", "area" ),
+ ],
+ "range" : (0, 100),
+})
+
+graph_info.append({
+ "metrics" : [
( "helper_usage_generic", "area" ),
],
+ "range" : (0, 100),
})
graph_info.append({
"title" : _("Average check latency"),
"metrics" : [
- ( "average_latency_cmk", "area" ),
- ( "average_latency_generic", "area" ),
+ ( "average_latency_cmk", "line" ),
+ ( "average_latency_generic", "line" ),
],
})