Module: check_mk
Branch: master
Commit: 0040674ded37dbe9b77cf7849799416a1a780bf2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0040674ded37db…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jun 18 11:07:41 2015 +0200
#2355 FIX docsis_channels_upstream: Fix graph definitions
---
.werks/2355 | 9 +++
ChangeLog | 1 +
web/htdocs/metrics.py | 7 ++-
web/plugins/metrics/check_mk.py | 115 +++++++++++++++++++++++++++++----------
4 files changed, 102 insertions(+), 30 deletions(-)
diff --git a/.werks/2355 b/.werks/2355
new file mode 100644
index 0000000..c79cfea
--- /dev/null
+++ b/.werks/2355
@@ -0,0 +1,9 @@
+Title: docsis_channels_upstream: Fix graph definitions
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1434618449
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index b77d77c..78fb1bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,7 @@
* 1258 FIX: fileinfo solaris: Fixed configuration crash...
* 2221 FIX: cisco_temperature: Fixed order of device levels for some devices...
* 2329 FIX: windows_intel_bonding: Fix exception in case of no existing bonding
device
+ * 2355 FIX: docsis_channels_upstream: Fix graph definitions
Multisite:
* 2260 Improved load time of Check_MK GUI...
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index a67848b..f38ed1d 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -154,6 +154,10 @@ def metric_to_text(metric, value=None):
# '----------------------------------------------------------------------'
cmk_color_palette = {
+ "10" : (0.3, 1.0, 1.0),
+ "12" : (0.5, 1.0, 1.0),
+ "14" : (0.6, 1.0, 1.0),
+ "16" : (0.8, 1.0, 1.0),
"24" : (0.5, 1.0, 1.0),
"25" : (0.7, 1.0, 1.0),
}
@@ -309,7 +313,8 @@ def translate_metrics(perf_data, check_command):
"color" : "#888888",
}
else:
- mi = metric_info[metric_name]
+ mi = metric_info[metric_name].copy()
+ mi["color"] = parse_color_into_hexrgb(mi["color"])
# Optional scaling
scale = translation_entry.get("scale", 1.0)
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 12d2d9c..2ee18de 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -80,6 +80,13 @@ unit_info["1/s"] = {
"render" : lambda v: "%s%s" % (drop_dotzero(v),
_("/s")),
}
+unit_info["hz"] = {
+ "title" : _("Hz"),
+ "symbol" : _("Hz"),
+ "render" : lambda v : physical_precision(v, 3, _("Hz")),
+}
+
+
unit_info["bytes"] = {
"title" : _("Bytes"),
"symbol" : _("B"),
@@ -717,9 +724,7 @@ metric_info["disk_average_read_wait"] = {
}
metric_info["disk_average_write_wait"] = {
- "title" : _("Write wait time"),
- "unit" : "s",
- "color" : "#20c0e8",
+ "title" : _("Write wait time"), "unit" : "s",
"color" : "#20c0e8",
}
metric_info["disk_average_wait"] = {
@@ -1090,83 +1095,114 @@ metric_info["mail_queue_active_size"] = {
for ty, unit in [ ("requests", "1/s"), ("bytes",
"bytes/s"), ("secs", "1/s") ]:
metric_info[ty+"_cmk_views"] = {
- "title" : "Check_MK: Views",
+ "title" : _("Check_MK: Views"),
"unit" : unit,
"color" : "#ff8080",
}
- metric_info[ty+"_cmk_wato"] = {
- "title" : "Check_MK: WATO",
+ metric_info[ty + "_cmk_wato"] = {
+ "title" : _("Check_MK: WATO"),
"unit" : unit,
"color" : "#377cab",
}
- metric_info[ty+"_cmk_bi"] = {
- "title" : "Check_MK: BI",
+ metric_info[ty + "_cmk_bi"] = {
+ "title" : _("Check_MK: BI"),
"unit" : unit,
"color" : "#4eb0f2",
}
- metric_info[ty+"_cmk_snapins"] = {
- "title" : "Check_MK: Snapins",
+ metric_info[ty + "_cmk_snapins"] = {
+ "title" : _("Check_MK: Snapins"),
"unit" : unit,
"color" : "#ff4040",
}
- metric_info[ty+"_cmk_dashboards"] = {
- "title" : "Check_MK: Dashboards",
+ metric_info[ty + "_cmk_dashboards"] = {
+ "title" : _("Check_MK: Dashboards"),
"unit" : unit,
"color" : "#4040ff",
}
- metric_info[ty+"_cmk_other"] = {
- "title" : "Check_MK: Other",
+ metric_info[ty + "_cmk_other"] = {
+ "title" : _("Check_MK: Other"),
"unit" : unit,
"color" : "#5bb9eb",
}
- metric_info[ty+"_nagvis_snapin"] = {
- "title" : "NagVis: Snapin",
+ metric_info[ty + "_nagvis_snapin"] = {
+ "title" : _("NagVis: Snapin"),
"unit" : unit,
"color" : "#f2904e",
}
- metric_info[ty+"_nagvis_ajax"] = {
- "title" : "NagVis: AJAX",
+ metric_info[ty + "_nagvis_ajax"] = {
+ "title" : _("NagVis: AJAX"),
"unit" : unit,
"color" : "#af91eb",
}
- metric_info[ty+"_nagvis_other"] = {
- "title" : "NagVis: Other",
+ metric_info[ty + "_nagvis_other"] = {
+ "title" : _("NagVis: Other"),
"unit" : unit,
"color" : "#f2df40",
}
- metric_info[ty+"_images"] = {
- "title" : "Image",
+ metric_info[ty + "_images"] = {
+ "title" : _("Image"),
"unit" : unit,
"color" : "#91cceb",
}
- metric_info[ty+"_styles"] = {
- "title" : "Styles",
+ metric_info[ty + "_styles"] = {
+ "title" : _("Styles"),
"unit" : unit,
"color" : "#c6f24e",
}
- metric_info[ty+"_scripts"] = {
- "title" : "Scripts",
+ metric_info[ty + "_scripts"] = {
+ "title" : _("Scripts"),
"unit" : unit,
"color" : "#4ef26c",
}
- metric_info[ty+"_other"] = {
- "title" : "Other",
+ metric_info[ty + "_other"] = {
+ "title" : _("Other"),
"unit" : unit,
"color" : "#4eeaf2",
}
+
+metric_info["total_modems"] = {
+ "title" : _("Total number of modems"),
+ "unit" : "count",
+ "color" : "12/c",
+}
+
+metric_info["active_modems"] = {
+ "title" : _("Active modems"),
+ "unit" : "count",
+ "color" : "14/c",
+}
+
+metric_info["registered_modems"] = {
+ "title" : _("Registered modems"),
+ "unit" : "count",
+ "color" : "16/c",
+}
+
+metric_info["channel_utilization"] = {
+ "title" : _("Channel utilization"),
+ "unit" : "%",
+ "color" : "24/c",
+}
+
+metric_info["frequency"] = {
+ "title" : _("Frequency"),
+ "unit" : "hz",
+ "color" : "10/c",
+}
+
#.
# .--Checks--------------------------------------------------------------.
# | ____ _ _ |
@@ -1409,7 +1445,13 @@ check_metrics["check_mk-bluenet_meter"]
= {}
check_metrics["check_mk-bluecoat_sensors"] = {}
check_metrics["check_mk-zfs_arc_cache"] = {
"hit_ratio" : { "scale" : 0.01 }}
-check_metrics["check_mk-docsis_channels_upstream"] = {}
+check_metrics["check_mk-docsis_channels_upstream"] = {
+ "total" : { "name" : "total_modems" },
+ "active" : { "name" : "active_modems" },
+ "registered" : { "name" : "registered_modems" },
+ "util" : { "name" : "channel_utilization" },
+ "frequency" : { "scale" : 1000000.0 },
+}
check_metrics["check_mk-postgres_bloat"] = {}
check_metrics["check_mk-postgres_connections"] = {}
@@ -2234,3 +2276,18 @@ graph_info.append({
( "mail_queue_active_length", "stack" ),
],
})
+
+
+
+graph_info.append({
+ "title" : _("Modems"),
+ "metrics" : [
+ ( "active_modems", "area" ),
+ ( "registered_modems", "line" ),
+ ( "total_modems", "line" ),
+ ],
+})
+
+define_generic_graph("channel_utilization")
+define_generic_graph("signal_noise")
+define_generic_graph("frequency")