Module: check_mk
Branch: master
Commit: dd87f7a6382dfe5f67d9e2e70fa274105ad33612
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd87f7a6382dfe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 20 16:21:30 2016 +0100
4201 mkeventd_status: avoid duplicate averaging, make graphs more precise in time
resolution
By not using pre-averaged values anymore but switching to precise performance counters
the check now computes are precise average of the counted events (e.g. rule hits)
since the last check. This makes the graphs much more precise. It also makes a
reschedule of the check show more recent data.
Change-Id: I12a891fa4dc5956371b44fd074d5197c0ea68799
---
.werks/4201 | 12 ++++++++++++
ChangeLog | 1 +
checks/mkeventd_status | 16 ++++++++++------
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/.werks/4201 b/.werks/4201
new file mode 100644
index 0000000..e002ee0
--- /dev/null
+++ b/.werks/4201
@@ -0,0 +1,12 @@
+Title: mkeventd_status: avoid duplicate averaging, make graphs more precise in time
resolution
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1482247182
+Class: feature
+
+By not using pre-averaged values anymore but switching to precise performance counters
+the check now computes are precise average of the counted events (e.g. rule hits)
+since the last check. This makes the graphs much more precise. It also makes a
+reschedule of the check show more recent data.
diff --git a/ChangeLog b/ChangeLog
index 07d2601..10af144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 4198 mkeventd_status: rework graph templates, only group metrics where it makes
sense'
* 4005 agent_activemq: now able to provide BasicAuth credentials...
NOTE: Please refer to the migration notes!
+ * 4201 mkeventd_status: avoid duplicate averaging, make graphs more precise in time
resolution...
* 4171 FIX: perle_psmu: fixed value error...
* 4172 FIX: smart.temp: fixed discovery and check function...
* 4173 FIX: if.include: ignore some more keys in 'Network interfaces and switch
ports' rule which are only used for interface grouping
diff --git a/checks/mkeventd_status b/checks/mkeventd_status
index 9822e7c..ef428ac 100644
--- a/checks/mkeventd_status
+++ b/checks/mkeventd_status
@@ -104,17 +104,21 @@ def check_mkeventd_status(item, params, parsed):
("Created events", "event", "%.2f/s"),
("Client connects", "connect", "%.2f/s"),
]
+ rates = {}
+ print status.keys()
+ this_time = time.time()
for title, col, fmt in columns:
- value = status["average_%s_rate" % col]
- yield 0, ("%s: " + fmt) % (title, value), \
- [("average_%s_rate" % col, value)]
+ counter_value = status[col + "s"]
+ rate = get_rate(col, this_time, counter_value)
+ rates[col] = rate
+ yield 0, ("%s: " + fmt) % (title, rate), \
+ [("average_%s_rate" % col, rate)]
# Hit rate
- if status["average_rule_trie_rate"] == 0.0:
+ if rates["rule_trie"] == 0.0:
hit_rate_txt = "-"
else:
- value = status["average_rule_hit_rate"] \
- / status["average_rule_trie_rate"] * 100
+ value = rates["rule_hit"] / rates["rule_trie"] * 100
hit_rate_txt = "%.2f%%" % value
yield 0, None, [("average_rule_hit_ratio", value)]
yield 0, "%s: %s" % ("Rule hit ratio", hit_rate_txt)