Module: check_mk
Branch: master
Commit: b3213a9c973d6cbeac016b902fe9ea67b28777ab
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3213a9c973d6c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 24 17:02:54 2011 +0200
Perf-O-Meters are now aware if there really is a PNP graph
---
.bugs/112 | 7 ++++++-
ChangeLog | 1 +
web/plugins/views/perfometer.py | 7 +++++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/.bugs/112 b/.bugs/112
index ca50fe4..0204532 100644
--- a/.bugs/112
+++ b/.bugs/112
@@ -1,6 +1,6 @@
Title: PNP-Links in Perf-O-Meter should be intelligent
Component: multisite
-State: open
+State: done
Class: cleanup
Date: 2011-01-28 09:34:33
Benefit: 1
@@ -9,3 +9,8 @@ Fun: 0
If there is no PNP database the perfometer should not contain a hlink
to PNP. We can use the same logic as in the intelligent PNP icon.
+
+2011-08-24 17:02:17: changed state open -> done
+If no information avaiable, then the link is always displayed (-1)
+This is the case if the user has not configured a rrdpath when load
+ing livestatus.
diff --git a/ChangeLog b/ChangeLog
index e18efdf..333f278 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
* Added several missing i18n strings in view editor
* Views can now be sorted by the users by clicking on the table headers.
The user sort options are not persisted.
+ * Perf-O-Meters are now aware if there really is a PNP graph
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 126512b..78fec0f 100644
--- a/web/plugins/views/perfometer.py
+++ b/web/plugins/views/perfometer.py
@@ -155,7 +155,9 @@ def paint_perfometer(row):
content += '<div class=title>%s</div>' % title
content += '<img class=glass
src="images/perfometer-bg.png">'
- if 'X' in html.display_options:
+ # pnpgraph_present: -1 means unknown (path not configured), 0: no, 1: yes
+ if 'X' in html.display_options and \
+ row["service_pnpgraph_present"] != 0:
return "perfometer", ('<a
href="%s">%s</a>' % (pnp_url(row, "service"), content))
else:
return "perfometer", content
@@ -169,7 +171,8 @@ def paint_perfometer(row):
multisite_painters["perfometer"] = {
"title" : _("Service Perf-O-Meter"),
"short" : _("Perf-O-Meter"),
- "columns" : [ "service_perf_data", "service_state",
"service_check_command" ],
+ "columns" : [ "service_perf_data", "service_state",
+ "service_check_command", "service_pnpgraph_present"
],
"paint" : paint_perfometer
}