Module: check_mk
Branch: master
Commit: 16dbe37033676d72f19374fc2dbf4e7914f7dc3e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16dbe37033676d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 21 17:35:24 2011 +0100
WATO: fix missing service on windows
---
ChangeLog | 4 ++++
web/htdocs/htmllib.py | 5 ++++-
web/htdocs/index.py | 1 +
web/htdocs/wato.py | 4 ++--
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 672143f..dbb55b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,10 @@
* FIX: fix PNP icon in cases where host and service icons are displayed in
same view (found by Wolfgang Barth)
+ WATO:
+ * FIX: fix problem with vanishing services on Windows. Affected were services
+ containing colons (such as fs_C:/).
+
Livestatus:
* FIX: fix most compiler warnings (thanks to patch by Sami Kerola)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 14d800f..9316994 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import time, cgi, config, os, defaults, pwd
+import time, cgi, config, os, defaults, pwd, urllib
from lib import *
# Python 2.3 does not have 'set' in normal namespace.
# But it can be imported from 'sets'
@@ -98,6 +98,9 @@ def urlencode(value):
ret += c
return ret
+def urldecode(value):
+ return urllib.unquote_plus(value)
+
def u8(c):
if ord(c) > 127:
return "&#%d;" % ord(c)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index b29431f..81d64c3 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -51,6 +51,7 @@ def read_get_vars(req):
def parse_vars(vars):
req.rawvars = util.parse_qs(vars, True)
for (key,values) in req.rawvars.items():
+ key = htmllib.urldecode(key)
if len(values) >= 1:
req.vars[key] = values[-1]
req.multivars[key] = values
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 7fa5f2c..903cebc 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -425,12 +425,12 @@ def mode_inventory(phase, firsttime):
elif (html.has_var("_activate_all") or
html.has_var("_fixall")) and st == "new":
active_checks[(ct, item)] = paramstring
else:
- varname = ("_%s_%s" % (ct, item)).replace(' ',
'+')
+ varname = "_%s_%s" % (ct, item)
if html.var(varname, "") != "":
active_checks[(ct, item)] = paramstring
check_mk_automation("set-autochecks", [hostname], active_checks)
- message = "Saved check configuration of host [%s] with %d checks" %
(hostname, len(active_checks))
+ message = "Saved check configuration of host [%s] with %d services"
% (hostname, len(active_checks))
log_pending(hostname, "set-autochecks", message)
return new_target, message
return "index"