Module: check_mk
Branch: master
Commit: c92a80bef4f7acb894fca554dc651a3a36d1882c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c92a80bef4f7ac…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Aug 22 15:08:50 2011 +0200
Perf-O-Meter: strip arguments from command (after !)
---
.bugs/263 | 10 +++++++---
ChangeLog | 2 ++
web/plugins/views/perfometer.py | 3 +++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/.bugs/263 b/.bugs/263
index a5c76f2..626605b 100644
--- a/.bugs/263
+++ b/.bugs/263
@@ -1,13 +1,17 @@
Title: Perf-O-Meter should not honor command arguments
Component: multisite
+State: done
+Class: cleanup
+Date: 2011-05-04 12:41:53
Benefit: 1
-State: open
Cost: 1
-Date: 2011-05-04 12:41:53
-Class: cleanup
+Fun: 0
When creating perfometers for custom commands (such as legacy
checks) it would be better, if the Perf-O-Meter would not
honor the complete check command but drop everything after the
first !. check_http!www.hirni.de!123 should display the Perf-O-Meter
of check_http, without the !...
+
+2011-08-22 15:08:11: changed state open -> done
+Done. We strip everything after !
diff --git a/ChangeLog b/ChangeLog
index e2db174..6f0c22e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,8 @@
* Man-Pages of Check_MK checks shown in Multisite honor OMD's local hierarchy
* nicer output of substates, translate (!) and (!!) into HTML code
* new command for clearing modified attributes (red cross, green checkmark)
+ * Perf-O-Meters: strip away arguments from check_command (e.g.
+ "check-foo!17!31" -> "check-foo").
WATO:
* Show error message in case of empty inventory due to agent error
diff --git a/web/plugins/views/perfometer.py b/web/plugins/views/perfometer.py
index 9506e77..126512b 100644
--- a/web/plugins/views/perfometer.py
+++ b/web/plugins/views/perfometer.py
@@ -115,6 +115,9 @@ def paint_perfometer(row):
else:
check_command = row["service_check_command"]
+ # Strip away arguments like in "check_http!-H mathias-kettner.de"
+ check_command = check_command.split("!")[0]
+
# Find matching perf-o-meter function
perf_painter = perfometers.get(check_command)
if not perf_painter: