Module: check_mk
Branch: master
Commit: 4af399e381556c1927fe1b85429caa9639680000
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4af399e381556c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 21 15:07:09 2011 +0200
FIX: Multisite: avoid seven broken images in case of missing PNP graphs
---
.bugs/315 | 12 +++++++++---
ChangeLog | 1 +
web/htdocs/js/check_mk.js | 7 ++++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.bugs/315 b/.bugs/315
index ca19841..47334c1 100644
--- a/.bugs/315
+++ b/.bugs/315
@@ -1,11 +1,17 @@
Title: embedded PNP-graphs broken if none are there
Component: multisite
+State: done
+Class: nastiness
+Date: 2011-07-22 10:56:11
Benefit: 1
-State: open
Cost: 1
-Date: 2011-07-22 10:56:11
-Class: nastiness
+Fun: 0
If you got to the service details of a service without performance
data, then the embedded PNP-Graph area is not empty but shows
seven broken images.
+
+2011-08-21 15:06:22: changed state open -> done
+We show the fall back images only in case of a 404 respone
+from the webserver (meaning that the JSON webserver is not
+available).
diff --git a/ChangeLog b/ChangeLog
index e2685fb..cc7bdb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
Multisite:
* FIX: reschedule now works for host names containing spaces
* FIX: correctly sort log views in case of multi site setups
+ * FIX: avoid seven broken images in case of missing PNP graphs
* New sorters for time and line number of logfile entries
* Bookmarks snapin: save relative URLs whenever possible
* Man-Pages of Check_MK checks shown in Multisite honor OMD's local hierarchy
diff --git a/web/htdocs/js/check_mk.js b/web/htdocs/js/check_mk.js
index 26a5469..66ef51d 100644
--- a/web/htdocs/js/check_mk.js
+++ b/web/htdocs/js/check_mk.js
@@ -225,7 +225,12 @@ function unhover_tab(linkobject)
// ----------------------------------------------------------------------------
function pnp_error_response_handler(data, statusCode) {
- fallback_graphs(data);
+ // PNP versions that do not have the JSON webservice respond with
+ // 404. Current version with the webservice answer 500 if the service
+ // in question does not have any PNP graphs. So we paint the fallback
+ // graphs only if the respone code is 404 (not found).
+ if (parseInt(statusCode) == 404)
+ fallback_graphs(data);
}
function pnp_response_handler(data, code) {