Module: check_mk
Branch: master
Commit: d822b94e2acf89c21794d29d9950f21e43cbab0b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d822b94e2acf89…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 11:29:34 2013 +0100
Updated bug entries #1085
---
.bugs/1085 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/1085 b/.bugs/1085
index 0890761..d144dd3 100644
--- a/.bugs/1085
+++ b/.bugs/1085
@@ -1,9 +1,12 @@
Title: Personal settings: name of language de missing
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2013-11-25 10:36:27
Targetversion: future
-Class: nastiness
In the personal setting when you want to select a language,
instead of "German" there is just a "de".
+
+2013-12-16 11:26:00: changed state open -> done
+Just added the missing alias file
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
Module: check_mk
Branch: master
Commit: 27c3e925289f9f9bd7a072cb7eeca36c5574894f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27c3e925289f9f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 10:49:40 2013 +0100
Updated bug entries #0939
---
.bugs/939 | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/.bugs/939 b/.bugs/939
index 4e113ed..6b00772 100644
--- a/.bugs/939
+++ b/.bugs/939
@@ -1,9 +1,9 @@
Title: windows_agent: loadlibrary call with *.rll fails
Component: checks
-State: open
+Class: bug
+State: wontfix
Date: 2013-09-24 10:06:29
Targetversion: 1.2.3i6
-Class: bug
0.078000 - record 219666: process_eventlog_entries bytesread 448, event->Length 448
0.078000 - record 219667: DLLs to load: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\Resources\1031\sqlevn70.rll
@@ -13,3 +13,10 @@ rll files are Windows Resource Libraries ( used for localisation )
The loadlibrary call in the check_mk_agent fails when loading the sqlevn70.rll
file, leading to an incorrect localized (not localized at all...) message
+
+2013-12-16 10:49:37: changed state open -> wontfix
+There is no documentation in the internet of how to correctly
+load *.rll files. It could even be the case the that file should
+be loaded by the DLL itself. Since this seems to be hard to
+fix and the error message seems to be present at least unlocalized
+or incomplete, we close this bug.
Module: check_mk
Branch: master
Commit: 80fb5bc743a13ab22c94f6e82c131453ba9e112e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=80fb5bc743a13a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 10:36:09 2013 +0100
Updated bug entries #0828
---
.bugs/828 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.bugs/828 b/.bugs/828
index 9d51899..f8416f1 100644
--- a/.bugs/828
+++ b/.bugs/828
@@ -1,10 +1,12 @@
Title: locale C.UTF8 is missing at least in Debian Squeeze
Component: checks
-State: open
+Class: bug
+State: done
Date: 2013-08-19 09:38:38
Targetversion: future
-Class: bug
If using Debian 6 with flexible notification system, plain email and umlauts
in alias, the mail never receives the mail. Reason is the missing C.UTF8
locale. In german debian versions, there is only de_DE.utf8.
+
+2013-12-16 10:36:03: changed state open -> done
Module: check_mk
Branch: master
Commit: 1d851786ea31c49853325260c63ccbbbd35905d5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1d851786ea31c4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 10:33:10 2013 +0100
FIX Fix email notifications containing non-ASCII characters in some situtations
On some systems the locale C.UTF-8 was not always available. One of these is
Debien Squeeze. Sending a notification email containing non-ASCII characters
like german Umlauts failed in these situations.
This now has been fixed by scanning all available encodings (output of locale
-a) and selecting an existing UTF-8 encoding. Please make sure that at least
one such encoding exists.
This fix also makes sure that the output of a failed mail submission is
being logged in the notification log (if you have enabled it).
---
.werks/58 | 19 +++++++++++++++++++
ChangeLog | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/notify.py | 46 ++++++++++++++++++++++++++++++++++-----------
3 files changed, 108 insertions(+), 11 deletions(-)
diff --git a/.werks/58 b/.werks/58
new file mode 100644
index 0000000..c37c918
--- /dev/null
+++ b/.werks/58
@@ -0,0 +1,19 @@
+Title: Fix email notifications containing non-ASCII characters in some situtations
+Level: 2
+Component: notifications
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387186122
+Targetversion: future
+
+On some systems the locale C.UTF-8 was not always available. One of these is
+Debien Squeeze. Sending a notification email containing non-ASCII characters
+like german Umlauts failed in these situations.
+
+This now has been fixed by scanning all available encodings (output of locale
+-a) and selecting an existing UTF-8 encoding. Please make sure that at least
+one such encoding exists.
+
+This fix also makes sure that the output of a failed mail submission is
+being logged in the notification log (if you have enabled it).
diff --git a/ChangeLog b/ChangeLog
index 30fdfac..91fad79 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...
+
+ 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...
+ * 0058 FIX: Fix email notifications containing non-ASCII characters in some situtations...
+
+ 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/modules/notify.py b/modules/notify.py
index f72e5b9..c845081 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -34,7 +34,7 @@
# hostname, servicedesc, hoststate, servicestate, output in
# the form %(variable)s
-import pprint, urllib, select
+import pprint, urllib, select, subprocess
# Default settings
notification_logdir = var_dir + "/notify"
@@ -246,7 +246,7 @@ def process_context(context, write_into_spoolfile, use_method = None):
elif method == "email":
# We are searching for a specific
# but this contact does not offer any
- notify_log("ERROR: contact %r do not have any plugins (required: %s)" % (contact, use_method))
+ notify_log("ERROR: contact %r does not have any plugins (required: %s)" % (contact, use_method))
return 2
else:
found_plugin = {}
@@ -261,9 +261,12 @@ def process_context(context, write_into_spoolfile, use_method = None):
method = ('flexible', [found_plugin])
if type(method) == tuple and method[0] == 'flexible':
+ notify_log("Preparing flexible notifications for %s" % context["CONTACTNAME"])
return notify_flexible(context, method[1], write_into_spoolfile)
else:
+ notify_log("Sending plain email to %s" % context["CONTACTNAME"])
return notify_via_email(context, write_into_spoolfile)
+
except Exception, e:
notify_log("ERROR: %s\n%s" % (e, format_exception()))
sys.stderr.write("ERROR: %s\n" % e)
@@ -505,6 +508,7 @@ def notify_notify(context):
def notify_via_email(context, write_into_spoolfile):
if write_into_spoolfile:
+ notify_log("Spooled this notification.")
create_spoolfile({"context": context})
return 0
@@ -520,24 +524,44 @@ def notify_via_email(context, write_into_spoolfile):
subject = substitute_context(subject_t, context)
context["SUBJECT"] = subject
body = substitute_context(notification_common_body + body_t, context)
- command = substitute_context(notification_mail_command, context) + " >/dev/null 2>&1"
+ command = substitute_context(notification_mail_command, context)
command_utf8 = command.encode("utf-8")
- if notification_logging >= 2:
- notify_log("Executing command: %s" % command)
notify_log(body)
- # Make sure that mail(x) is using UTF-8. More then
- # setting the locale cannot be done here. We hope that
- # C.UTF-8 is always available. Please check the output
- # of 'locale -a' on your system if you are curious.
- os.putenv("LANG", "C.UTF-8")
+
+ # Make sure that mail(x) is using UTF-8. Otherwise we cannot send notifications
+ # with non-ASCII characters. Unfortunately we do not know whether C.UTF-8 is
+ # available. If e.g. nail detects a non-Ascii character in the mail body and
+ # the specified encoding is not available, it will silently not send the mail!
+ # Our resultion in future: use /usr/sbin/sendmail directly.
+ # Our resultion in the present: look with locale -a for an existing UTF encoding
+ # and use that.
+ for encoding in os.popen("locale -a"):
+ l = encoding.lower()
+ if "utf8" in l or "utf-8" in l or "utf.8" in l:
+ encoding = encoding.strip()
+ os.putenv("LANG", encoding)
+ if notification_logging >= 2:
+ notify_log("Setting locale for mail to %s." % encoding)
+ break
+ else:
+ notify_log("No UTF-8 encoding found in your locale -a! Please provide C.UTF-8 encoding.")
+
if notification_logging >= 2:
file(var_dir + "/notify/body.log", "w").write(body.encode("utf-8"))
# Important: we must not output anything on stdout or stderr. Data of stdout
# goes back into the socket to the CMC in keepalive mode and garbles the
# handshake signal.
- return os.popen(command_utf8, "w").write(body.encode("utf-8"))
+ if notification_logging >= 2:
+ notify_log("Executing command: %s" % command)
+ p = subprocess.Popen(command_utf8, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
+ stdout_txt, stderr_txt = p.communicate(body.encode("utf-8"))
+ exitcode = p.returncode
+ if exitcode != 0:
+ notify_log("ERROR: could not deliver mail. Exit code of command is %r" % exitcode)
+ for line in (stdout_txt + stderr_txt).splitlines():
+ notify_log("mail: %s" % line.rstrip())