Module: check_mk
Branch: master
Commit: f7bc03f7accfc7662f8f103c91547ed85f8dc222
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7bc03f7accfc7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 24 11:45:29 2015 +0100
Updated bug entries #2305
---
.bugs/2305 | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/.bugs/2305 b/.bugs/2305
new file mode 100644
index 0000000..aefec22
--- /dev/null
+++ b/.bugs/2305
@@ -0,0 +1,21 @@
+Title: User setting Disable Notifications vanishes also for admin for permission is missing
+Component: wato
+State: open
+Date: 2015-02-24 11:43:13
+Targetversion: 1.2.6
+Class: bug
+
+If a user does not have the permission general.disable_notifications, then the checkbox
+in his personal settings for this option is not visible. Even if the user settings are edited
+by the admin!
+
+Solution:
+
+1. The admin must have the permission to change this flag - regardless of the permission of
+ the user
+
+2. If the permission is missing for the user then the actual setting must be displayed
+ read-only nevertheless!
+
+In our case the notifications were disabled but this was completely hidden and only
+visible in users.mk.
Module: check_mk
Branch: master
Commit: 745dd56f57c846f663932671c5b109bd8e85cfe4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=745dd56f57c846…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 24 10:20:51 2015 +0100
Updated bug entries #2304
---
.bugs/2304 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2304 b/.bugs/2304
new file mode 100644
index 0000000..bac8b78
--- /dev/null
+++ b/.bugs/2304
@@ -0,0 +1,9 @@
+Title: Process piggyback data even if "no agent" is selected
+Component: core
+State: open
+Date: 2015-02-24 10:18:14
+Targetversion: 1.2.6
+Class: bug
+
+If you just get Piggy data for a host you must be able to select 'no agent'. But
+in that case the piggy data is not being processed - at least not by the inventory.
Module: check_mk
Branch: master
Commit: 50f085ba4831f6879c65e1e26027a87617ae6164
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50f085ba4831f6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 24 10:17:49 2015 +0100
win_dmidecode.bat: make output parsable by MK inventory
---
agents/windows/plugins/win_dmidecode.bat | 4 ++--
inventory/dmidecode | 8 +++++++-
modules/check_mk_base.py | 20 ++++++++++++--------
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/agents/windows/plugins/win_dmidecode.bat b/agents/windows/plugins/win_dmidecode.bat
index e0bfb9f..5d60a83 100644
--- a/agents/windows/plugins/win_dmidecode.bat
+++ b/agents/windows/plugins/win_dmidecode.bat
@@ -11,5 +11,5 @@ REM * This plugin should work out of the box if you install dmidecode
REM * to the default location.
REM ***
-echo ^<^<^<dmidecode^>^>^>
-C:\Programme\GnuWin32\sbin\dmidecode.exe -t 1 -q
+echo ^<^<^<dmidecode:sep(0):nostrip^>^>^>
+C:\Programme\GnuWin32\sbin\dmidecode.exe -q
diff --git a/inventory/dmidecode b/inventory/dmidecode
index 382875e..4feeb3c 100644
--- a/inventory/dmidecode
+++ b/inventory/dmidecode
@@ -62,11 +62,17 @@
#
# ... any many other sections...
-
+# Note: on Linux \t is replaced by : and then the split
+# is done by :. On Windows the \t comes 1:1 and no splitting
+# is being done. So we need to split manually here
def inv_dmidecode(info):
section_name = None
section_lines = []
for line in info:
+ # Windows plugin keeps tabs and has no separator
+ if len(line) == 1:
+ parts = line[0].replace("\t", ":").split(":")
+ line = [ x.strip() for x in parts ]
if len(line) == 1:
if section_name:
inv_dmidecode_parse_section(section_name, section_lines)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index f97061e..50d471f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -475,8 +475,7 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age, ignore_che
elif len(output) < 16:
raise MKAgentError("Too short output from agent: '%s'" % output)
- lines = [ l.strip() for l in output.split('\n') ]
- info, piggybacked, persisted = parse_info(lines, hostname)
+ info, piggybacked, persisted = parse_info(output.split("\n"), hostname)
store_piggyback_info(hostname, piggybacked)
store_persisted_info(hostname, persisted)
store_cached_hostinfo(hostname, info)
@@ -794,7 +793,6 @@ def store_cached_checkinfo(hostname, checkname, table):
# 2. piggy-backed data for other hosts
# 3. Sections to be persisted for later usage
def parse_info(lines, hostname):
-
info = {}
piggybacked = {} # unparsed info for other hosts
persist = {} # handle sections with option persist(...)
@@ -804,8 +802,10 @@ def parse_info(lines, hostname):
separator = None
encoding = None
for line in lines:
- if line[:4] == '<<<<' and line[-4:] == '>>>>':
- host = line[4:-4]
+ line = line.rstrip("\r")
+ stripped_line = line.strip()
+ if stripped_line[:4] == '<<<<' and stripped_line[-4:] == '>>>>':
+ host = stripped_line[4:-4]
if not host:
host = None
else:
@@ -817,8 +817,8 @@ def parse_info(lines, hostname):
# Found normal section header
# section header has format <<<name:opt1(args):opt2:opt3(args)>>>
- elif line[:3] == '<<<' and line[-3:] == '>>>':
- section_header = line[3:-3]
+ elif stripped_line[:3] == '<<<' and stripped_line[-3:] == '>>>':
+ section_header = stripped_line[3:-3]
headerparts = section_header.split(":")
section_name = headerparts[0]
section_options = {}
@@ -848,7 +848,10 @@ def parse_info(lines, hostname):
# The section data might have a different encoding
encoding = section_options.get("encoding")
- elif line != '':
+ elif stripped_line != '':
+ if "nostrip" not in section_options:
+ line = stripped_line
+
if encoding:
try:
decoded_line = line.decode(encoding)
@@ -856,6 +859,7 @@ def parse_info(lines, hostname):
except:
pass
section.append(line.split(separator))
+
return info, piggybacked, persist
Module: check_mk
Branch: master
Commit: 4afc6d3bbb800058b2ebfdad2892cdf71d480b2d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4afc6d3bbb8000…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 24 10:16:41 2015 +0100
#2037 FIX Inventorize piggy back data even if access to normal agent fails
---
.werks/2037 | 10 ++++++++++
ChangeLog | 1 +
modules/discovery.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/2037 b/.werks/2037
new file mode 100644
index 0000000..9bcf3de
--- /dev/null
+++ b/.werks/2037
@@ -0,0 +1,10 @@
+Title: Inventorize piggy back data even if access to normal agent fails
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424769389
+
+
diff --git a/ChangeLog b/ChangeLog
index e7cd726..33f3b95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
* 1982 FIX: Fixed exception during checking regular checking when having checks without discovery function
* 2012 FIX: Piggyback hostname translation can now deal correctly with umlauts
* 2014 FIX: Fixed different issues running Check_MK on CentOS 5.x
+ * 2037 FIX: Inventorize piggy back data even if access to normal agent fails
Checks & Agents:
* 1665 agent_netapp: New special agent for NetApp monitoring via Web-API...
diff --git a/modules/discovery.py b/modules/discovery.py
index b6bb015..2b1f6dd 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -377,7 +377,7 @@ def discover_check_type(hostname, ipaddress, check_type, use_caches):
info = None # default in case of exception
info = get_info_for_discovery(hostname, ipaddress, section_name, use_caches)
except MKAgentError, e:
- if str(e):
+ if str(e) and str(e) != "Cannot get information from agent, processing only piggyback data.":
raise
except MKSNMPError, e:
if str(e):
Module: check_mk
Branch: master
Commit: 96d5b44e760431d7b3a5a525956eeddbc678015a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96d5b44e760431…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 23 18:06:38 2015 +0100
Rename dmi_sysinfo.bat to win_dmidecode.bat
Inventory expects the section <<<dmidecode>>>
---
agents/windows/plugins/{ => deprecated}/dmi_sysinfo.bat | 0
agents/windows/plugins/win_dmidecode.bat | 15 +++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/agents/windows/plugins/dmi_sysinfo.bat b/agents/windows/plugins/deprecated/dmi_sysinfo.bat
similarity index 100%
rename from agents/windows/plugins/dmi_sysinfo.bat
rename to agents/windows/plugins/deprecated/dmi_sysinfo.bat
diff --git a/agents/windows/plugins/win_dmidecode.bat b/agents/windows/plugins/win_dmidecode.bat
new file mode 100644
index 0000000..e0bfb9f
--- /dev/null
+++ b/agents/windows/plugins/win_dmidecode.bat
@@ -0,0 +1,15 @@
+@echo off
+
+REM ***
+REM * To be able to run this plugin you need to install dmidecode
+REM * on your windows client.
+REM *
+REM * You can download dmidecode for windows from
+REM * <http://gnuwin32.sourceforge.net/packages/dmidecode.htm>
+REM *
+REM * This plugin should work out of the box if you install dmidecode
+REM * to the default location.
+REM ***
+
+echo ^<^<^<dmidecode^>^>^>
+C:\Programme\GnuWin32\sbin\dmidecode.exe -t 1 -q