Module: check_mk
Branch: master
Commit: 43aaed8828e97b7b416645b002e934173cc72435
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=43aaed8828e97b…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Feb 1 09:38:04 2018 +0100
5701 Windows agent: renew logging
The logging functionality of the Windows agent was rewritten. The key
features and changes are as follows:
* The logs are built incrementally over time and rotated up to 5
copies once the log size of 8 MB is reached.
* The formatting of the log entries has been changed to include a
numeric log level (0...7) and an absolute timestamp with the
accuracy of milliseconds (instead of a relative time since the
agent started).
* The naming of agent logfiles has been changed: the agent logs to
CHECK_MK_AGENT_INSTALL_DIR\log\agent.log which will then be rotated
as agent.log.N, N={1...5}
* Crash info as subsection [[[Check_MK Agent]]] within the section
<<<logwatch>>> was removed. Now that the logs are persistent,
information about past crashes can be obtained in the logs.
* Debug log entries are enabled by setting crash_debug = yes in the
global section of check_mk.ini.
* The names of the various logfiles no longer appear in the output of
section Check_MK when crash_debug = yes.
---
.werks/5701 | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/.werks/5701 b/.werks/5701
new file mode 100644
index 0000000..c92c7cf
--- /dev/null
+++ b/.werks/5701
@@ -0,0 +1,32 @@
+Title: Windows agent: renew logging
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1517473402
+Class: feature
+
+The logging functionality of the Windows agent was rewritten. The key
+features and changes are as follows:
+
+ * The logs are built incrementally over time and rotated up to 5
+ copies once the log size of 8 MB is reached.
+ * The formatting of the log entries has been changed to include a
+ numeric log level (0...7) and an absolute timestamp with the
+ accuracy of milliseconds (instead of a relative time since the
+ agent started).
+ * The naming of agent logfiles has been changed: the agent logs to
+ CHECK_MK_AGENT_INSTALL_DIR\log\agent.log which will then be rotated
+ as agent.log.N, N={1...5}
+ * Crash info as subsection [[[Check_MK Agent]]] within the section
+ <<<logwatch>>> was removed. Now that the logs are persistent,
+ information about past crashes can be obtained in the logs.
+ * Debug log entries are enabled by setting crash_debug = yes in the
+ global section of check_mk.ini.
+ * The names of the various logfiles no longer appear in the output of
+ section Check_MK when crash_debug = yes.
+
+
+
+
Module: check_mk
Branch: master
Commit: b016e1c8b908f619cc86d7900cab983a5ca57102
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b016e1c8b908f6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Feb 1 09:59:28 2018 +0100
Fixed wrong calculation of delta tree
Change-Id: Ida873d707b07a7969076e90b31cd5afcf446bc42
---
lib/structured_data.py | 44 +++++++++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 13 deletions(-)
diff --git a/lib/structured_data.py b/lib/structured_data.py
index 1527d55..ddb4eed 100644
--- a/lib/structured_data.py
+++ b/lib/structured_data.py
@@ -738,6 +738,8 @@ class Numeration(Leaf):
def _compare_with_fixed_length(self, old, keep_identical=False):
+ # In this case we assume that each entry corresponds to the
+ # old one with the same index.
new, changed, removed = 0, 0, 0
data = []
for my_entries, old_entries in \
@@ -782,19 +784,35 @@ class Numeration(Leaf):
data.append({k: (v,None) for k,v in old_entry.iteritems()})
for intersect_key in intersect_keys:
- my_entries = set([x for x in my_converted[intersect_key].values()])
- old_entries = set([x for x in old_converted[intersect_key].values()])
- new_entries = my_entries - old_entries
- removed_entries = old_entries - my_entries
- for new_entry in new_entries:
- data.append({k: (None,v) for k,v in zip(intersect_key, new_entry)})
- for old_entry in old_entries:
- data.append({k: (v,None) for k,v in zip(intersect_key, old_entry)})
- new += len(new_entries)
- removed += len(removed_entries)
- if keep_identical:
- for intersect_entry in my_entries.intersection(old_entries):
- data.append({k: (v,v) for k,v in zip(intersect_key, old_entry)})
+ my_entries = my_converted[intersect_key].values()
+ old_entries = old_converted[intersect_key].values()
+ if len(my_entries) == len(old_entries):
+ data_entry = {}
+ # In this case we assume that each entry corresponds to the
+ # old one with the same index.
+ for k, my_entry, old_entry in zip(intersect_key, my_entries, old_entries):
+ if my_entry == old_entry:
+ if keep_identical:
+ data_entry.setdefault(k, (my_entry, my_entry))
+ else:
+ data_entry.setdefault(k, (old_entry, my_entry))
+ changed += 1
+ data.append(data_entry)
+
+ else:
+ my_entries = set(my_entries)
+ old_entries = set(old_entries)
+ new_entries = my_entries - old_entries
+ removed_entries = old_entries - my_entries
+ for new_entry in new_entries:
+ data.append({k: (None,v) for k,v in zip(intersect_key, new_entry)})
+ for removed_entry in removed_entries:
+ data.append({k: (v,None) for k,v in zip(intersect_key, removed_entry)})
+ new += len(new_entries)
+ removed += len(removed_entries)
+ if keep_identical:
+ for intersect_entry in my_entries.intersection(old_entries):
+ data.append({k: (v,v) for k,v in zip(intersect_key, old_entry)})
return new, changed, removed, data
Module: check_mk
Branch: master
Commit: f395806a1f5525b33bfdd6dd4d2a22b5fcd11752
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f395806a1f5525…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Feb 1 08:16:51 2018 +0100
Windows agent: update README
---
agents/windows/README | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/agents/windows/README b/agents/windows/README
index 5e3cd81..e01faad 100644
--- a/agents/windows/README
+++ b/agents/windows/README
@@ -54,10 +54,16 @@
RotatingFileHandler - (log)file rotation utility
stringutil - helper functions for string operations (some very crude, some are
probably obsolete)
- types - declaration of data types (most are probably superfluous)
+ types - declaration of data types
CrashHandler - produces backtraces on crashes
dynamic_func - small helper to get function handles dynamically
(for those functions not available on all windowses)
+ WritableFile - Wrapper for managing (a) writable file handle(s) over WinAPI
+
+** Tests
+ test/* - Unit tests (Google Test / Google Mock) for Windows agent
+ test/section - Unit tests for section wrappers
+ it/* - Integration tests (pytest) using a remote Windows VM
** Remaining files are not part of the agent
perftest.cc - commandline tool to test perfcounter interface (old api)
@@ -75,22 +81,31 @@
Currently mingw-w64 5.0.1-1 (http://mingw-w64.org), based on gcc 6.2.1, is used to build the agent.
The compilation uses GNU autotools and takes place within a chroot jail. The bash script
-'make-agent' is used for setting up the chroot jail and executing the desired build steps within it.
+'make-agent' (sudo necessary!) is used for setting up the chroot jail and executing the desired
+build steps within it.
** Build output
-The default make ('make-agent' without parameters) generates 4 binaries (2 for x86, 2 for x64):
+The default make ('sudo ./make-agent' without parameters) generates 4 binaries (2 for x86, 2 for
+x64):
check_mk_agent.exe (debugging symbols removed)
check_mk_agent-64.exe (debugging symbols removed)
wmitest.exe (debugging symbols removed)
wmitest-64.exe (debugging symbols removed)
In order to create executables with all debugging symbols (that is, without stripping the symbols
-during the installation step), please call 'make-agent install'.
+during the installation step), please call 'sudo ./make-agent install'.
Object files and other intermediate build artifacts are stored in the subdirectories "build" and
"build64".
+Unit tests are by default executed at the end of each build (make-agent without parameters). Unit
+tests (only 64 bit) can be built and run exclusively using 'sudo ./make-agent unittest'.
+
+Integration tests can be run using 'sudo ./make-agent integrationtest'. In order to do this, special
+SSH keys must be generated for the current user without password and saved as
+~/.ssh/id_rsa_windows_test[.pub]
+
** Debugging
* Debugger: mingw gdb