Module: check_mk
Branch: master
Commit: 8b30c1b62259783c4263b18bed94a2bd5ce3ecce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b30c1b6225978…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 11:09:09 2013 +0100
FIX Most forms did now work with "Profile Requests" enabled
In multisite profiling mode all POST requests were not working in
the latest versions. The POST vars were not available during processing
the profiled page.
---
.bugs/2102 | 7 ++++--
.werks/327 | 12 +++++++++
ChangeLog | 54 +++++++++++++++++++++++++++++++++++++++++
web/htdocs/html_mod_python.py | 9 ++++---
web/htdocs/index.py | 22 ++++++++++-------
5 files changed, 90 insertions(+), 14 deletions(-)
diff --git a/.bugs/2102 b/.bugs/2102
index f9ddb21..3115618 100644
--- a/.bugs/2102
+++ b/.bugs/2102
@@ -1,12 +1,15 @@
Title: Multisite python profiler can not handle POST data.
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2013-12-11 16:22:53
Targetversion: future
-Class: bug
Any POST data vanishs by the second run of the index.handler(apache._profiling_req)
function
GET parameters of the same query are preserved.
Enabling the global option "Profile Requests" successfully shuts down most of
the formulars
which are using the POST method. This also applies to the snapshot synchronisation.
+
+2013-12-16 11:07:34: changed state open -> done
+Has been fixed
diff --git a/.werks/327 b/.werks/327
new file mode 100644
index 0000000..a59338b
--- /dev/null
+++ b/.werks/327
@@ -0,0 +1,12 @@
+Title: Most forms did now work with "Profile Requests" enabled
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387188456
+Targetversion: future
+
+In multisite profiling mode all POST requests were not working in
+the latest versions. The POST vars were not available during processing
+the profiled page.
diff --git a/ChangeLog b/ChangeLog
index 30fdfac..5c1fc12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,58 @@
1.2.5i1:
+ Core & Setup:
+ * 0087 FIX: Fixed possible locking issue when using datasource program with long
output...
+ * 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
+
+ Checks & Agents:
+ * 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
+ * 0073 moxa_iologik_register: new check to monitor moxa e2000 series registers
+ * 0105 apc_humidity: New Check for humidity levels on APC Devices
+ * 0106 3ware_units: The verifying state is now handled as ok...
+ * 0086 timemachine: new check checking the age of latest backup by timemachine on MAC
OS
+ * 0074 raritan_pdu_plugs: new check for Raritan PX-2000 family PDUs...
+ * 0107 stulz_alerts, stulz_powerstate, stulz_temp, stulz_humidity: New Checks for
Stulz clima devices
+ * 0075 raritan_pdu_inlet: new check to monitor inlet sensors of the Raritan PX-2000
PDUs
+ * 0315 hitachi_hnas_quorumdevice, hitachi_hnas_pnode, hitachi_hnas_vnode: New checks
for Hitachi HNAS devices
+ * 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
+ * 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
+ * 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
+ * 0305 FIX: apache_status: Fixed exception when agent reports HTML code as
apache-status data...
+ * 0104 FIX: mssql: Server instances with underline in name are now supported....
+ * 0240 FIX: Virtualmachine names with space no longer have missing piggyback data...
+ * 0310 FIX: apache_status: Improved handling of unexpeted data sent by agents...
+ * 0088 FIX: esx_vsphere_datastores: fixed error with reported capacity of 0 bytes...
+ * 0243 FIX: cisco_qos: no longer crashes when the qos policy name is not set...
+ * 0326 FIX: hr_fs printer_supply: Improved translation of wrong encoded chars...
+
+ Multisite:
+ * 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in
Chrome/IE
+ * 0239 FIX: Fixed incorrect html formatting when displaying host or service
comments...
+ * 0307 FIX: Increased performance of multisite GUI with a large userbase...
+ * 0312 FIX: Hiding views related to not existing datasources, like the EC now...
+ * 0325 FIX: Removed CSV export icon from availability views...
+ * 0327 FIX: Most forms did now work with "Profile Requests" enabled...
+
+ WATO:
+ * 0308 Multisite can now set rotation view permissions for NagVis...
+ * 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
+ * 0241 FIX: Improved sorting of WATO folders in dropdown menu...
+ * 0019 FIX: Fixed wording in WATO rule for MSSQL check
+ * 0242 FIX: Parameters for clustered services can now be configured on the cluster
host...
+ * 0309 FIX: Trying to prevent read/write conflicts with a large user base...
+ * 0311 FIX: Fixed "Inventory failed" message when trying an inventory on
clusters via WATO...
+
+ Notifications:
+ * 0108 FIX: Prevent service notification on host alerts...
+
+ Reporting & Availability:
+ * 0018 New option for displaying a legend for the colors used in the timeline...
+
+ Event Console:
+ * 0301 Handling messages of special syslog format correctly...
+ * 0303 FIX: Old log entries were shown in event history first...
+ * 0304 FIX: Escaping several unwanted chars from incoming log messages...
+ * 0089 FIX: CSV export of event console was broken...
+
1.2.3i7:
Core & Setup:
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 3ad0d04..2bcde4d 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -5,7 +5,7 @@ import defaults
class html_mod_python(htmllib.html):
- def __init__(self, req):
+ def __init__(self, req, fields):
# All URIs end in .py. We strip away the .py and get the
# name of the page.
@@ -13,6 +13,10 @@ class html_mod_python(htmllib.html):
self.req = req
htmllib.html.__init__(self)
self.user = req.user
+ if fields:
+ self.fields = fields
+ else:
+ self.fields = util.FieldStorage(self.req, keep_blank_values = 1)
self.read_get_vars()
self.read_cookies()
@@ -41,8 +45,7 @@ class html_mod_python(htmllib.html):
self.cookies = Cookie.get_cookies(self.req)
def read_get_vars(self):
- fields = util.FieldStorage(self.req, keep_blank_values = 1)
- self.parse_field_storage(fields)
+ self.parse_field_storage(self.fields)
def lowlevel_write(self, text):
if self.io_error:
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 7c080a8..1cd53eb 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -180,16 +180,14 @@ def load_all_plugins():
__builtin__.load_all_plugins = load_all_plugins
# Main entry point for all HTTP-requests (called directly by mod_apache)
-def handler(req, profiling = True):
+def handler(req, fields = None, profiling = True):
req.content_type = "text/html; charset=UTF-8"
req.header_sent = False
-
# Create an object that contains all data about the request and
# helper functions for creating valid HTML. Parse URI and
# store results in the request object for later usage.
- html = html_mod_python(req)
-
+ html = html_mod_python(req, fields)
html.enable_debug = config.debug
html.id = {} # create unique ID for this request
__builtin__.html = html
@@ -213,13 +211,19 @@ def handler(req, profiling = True):
# profiling can be enabled in multisite.mk
if profiling and config.profile:
import cProfile # , pstats, sys, StringIO, tempfile
- # the profiler looses the memory about all modules. We need to park
- # the request object in the apache module. This seems to be persistent.
+ # the profiler looses the memory about all modules. We need to hand over
+ # the request object in the apache module.
# Ubuntu: install python-profiler when using this feature
- apache._profiling_req = req
profilefile = defaults.var_dir + "/web/multisite.profile"
- retcode = cProfile.run("import index; from mod_python import apache;
index.handler(apache._profiling_req, False)", profilefile)
- file(profilefile + ".py",
"w").write("#!/usr/bin/python\nimport pstats\nstats =
pstats.Stats(%r)\nstats.sort_stats('time').print_stats()\n" % profilefile)
+ retcode = cProfile.runctx(
+ "import index; "
+ "index.handler(profile_req, profile_fields, False)",
+ {'profile_req': req, 'profile_fields': html.fields}, {},
profilefile)
+ file(profilefile + ".py", "w").write(
+ "#!/usr/bin/python\n"
+ "import pstats\n"
+ "stats = pstats.Stats(%r)\n"
+ "stats.sort_stats('time').print_stats()\n" %
profilefile)
os.chmod(profilefile + ".py", 0755)
release_all_locks()
return apache.OK