Module: check_mk
Branch: master
Commit: a364a3f6388c300cefb276a5b8187bdcaf371510
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a364a3f6388c30…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 27 17:29:33 2016 +0100
#3035 FIX Fixed broken graph preview when hovering graph icon in Check_MK Raw Edition
---
.werks/3035 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/js/checkmk.js | 32 +++++++++++++++++++-------------
web/plugins/icons/builtin.py | 2 +-
4 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/.werks/3035 b/.werks/3035
new file mode 100644
index 0000000..cb62d77
--- /dev/null
+++ b/.werks/3035
@@ -0,0 +1,9 @@
+Title: Fixed broken graph preview when hovering graph icon in Check_MK Raw Edition
+Level: 2
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453912145
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index b128181..38b3966 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -275,6 +275,7 @@
* 2968 FIX: Closing quicksearch results when moving mouse out of sidebar area
* 2969 FIX: Fixed folding of sidebar in Google Chrome
* 2970 FIX: Users now allowed to modify the sidebar (e.g. guests) can now not fold snapins anymore
+ * 3035 FIX: Fixed broken graph preview when hovering graph icon in Check_MK Raw Edition
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 072da4d..c079ce7 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -830,24 +830,30 @@ function hover_graph(site, host_name, service)
+'&service='+encodeURIComponent(service));
if (c.indexOf('pnp4nagios') !== -1) {
- // fallback to pnp graph handling
- var c = get_url_sync(c);
- // It is possible that, if using multisite based authentication, pnp sends a 302 redirect
- // to the login page which is transparently followed by XmlHttpRequest. There is no chance
- // to catch the redirect. So we try to check the response content. If it does not contain
- // the expected code, simply display an error message.
- if (c.indexOf('/image?') === -1) {
- // Error! unexpected response
- c = '<div class="error"> '
- + 'ERROR: Received an unexpected response '
- + 'while trying to display the PNP-Graphs. Maybe there is a problem with the '
- + 'authentication.</div>';
- }
+ // fallback to pnp graph handling (received an URL by the get_url_sync())
+ return fetch_pnp_hover_contents(c);
}
return c;
}
+function fetch_pnp_hover_contents(url)
+{
+ var c = get_url_sync(url);
+ // It is possible that, if using multisite based authentication, pnp sends a 302 redirect
+ // to the login page which is transparently followed by XmlHttpRequest. There is no chance
+ // to catch the redirect. So we try to check the response content. If it does not contain
+ // the expected code, simply display an error message.
+ if (c.indexOf('/image?') === -1) {
+ // Error! unexpected response
+ c = '<div class="error"> '
+ + 'ERROR: Received an unexpected response '
+ + 'while trying to display the PNP-Graphs. Maybe there is a problem with the '
+ + 'authentication.</div>';
+ }
+ return c;
+}
+
//#.
//# .-Reschedule---------------------------------------------------------.
//# | ____ _ _ _ |
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index e39837a..7f41124 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -356,7 +356,7 @@ def pnp_icon(row, what):
if not metrics.cmk_graphs_possible():
# Directly ask PNP for all data, don't try to use the new graph fetching mechanism
# to keep the number of single requests low
- hover_content_func = 'pnp_hover_contents(\'%s\')' % pnp_popup_url(row, what)
+ hover_content_func = 'fetch_pnp_hover_contents(\'%s\')' % pnp_popup_url(row, what)
else:
hover_content_func = 'hover_graph(\'%s\', \'%s\', \'%s\')' % \
(row['site'], row['host_name'], row.get('service_description', '_HOST_').replace("\\", "\\\\"))
Module: check_mk
Branch: master
Commit: 6a95d3df16ad2223c26bde073e325029619407ce
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a95d3df16ad22…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 27 15:48:54 2016 +0100
#3034 FIX cups_queues: Fixed bug when no user name available for a print job
---
.werks/3034 | 9 +++++++++
ChangeLog | 1 +
checks/cups_queues | 12 ++++--------
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/.werks/3034 b/.werks/3034
new file mode 100644
index 0000000..5c3e9bb
--- /dev/null
+++ b/.werks/3034
@@ -0,0 +1,9 @@
+Title: cups_queues: Fixed bug when no user name available for a print job
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453906110
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 5d9abbf..b128181 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -227,6 +227,7 @@
* 2983 FIX: netapp_api_disk: fixed exception when disks were not included in the raid...
* 2971 FIX: heartbeat_crm: Is now compatible with more forms of crm_mon output formats
* 2972 FIX: df: Filesystem trends: Outputting less senseless time left in case of nearly 0 growth
+ * 3034 FIX: cups_queues: Fixed bug when no user name available for a print job
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/cups_queues b/checks/cups_queues
index d5131c7..b561269 100644
--- a/checks/cups_queues
+++ b/checks/cups_queues
@@ -82,20 +82,16 @@ def check_cups_queues(item, params, info):
elif line[0].startswith(item+'-'):
# This is a queue item count the number of items and check the max age
numJobs += 1
- # Try to parse different time formats
- # Handle case where user names contain spaces
- # zam19-113565 Sebastian Hirschdobler 3561472 Fri Jul 31 12:58:01 2015
- time_parts = line[3:]
- while saveint(time_parts[0]) > 35:
- time_parts = time_parts[1:]
-
- timestring = ' '.join(time_parts)
+ # Try to parse different time formats. TODO: Couldn't we run the lpr command
+ # with some environment var to fixate the date format?
try:
# Tue Jun 29 09:05:54 2010
+ timestring = ' '.join(line[-5:])
parsed = time.strptime(timestring, '%a %b %d %H:%M:%S %Y')
except:
# Thu 29 Aug 2013 12:41:42 AM CEST
+ timestring = ' '.join(line[-7:])
parsed = time.strptime(timestring, '%a %d %b %Y %H:%M:%S %p %Z')
dt = time.mktime(parsed)