Module: check_mk
Branch: master
Commit: 8cb4fa821a860627ca15b79b2842475ddc160a02
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8cb4fa821a8606…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 1 11:00:28 2015 +0200
Added seconds processing and bytes graph for omd_apache status check
---
web/plugins/metrics/check_mk.py | 219 +++++++++++++++++++++++----------------
1 file changed, 130 insertions(+), 89 deletions(-)
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 92db6aa..69498cf 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1076,83 +1076,84 @@ metric_info["call_legs"] = {
"color" : "#60bbbb",
}
-metric_info["requests_cmk_views"] = {
- "title" : _("%s Requests/s") % "Views",
- "unit" : "1/s",
- "color": "#ff8080",
-}
-
-metric_info["requests_cmk_wato"] = {
- "title" : _("%s Requests/s") % "WATO",
- "unit" : "1/s",
- "color": "#377cab",
-}
-
-metric_info["requests_cmk_bi"] = {
- "title" : _("%s Requests/s") % "BI",
- "unit" : "1/s",
- "color": "#4eb0f2",
-}
-
-metric_info["requests_cmk_snapins"] = {
- "title" : _("%s Requests/s") % "Snapins",
- "unit" : "1/s",
- "color": "#ff4040",
-}
-
-metric_info["requests_cmk_dashboards"] = {
- "title" : _("%s Requests/s") % "Dashboards",
- "unit" : "1/s",
- "color": "#4040ff",
-}
-
-metric_info["requests_cmk_other"] = {
- "title" : _("%s Requests/s") % "Other",
- "unit" : "1/s",
- "color": "#5bb9eb",
-}
-
-metric_info["requests_nagvis_snapin"] = {
- "title" : _("%s Requests/s") % "NagVis Snapin",
- "unit" : "1/s",
- "color": "#f2904e",
-}
-
-metric_info["requests_nagvis_ajax"] = {
- "title" : _("%s Requests/s") % "NagVis AJAX",
- "unit" : "1/s",
- "color": "#af91eb",
-}
-
-metric_info["requests_nagvis_other"] = {
- "title" : _("%s Requests/s") % "NagVis Other",
- "unit" : "1/s",
- "color": "#f2df40",
-}
-
-metric_info["requests_images"] = {
- "title" : _("%s Requests/s") % "Image",
- "unit" : "1/s",
- "color": "#91cceb",
-}
-
-metric_info["requests_styles"] = {
- "title" : _("%s Requests/s") % "Styles",
- "unit" : "1/s",
- "color": "#c6f24e",
-}
-
-metric_info["requests_scripts"] = {
- "title" : _("%s Requests/s") % "Scripts",
- "unit" : "1/s",
- "color": "#4ef26c",
-}
-
-metric_info["requests_other"] = {
- "title" : _("%s Requests/s") % "Other",
- "unit" : "1/s",
- "color": "#4eeaf2",
-}
+for ty, unit in [ ("requests", "1/s"), ("bytes",
"bytes/s"), ("secs", "1/s") ]:
+ metric_info[ty+"_cmk_views"] = {
+ "title" : "Check_MK: Views",
+ "unit" : unit,
+ "color" : "#ff8080",
+ }
+
+ metric_info[ty+"_cmk_wato"] = {
+ "title" : "Check_MK: WATO",
+ "unit" : unit,
+ "color" : "#377cab",
+ }
+
+ metric_info[ty+"_cmk_bi"] = {
+ "title" : "Check_MK: BI",
+ "unit" : unit,
+ "color" : "#4eb0f2",
+ }
+
+ metric_info[ty+"_cmk_snapins"] = {
+ "title" : "Check_MK: Snapins",
+ "unit" : unit,
+ "color" : "#ff4040",
+ }
+
+ metric_info[ty+"_cmk_dashboards"] = {
+ "title" : "Check_MK: Dashboards",
+ "unit" : unit,
+ "color" : "#4040ff",
+ }
+
+ metric_info[ty+"_cmk_other"] = {
+ "title" : "Check_MK: Other",
+ "unit" : unit,
+ "color" : "#5bb9eb",
+ }
+
+ metric_info[ty+"_nagvis_snapin"] = {
+ "title" : "NagVis: Snapin",
+ "unit" : unit,
+ "color" : "#f2904e",
+ }
+
+ metric_info[ty+"_nagvis_ajax"] = {
+ "title" : "NagVis: AJAX",
+ "unit" : unit,
+ "color" : "#af91eb",
+ }
+
+ metric_info[ty+"_nagvis_other"] = {
+ "title" : "NagVis: Other",
+ "unit" : unit,
+ "color" : "#f2df40",
+ }
+
+ metric_info[ty+"_images"] = {
+ "title" : "Image",
+ "unit" : unit,
+ "color" : "#91cceb",
+ }
+
+ metric_info[ty+"_styles"] = {
+ "title" : "Styles",
+ "unit" : unit,
+ "color" : "#c6f24e",
+ }
+
+ metric_info[ty+"_scripts"] = {
+ "title" : "Scripts",
+ "unit" : unit,
+ "color" : "#4ef26c",
+ }
+
+ metric_info[ty+"_other"] = {
+ "title" : "Other",
+ "unit" : unit,
+ "color" : "#4eeaf2",
+ }
#.
# .--Checks--------------------------------------------------------------.
@@ -2130,18 +2131,58 @@ graph_info.append({
"title" : _("Handled Requests"),
"metrics" : [
("requests_cmk_views", "stack"),
- #("requests_cmk_wato'", "stack"),
- #("requests_cmk_bi", "stack"),
- #("requests_cmk_snapins", "stack"),
- #("requests_cmk_dashboards", "stack"),
- #("requests_cmk_other", "stack"),
- #("requests_nagvis_snapin", "stack"),
- #("requests_nagvis_ajax", "stack"),
- #("requests_nagvis_other", "stack"),
- #("requests_images", "stack"),
- #("requests_styles", "stack"),
- #("requests_scripts", "stack"),
- #("requests_other", "stack"),
+ ("requests_cmk_wato", "stack"),
+ ("requests_cmk_bi", "stack"),
+ ("requests_cmk_snapins", "stack"),
+ ("requests_cmk_dashboards", "stack"),
+ ("requests_cmk_other", "stack"),
+ ("requests_nagvis_snapin", "stack"),
+ ("requests_nagvis_ajax", "stack"),
+ ("requests_nagvis_other", "stack"),
+ ("requests_images", "stack"),
+ ("requests_styles", "stack"),
+ ("requests_scripts", "stack"),
+ ("requests_other", "stack"),
],
+ "omit_zero_metrics" : True,
})
+graph_info.append({
+ "title" : _("Seconds serving"),
+ "metrics" : [
+ ("secs_cmk_views", "stack"),
+ ("secs_cmk_wato", "stack"),
+ ("secs_cmk_bi", "stack"),
+ ("secs_cmk_snapins", "stack"),
+ ("secs_cmk_dashboards", "stack"),
+ ("secs_cmk_other", "stack"),
+ ("secs_nagvis_snapin", "stack"),
+ ("secs_nagvis_ajax", "stack"),
+ ("secs_nagvis_other", "stack"),
+ ("secs_images", "stack"),
+ ("secs_styles", "stack"),
+ ("secs_scripts", "stack"),
+ ("secs_other", "stack"),
+ ],
+ "omit_zero_metrics" : True,
+})
+
+graph_info.append({
+ "title" : _("Bytes sent"),
+ "metrics" : [
+ ("bytes_cmk_views", "stack"),
+ ("bytes_cmk_wato", "stack"),
+ ("bytes_cmk_bi", "stack"),
+ ("bytes_cmk_snapins", "stack"),
+ ("bytes_cmk_dashboards", "stack"),
+ ("bytes_cmk_other", "stack"),
+ ("bytes_nagvis_snapin", "stack"),
+ ("bytes_nagvis_ajax", "stack"),
+ ("bytes_nagvis_other", "stack"),
+ ("bytes_images", "stack"),
+ ("bytes_styles", "stack"),
+ ("bytes_scripts", "stack"),
+ ("bytes_other", "stack"),
+ ],
+ "omit_zero_metrics" : True,
+})