Module: check_mk
Branch: master
Commit: 6ed6ae5108450816a7a59157a0d859cf0c306117
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6ed6ae51084508…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 15:48:06 2016 +0100
Updated bug entries #2302
---
.bugs/2302 | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/.bugs/2302 b/.bugs/2302
index 14718b9..b1262ad 100644
--- a/.bugs/2302
+++ b/.bugs/2302
@@ -1,11 +1,16 @@
Title: mount check should ignore bind mounts
Component: checks
-State: open
+Class: bug
+State: wontfix
Date: 2015-02-20 09:25:31
Targetversion: 1.2.7
-Class: bug
With the new feature extra_sections, the df check should read the
mounts section and do the checking of the mount options here.
By that way we only check real filesystems and no duplicates. Also
this will reduce the number of checks.
+
+2016-01-19 15:48:04: changed state open -> wontfix
+Newer versions of df seem to automatically ignore these bind mounts.
+At least on Ubuntu 14.04 this works. So in order not to complicate
+things we wont do anything here.
Module: check_mk
Branch: master
Commit: 69c012cebddc60d231a0e896a8bcd00ebbf255f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69c012cebddc60…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 15:45:02 2016 +0100
Fix exception in parsing of autochecks if item contains quote
---
.bugs/2172 | 7 ++++---
.bugs/2173 | 2 +-
.bugs/856 | 2 +-
modules/discovery.py | 5 +++--
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/.bugs/2172 b/.bugs/2172
index 02887fb..eb6926b 100644
--- a/.bugs/2172
+++ b/.bugs/2172
@@ -5,6 +5,7 @@ Date: 2015-03-04 09:42:59
Targetversion: 1.2.7
Class: bug
-Currently in all saved userfiles unicode strings are converted to utf-8 encoding ascii strings.
-These strings are not converted back to unicode strings during load_user_file(..).
-All strings with umlauts need to be unicode strings within multisite code.
+Currently in all saved userfiles unicode strings are converted to utf-8
+encoding ascii strings. These strings are not converted back to unicode
+strings during load_user_file(..). All strings with umlauts need to be
+unicode strings within multisite code.
diff --git a/.bugs/2173 b/.bugs/2173
index 694a51f..396ce5c 100644
--- a/.bugs/2173
+++ b/.bugs/2173
@@ -2,7 +2,7 @@ Title: WATO backup: Do not save configuration files which are derived from omd c
Component: wato
State: open
Date: 2015-03-10 11:30:33
-Targetversion: 1.2.9
+Targetversion: future
Class: bug
Example:
diff --git a/.bugs/856 b/.bugs/856
index 2a0eadc..dbccba6 100644
--- a/.bugs/856
+++ b/.bugs/856
@@ -2,7 +2,7 @@ Title: Report scheduler doesn't pass "Group of Host" filter to the report
Component: core
State: open
Date: 2015-12-15 16:20:50
-Targetversion: 1.2.7
+Targetversion: 1.2.8
Class: bug
If you create a Report with context "Hostgroup", add a View with Service
diff --git a/modules/discovery.py b/modules/discovery.py
index fc6e011..7ed492d 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -1135,7 +1135,7 @@ def parse_autochecks_file(hostname):
backslash = True
elif c == quote:
quote = None # end of quoted string
- elif c in [ '"', "'" ]:
+ elif c in [ '"', "'" ] and not quote:
quote = c # begin of quoted string
elif quote:
continue
@@ -1149,6 +1149,7 @@ def parse_autochecks_file(hostname):
value = line[0:i]
rest = line[i+1:]
return value.strip(), rest
+
return line.strip(), None
path = "%s/%s.mk" % (autochecksdir, hostname)
@@ -1186,7 +1187,7 @@ def parse_autochecks_file(hostname):
if len(parts) == 4:
parts = parts[1:] # drop hostname, legacy format with host in first column
elif len(parts) != 3:
- raise Exception("Invalid number of parts: %d" % len(parts))
+ raise Exception("Invalid number of parts: %d (%r)" % (len(parts), parts))
checktypestring, itemstring, paramstring = parts
Module: check_mk
Branch: master
Commit: c704f5ed1883420eebd08bfdfe0f019326814e4c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c704f5ed188342…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 15:32:18 2016 +0100
#2927 FIX Fix links to logwatch logfiles in case of several special characters in the name
If you have logfile that contain brackets then now the icon from the logwatch service
to the GUI works.
---
.werks/2927 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 6 +++++-
web/htdocs/logwatch.py | 34 +++++++++++++++++++++++++++++++---
web/plugins/wato/bi.py | 5 +++++
5 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/.werks/2927 b/.werks/2927
new file mode 100644
index 0000000..c43a353
--- /dev/null
+++ b/.werks/2927
@@ -0,0 +1,10 @@
+Title: Fix links to logwatch logfiles in case of several special characters in the name
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453213894
+Class: fix
+
+If you have logfile that contain brackets then now the icon from the logwatch service
+to the GUI works.
diff --git a/ChangeLog b/ChangeLog
index caa14c9..373c413 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -188,6 +188,7 @@
* 2888 FIX: citrix_controller.licensing: ignoring double data from piggy backs
* 2899 FIX: ps: Finally improved performance impact of perfdata when having a lot of processes...
* 2917 FIX: cisco_asa_failover: Will no longer discover on devices where failover is disabled...
+ * 2927 FIX: Fix links to logwatch logfiles in case of several special characters in the name...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index a354f3b..c334b13 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1382,7 +1382,11 @@ class html(GUITester):
def debug(self, *x):
import pprint
for element in x:
- self.lowlevel_write("<pre>%s</pre>\n" % self.attrencode(pprint.pformat(element)))
+ try:
+ formatted = pprint.pformat(element)
+ except UnicodeDecodeError:
+ formatted = repr(element)
+ self.lowlevel_write("<pre>%s</pre>\n" % self.attrencode(formatted))
def has_cookie(self, varname):
diff --git a/web/htdocs/logwatch.py b/web/htdocs/logwatch.py
index ba8ed0e..64e34e2 100644
--- a/web/htdocs/logwatch.py
+++ b/web/htdocs/logwatch.py
@@ -30,6 +30,8 @@ import views
stylesheets = [ 'pages', 'status', 'logwatch' ]
+nagios_illegal_chars = '`;~!$%^&*|\'"<>?,()='
+
def level_name(level):
if level == 'W': return 'WARN'
elif level == 'C': return 'CRIT'
@@ -49,13 +51,16 @@ def level_state(level):
# | ___) | | | | (_) \ V V / | |__| (_) | (_| \__ \ |
# | |____/|_| |_|\___/ \_/\_/ |_____\___/ \__, |___/ |
# | |___/ |
-# +----------------------------------------------------------------------+
-# | |
# '----------------------------------------------------------------------'
def page_show():
host = html.var('host')
filename = html.var('file')
+ if "/" in host:
+ return
+
+ # Fix problem when URL is missing certain illegal characters
+ filename = form_file_to_ext(find_matching_logfile(host, form_file_to_int(filename)))
# Acknowledging logs is supported on
# a) all logs on all hosts
@@ -160,7 +165,30 @@ def ack_button(host = None, int_filename = None):
else:
label = _("Clear Logs")
- html.context_button(label, html.makeactionuri([('_ack', '1')]), 'delete')
+ urivars = [('_ack', '1')]
+ if int_filename:
+ urivars.append(("file", int_filename))
+ html.context_button(label, html.makeactionuri(urivars), 'delete')
+
+
+# Tackle problem, where some characters are missing in the service
+# description
+def find_matching_logfile(host, filename):
+ dir_path = defaults.logwatch_dir + '/' + host + '/'
+ if os.path.exists(dir_path + filename):
+ return filename # Most common case
+
+ for logfile_name in os.listdir(dir_path):
+ if remove_illegal_service_characters(logfile_name) == filename:
+ return logfile_name
+
+ # Not found? Fall back to original name. Logfile might be cleared.
+ return filename
+
+
+def remove_illegal_service_characters(filename):
+ return "".join([ c for c in filename if c not in nagios_illegal_chars ])
+
def show_file(host, filename):
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index 9b119a3..9c5b12c 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -1080,6 +1080,11 @@ class ModeBIRules(ModeBI):
def page(self):
+ path = defaults.var_dir + "/foobar"
+ wert = { u"öms": u"Hälooöⴰⴱⴲⴳⴴⴵⴶ", "x" : range(10), "ö" : "Ja" }
+ config.write_settings_file(path, wert)
+ wert2 = eval(file(path).read())
+ html.debug((wert, wert2, wert==wert2))
if not self._pack["aggregations"] and not self._pack["rules"]:
new_url = self.url_to_pack([("mode", "bi_edit_rule")])
menu_items = [
Module: check_mk
Branch: master
Commit: 56399dc45e59e8ccd3fcbd91a6a0e8e5e8b0396e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=56399dc45e59e8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 15:31:28 2016 +0100
Updated bug entries #2171, #2173, #2283, #2175
---
.bugs/2171 | 7 +++++--
.bugs/2173 | 6 +++++-
.bugs/2175 | 14 +++++++++++---
.bugs/2283 | 17 ++++++++++++-----
4 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/.bugs/2171 b/.bugs/2171
index f2f17ab..689561e 100644
--- a/.bugs/2171
+++ b/.bugs/2171
@@ -1,7 +1,10 @@
Title: windows agent: able to handle extensions with 2 characters (.py)
Component: checks
-State: open
+Class: bug
+State: works4me
Date: 2015-03-03 13:23:38
Targetversion: future
-Class: bug
+
+2016-01-19 14:04:13: changed state open -> works4me
+Should meanwhile work.
diff --git a/.bugs/2173 b/.bugs/2173
index 27a51af..694a51f 100644
--- a/.bugs/2173
+++ b/.bugs/2173
@@ -2,7 +2,7 @@ Title: WATO backup: Do not save configuration files which are derived from omd c
Component: wato
State: open
Date: 2015-03-10 11:30:33
-Targetversion: 1.2.7
+Targetversion: 1.2.9
Class: bug
Example:
@@ -17,3 +17,7 @@ Fix:
OMD configuration into a info file
- Upon snapshot restore, each backup domain checks if the requirements of this info file
are fulfilled. If not, it raises a warning and the snapshot can not get applied.
+
+
+Hm. This whole WATO backup/snapshot system is broken. We need to find a more clean
+solution to all.
diff --git a/.bugs/2175 b/.bugs/2175
index 34f2431..e7516dd 100644
--- a/.bugs/2175
+++ b/.bugs/2175
@@ -2,7 +2,7 @@ Title: DropdownChoice: Selects incorrect value if the list of options changes
Component: multisite
State: open
Date: 2015-07-02 09:36:51
-Targetversion: 1.2.7
+Targetversion: 1.2.8
Class: bug
1) Go to BI Rule editor
@@ -10,5 +10,13 @@ Class: bug
3) Modifiy the rules in the background, create new, move rule, etc.
4) Observe that wrong selection is stored
-Reason: The DropdownChoice valuespec uses the element number to identifiy an element
-If this number changes in the background the selection will be wrong
+Reason: The DropdownChoice valuespec uses the element number to identifiy
+an element If this number changes in the background the selection will be wrong
+
+Problem: since DropdownChoice can be used to edit arbitrary keys - not just
+strings, we cannot use other keys then these integers. In order to prevent
+users from storing unintended data we could create a checksum over the combined
+text that is displayed in the dropdown (i.e. the titles of the choices).
+We ship that in an URL variable. If that is present and does not match the
+actual choices then we can issue a MKUserError and the user must select
+again.
diff --git a/.bugs/2283 b/.bugs/2283
index 735590e..b06b3a0 100644
--- a/.bugs/2283
+++ b/.bugs/2283
@@ -1,10 +1,17 @@
-Title: logwatch: log entries with braces in names can not be shown in logwatch GUI
+Title: logwatch: several special characters will break links from logwatch icon
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2014-12-12 17:21:28
Targetversion: 1.2.7
-Class: bug
-Braces are not removed from logwatch stored files. Logwatch-GUI does not
-handle this difference correctly. e.g. mk_sap creates such logwatch files
+Brackets and quites and some other characters can be part of logfile names
+and thus appear in the paths below var/check_mk/logwatch. In the service
+descriptions these characters are removed. This the icon pointing to the
+logwatch GUI does not work. E.g. mk_sap creates such logwatch files.
+
+Solution cannot be renaming the stored logfiles. Better would be, if the
+GUI more intelligently can find the actual files.
+2016-01-19 15:31:11: changed state open -> done
+Should work now. Files are now intelligently been found.
Module: check_mk
Branch: master
Commit: a22e849555344dfb4803ab0efd6b4e8f6322ba09
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a22e849555344d…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Jan 19 15:30:02 2016 +0100
added missing openhardwaremonitor manpages
---
checkman/openhardwaremonitor | 17 ++---------------
checkman/openhardwaremonitor.fan | 24 ++++++++++++++++++++++++
checkman/openhardwaremonitor.power | 20 ++++++++++++++++++++
checkman/openhardwaremonitor.temperature | 28 ++++++++++++++++++++++++++++
4 files changed, 74 insertions(+), 15 deletions(-)
diff --git a/checkman/openhardwaremonitor b/checkman/openhardwaremonitor
index d3a410e..cbe8f3f 100644
--- a/checkman/openhardwaremonitor
+++ b/checkman/openhardwaremonitor
@@ -1,10 +1,10 @@
-title: Hardware Sensors via OpenHardwareMonitor
+title: Hardware Sensors via OpenHardwareMonitor: Clock
agents: windows
catalog: os/hardware
license: GPL
distribution: check_mk
description:
- This checks monitors hardware sensors reported by the tool
+ This checks monitors clock sensors (cpu, bus) reported by the tool
OpenHardwareMonitor (http://openhardwaremonitor.org/). check_mk
includes a stripped down version of OpenHardwareMonitor without
a gui component which can be installed through the agent backery
@@ -13,19 +13,6 @@ description:
the windows agent will ensure it is run (and restarted) as
necessary.
- This check currently monitors Temperature-, Fan-, Clock- and
- Power-Sensors for all devices supported by the tool.
- GPU sensors will not work when using the stripped down version of
- OHM. This is because windows services have no access to display
- devices (session 0 isolation).
-
- Only temperature sensors have levels by default based on device
- type.
- For fans, level can be configured but the default is to not warn,
- as OHM may report disconnected fans or fans that are regulated
- by temperature.
- Other check items are informational only.
-
item:
The name of the sensor as reported by OpenHardwareMonitor
diff --git a/checkman/openhardwaremonitor.fan b/checkman/openhardwaremonitor.fan
new file mode 100644
index 0000000..41fbf3d
--- /dev/null
+++ b/checkman/openhardwaremonitor.fan
@@ -0,0 +1,24 @@
+title: Hardware Sensors via OpenHardwareMonitor: Fans
+agents: windows
+catalog: os/hardware
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors fan speed sensors reported by the tool
+ OpenHardwareMonitor (http://openhardwaremonitor.org/). check_mk
+ includes a stripped down version of OpenHardwareMonitor without
+ a gui component which can be installed through the agent backery
+ or manually.
+ If the check_mks own version of ohm is used and installed correcty,
+ the windows agent will ensure it is run (and restarted) as
+ necessary.
+
+ This check has configurable {WARN} and {CRIT} levels but by default
+ NO levels are used, because there is no way to discover if the
+ fan is even connected and whether fan control may halt it completely.
+
+item:
+ The name of the sensor as reported by OpenHardwareMonitor
+
+inventory:
+ All available sensors are automatically inventorized.
diff --git a/checkman/openhardwaremonitor.power b/checkman/openhardwaremonitor.power
new file mode 100644
index 0000000..d0b05b5
--- /dev/null
+++ b/checkman/openhardwaremonitor.power
@@ -0,0 +1,20 @@
+title: Hardware Sensors via OpenHardwareMonitor: Power
+agents: windows
+catalog: os/hardware
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors power sensors (i.e. cpu) reported by the tool
+ OpenHardwareMonitor (http://openhardwaremonitor.org/). check_mk
+ includes a stripped down version of OpenHardwareMonitor without
+ a gui component which can be installed through the agent backery
+ or manually.
+ If the check_mks own version of ohm is used and installed correcty,
+ the windows agent will ensure it is run (and restarted) as
+ necessary.
+
+item:
+ The name of the sensor as reported by OpenHardwareMonitor
+
+inventory:
+ All available sensors are automatically inventorized.
diff --git a/checkman/openhardwaremonitor.temperature b/checkman/openhardwaremonitor.temperature
new file mode 100644
index 0000000..705c9ce
--- /dev/null
+++ b/checkman/openhardwaremonitor.temperature
@@ -0,0 +1,28 @@
+title: Hardware Sensors via OpenHardwareMonitor: Temperature
+agents: windows
+catalog: os/hardware
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors temperature sensors reported by the tool
+ OpenHardwareMonitor (http://openhardwaremonitor.org/). check_mk
+ includes a stripped down version of OpenHardwareMonitor without
+ a gui component which can be installed through the agent backery
+ or manually.
+ If the check_mks own version of ohm is used and installed correcty,
+ the windows agent will ensure it is run (and restarted) as
+ necessary.
+
+ All temperature sensors (cpu, hdd, ...) are handled through this
+ same check but different default levels are applied based on
+ device type:
+ cpu - warn = 60, crit = 70
+ hdd - warn = 40, crit = 50
+ others - warn = 70, crit = 80
+
+
+item:
+ The name of the sensor as reported by OpenHardwareMonitor
+
+inventory:
+ All available sensors are automatically inventorized.
Module: check_mk
Branch: master
Commit: 0bae41998426162c3888dabe33e96a8bc2397cc0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bae4199842616…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 13:42:15 2016 +0100
Reformatted bug
---
.bugs/856 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.bugs/856 b/.bugs/856
index 9b6a9cc..2a0eadc 100644
--- a/.bugs/856
+++ b/.bugs/856
@@ -5,4 +5,7 @@ Date: 2015-12-15 16:20:50
Targetversion: 1.2.7
Class: bug
-If you create a Report with context "Hostgroup", add a View with Service errors, this will work but not when the report is used in the scheduler. If the scheduler is used, the report shows all systems regradless of the given hostgroup
+If you create a Report with context "Hostgroup", add a View with Service
+errors, this will work but not when the report is used in the scheduler. If
+the scheduler is used, the report shows all systems regradless of the given
+hostgroup
Module: check_mk
Branch: master
Commit: 1661668322a91bcd4478cae533667525b12727c7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1661668322a91b…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Jan 19 13:39:43 2016 +0100
#2922 check_mk_agent.linux: mrpe sections can now be cached
---
.werks/2922 | 16 ++++++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 28 +++++++++++++++++++++++++++-
3 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/.werks/2922 b/.werks/2922
new file mode 100644
index 0000000..b33ded2
--- /dev/null
+++ b/.werks/2922
@@ -0,0 +1,16 @@
+Title: check_mk_agent.linux: mrpe sections can now be cached
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453198668
+Class: feature
+
+In the mrpe configuration (for linux systems only!) an optional parameter list can now be specified
+between service description and commandline in the following format:
+description (interval=300) /command/line
+The only supported parameter for now is interval. This activates caching fo the mrpe section and
+specifies the interval at which the cache should be refreshed.
+
+Existing mrpe configurations continue to work without change.
+This works only with the linux agent.
diff --git a/ChangeLog b/ChangeLog
index e315a64..e3e8626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,7 @@
* 2920 hr_cpu: this check can now also supports per-core features...
* 1322 solaris_prtdiag: New Check for Solaris Hardware State based on prtdiag
* 2921 printer_supply_ricoh: check now tries to handle negative readings properly...
+ * 2922 check_mk_agent.linux: mrpe sections can now be cached
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index b6f07e3..516d070 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -724,8 +724,34 @@ then
grep -Ev '^[[:space:]]*($|#)' "$MK_CONFDIR/mrpe.cfg" | \
while read descr cmdline
do
+ interval=
+ if [[ $cmdline =~ \(([^\)]*)\)[[:space:]](.*) ]]
+ then
+ parameters=${BASH_REMATCH[1]}
+ cmdline=${BASH_REMATCH[2]}
+
+ # split multiple parameter assignments
+ IFS=':' read -a parlist <<< $parameters
+ for par in "${parlist[@]}"
+ do
+ # split each assignment
+ IFS='=' read key value <<< $par
+ if [ "$key" = "interval" ]
+ then
+ interval=$value
+ # no other parameters supported currently
+ fi
+ done
+ fi
+
PLUGIN=${cmdline%% *}
- OUTPUT=$(eval "$cmdline")
+ if [ -z "$interval" ]
+ then
+ OUTPUT=$(eval "$cmdline")
+ else
+ OUTPUT=$(run_cached $descr $interval "$cmdline")
+ fi
+
echo -n "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1
echo
done