Module: check_mk
Branch: master
Commit: 349feaaf2862f7ab54724f9a03fdd9b33a8f82f1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=349feaaf2862f7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 19 16:21:47 2013 +0100
FIX: Improved handling of error messages in bulk inventory
---
ChangeLog | 1 +
web/htdocs/js/wato.js | 5 ++++-
web/htdocs/wato.css | 8 +++++++-
web/htdocs/wato.py | 9 +++++----
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 27915ab..3408605 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
Multisite:
* FIX: Fixed problem with error during localization scanning
* FIX: Fixed wrong localization right after a user changed its language
+ * FIX: Improved handling of error messages in bulk inventory
Checks & Agents:
* Linux agent: limit netstat to 10 seconds
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index 759451d..93bd678 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -279,7 +279,10 @@ function progress_handle_response(data, code, http_code) {
header.push(0);
}
}
- body = 'HTTP-Request failed (' + http_code + ', ' + data +
')'
+ body = 'Inventory of ' + item + ' failed\n'
+ +'<div class=exc><h1>HTTP-Request failed</h1>'
+ +'HTTP-Code: ' + http_code + '<br />'
+ +'Parameters: ' + data + '</div>\n';
} else {
// Regular response processing
try {
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 0f04c6b..4b34f30 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -894,7 +894,7 @@ div.varname {
}
/* Log window */
-.wato table.progress td.log div {
+.wato table.progress td.log > div {
background-image: url("images/form_background.png");
background-repeat: repeat;
border: 1px solid #fff;
@@ -909,6 +909,12 @@ div.varname {
padding: 12px 12px 0px 12px;
}
+.wato table.progress td.log div.exc {
+ border: 1px solid #ff0000;
+ margin: 10px;
+ padding: 5px;
+}
+
/* progress bar */
.wato table.progress td.bar {
padding: 0 12px 0 12px;
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 8b920ca..d37b07d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2563,12 +2563,13 @@ def mode_bulk_inventory(phase):
except Exception, e:
result = repr([ 'failed', 1, 1, 0, 0, 0, 0, ]) + "\n"
if site_id:
- msg = _("Error during inventory of %s on site %s: %s") %
(hostname, site_id, e)
+ msg = _("Error during inventory of %s on site %s<div
class=exc>%s</div") % \
+ (hostname, site_id, e)
else:
- msg = _("Error during inventory of %s: %s") % (hostname,
e)
+ msg = _("Error during inventory of %s<div
class=exc>%s</div>") % (hostname, e)
if config.debug:
- msg += "<br><pre>%s</pre>" %
format_exception().replace("\n", "<br>")
- result += msg + "\n<br>"
+ msg += "<br><pre>%s</pre><br>" %
format_exception().replace("\n", "<br>")
+ result += msg
if not host.get("inventory_failed"):
host["inventory_failed"] = True
save_hosts(folder)