Module: check_mk
Branch: master
Commit: 17ae8d394d39a4a54a129b7035acbedc29553001
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17ae8d394d39a4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 17 10:37:51 2016 +0200
3531 Reduced Check_MK helper size for certain dists/python versions
The config of the Check_MK check helper is now written as marshaled python code,
instead of plain python text. This reduces the helpers peak resident memory size
while parsing the config file.
Some distributions (or python versions) tend not to shrink the resident memory
of the check helper again, so the check helper size can only grow.
By using marshaled config data the initial check helper size can be drastically lower.
Actual use case example:
System setup:
<ul>
<li>CentOS6</li>
<li>Python 2.6</li>
<li>11k Hosts</li>
<li>40k Services</li>
</ul>
The size of the config is roughly 8MB (this highly depends on the configured rules).
<table>
<tr><td>Marshal config</td><td>320MB</td></tr>
<tr><td>Plain text config</td><td>30MB</td></tr>
</table>
---
.werks/3531 | 34 ++++++++++++++++++++++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 19 ++++++++++++++-----
3 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/.werks/3531 b/.werks/3531
new file mode 100644
index 0000000..039d728
--- /dev/null
+++ b/.werks/3531
@@ -0,0 +1,34 @@
+Title: Reduced Check_MK helper size for certain dists/python versions
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.9i1
+Date: 1463473106
+Class: feature
+
+The config of the Check_MK check helper is now written as marshaled python code,
+instead of plain python text. This reduces the helpers peak resident memory size
+while parsing the config file.
+
+
+Some distributions (or python versions) tend not to shrink the resident memory
+of the check helper again, so the check helper size can only grow.
+
+
+By using marshaled config data the initial check helper size can be drastically lower.
+Actual use case:
+
+System setup
+<ul>
+<li>CentOS6</li>
+<li>Python 2.6</li>
+<li>11k Hosts</li>
+<li>40k Services</li>
+</ul>
+The size of the config is roughly 8MB (this highly depends on the configured rules).
+
+<table>
+<tr><td>Marshal config</td><td>320MB</td></tr>
+<tr><td>Plain text config</td><td>30MB</td></tr>
+</table>
+
diff --git a/ChangeLog b/ChangeLog
index fcdc6c8..186bf86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 3342 MKP: local/lib and local/bin of sites can now be packed...
* 3114 linux and windows agent can now be configured to directly encrypt their output. For real-time updates encryption is now optional (but active per default)...
+ * 3531 Reduced Check_MK helper size for certain dists/python versions...
* 3193 FIX: Fixed fake check results for hosts...
* 3214 FIX: Removing SNMP checks for non SNMP hosts and agent based checks for non agent hosts...
* 3220 FIX: Check_MK HW/SW Inventory is now always disabled for "No Agent" hosts
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 2bfae88..f99a5d5 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2421,7 +2421,7 @@ def pack_config():
except:
return False
- filepath = var_dir + "/core/config.mk"
+ filepath = var_dir + "/core/helper_config.mk"
out = file(filepath + ".new", "w")
out.write("#!/usr/bin/python\n"
"# encoding: utf-8\n"
@@ -2439,7 +2439,19 @@ def pack_config():
out.write("\nif %r in globals():\n del %s\n" % (varname, varname))
out.close()
- os.rename(filepath + ".new", filepath)
+
+ import marshal
+ code = compile(open(filepath + ".new").read(), '<string>', 'exec')
+ marshal.dump(code, open(filepath + ".compiled", "wb"))
+ os.rename(filepath + ".compiled", filepath)
+ # Remove the configs readable version
+ os.unlink(filepath + ".new")
+
+
+def read_packed_config():
+ import marshal
+ filepath = var_dir + "/core/helper_config.mk"
+ exec(marshal.load(open(filepath)), globals())
def pack_autochecks():
dstpath = var_dir + "/core/autochecks"
@@ -2462,9 +2474,6 @@ def pack_autochecks():
if f not in needed:
os.remove(dstpath + "/" + f)
-def read_packed_config():
- filepath = var_dir + "/core/config.mk"
- execfile(filepath, globals())
#.
# .--Man-Pages-----------------------------------------------------------.
Module: check_mk
Branch: master
Commit: a1263f05b3b5203ccb7e81d587cd1463a82afbab
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a1263f05b3b520…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 17 09:11:43 2016 +0200
Fixed wording: inventory -> discvoery
---
web/plugins/wato/check_mk_configuration.py | 2 +-
web/plugins/wato/check_parameters.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index a18ddad..b128ece 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1746,7 +1746,7 @@ register_rule(group,
"ignored_services",
title = _("Disabled services"),
help = _("Services that are declared as <u>disabled</u> by this rule set will not be added "
- "to a host during inventory (automatic service detection). Services that already "
+ "to a host during discovery (automatic service detection). Services that already "
"exist will continued to be monitored but be marked as obsolete in the service "
"list of a host."),
itemtype = "service")
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index e27ad21..d1cc396 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -41,7 +41,7 @@ subgroup_environment = _("Temperature, Humidity, Electrical Parameters, etc.")
subgroup_applications = _("Applications, Processes & Services")
subgroup_virt = _("Virtualization")
subgroup_hardware = _("Hardware, BIOS")
-subgroup_inventory = _("Inventory - automatic service detection")
+subgroup_inventory = _("Discovery - automatic service detection")
# register_rule(group, varname, valuespec = None, title = None,
# help = None, itemspec = None, itemtype = None, itemname = None,
@@ -3066,7 +3066,7 @@ register_rule(group + '/' + subgroup_storage,
'file but also on the count. You can define one or several '
'patterns for a group containing <tt>*</tt> and <tt>?</tt>, for example '
'<tt>/var/log/apache/*.log</tt>. For files contained in a group '
- 'the inventory will automatically create a group service instead '
+ 'the discovery will automatically create a group service instead '
'of single services for each file. This rule also applies when '
'you use manually configured checks instead of inventorized ones. '
'Furthermore, the current time/date in a configurable format '
Module: check_mk
Branch: master
Commit: 2ee84f0c660706c9a119ab76549944f62af9c9d1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ee84f0c660706…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri May 13 16:19:50 2016 +0200
clarified white-/blacklisting of automatic service activation
---
web/plugins/wato/check_mk_configuration.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 7f3d1f9..a18ddad 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1887,13 +1887,21 @@ register_rule(group,
)),
( "service_whitelist",
ListOfStrings(
- title = _("Whitelist Services"),
+ title = _("Activate only services matching"),
allow_empty = False,
+ help = _("Set service names or regular expression patterns here to "
+ "allow only matching services to be activated automatically. "
+ "If you set both this and \'Don't activate services matching\', "
+ "both rules have to apply for a service to be activated."),
)),
( "service_blacklist",
ListOfStrings(
- title = _("Blacklist Services"),
+ title = _("Don't activate services matching"),
allow_empty = False,
+ help = _("Set service names or regular expression patterns here to "
+ "prevent matching services from being activated automatically. "
+ "If you set both this and \'Activate only services matching\', "
+ "both rules have to apply for a service to be activated."),
)),
],
optional_keys = ["service_whitelist", "service_blacklist"],
Module: check_mk
Branch: master
Commit: 935d2b680590ca5efdf1c9387b55d5593c4c51c8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=935d2b680590ca…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri May 13 11:51:16 2016 +0200
werk 3131 is actually incompatible. Also reduced the impact of this incompatibility
---
.werks/3131 | 6 +++++-
checks/if64.include | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/.werks/3131 b/.werks/3131
index a6ba5e5..b783704 100644
--- a/.werks/3131
+++ b/.werks/3131
@@ -1,7 +1,7 @@
Title: if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit correctly
Level: 1
Component: checks
-Compatible: compat
+Compatible: incomp
Version: 1.2.9i1
Date: 1462952497
Class: fix
@@ -10,3 +10,7 @@ Previously, the two checks relied on a counter that has 10^6 bit resolution, so
less than 1Mbit speed were reported as "speed unknown", whereas the if check was capped at 4Gbit
speed, reporting wrong speed for faster interfaces.
The if64, if64adm checks have now been updated to provide the correct speed for all interfaces.
+
+This change is incompatible as the interfaces previously reported as "speed unknown" will now report
+warn state as the previously discovered speed (0) was stored during service discovery and deviations from
+that are reported. You need to re-discover these services to get rid of the warning.
diff --git a/checks/if64.include b/checks/if64.include
index fe9a65e..74194e3 100644
--- a/checks/if64.include
+++ b/checks/if64.include
@@ -35,7 +35,10 @@ def parse_if64(info):
# ifHighSpeed (idx 21) can't represent interfaces with less than 10^6 bit bandwidth,
# ifSpeed (idx 4) is capped at 4GBit.
# combine the two to get the actual interface speed
- real_speed = (saveint(line[-1]) * 1000000) + (saveint(line[4]) % 1000000)
+ if line[-1] == "0":
+ real_speed = saveint(line[4])
+ else:
+ real_speed = saveint(line[-1]) * 1000000
parsed.append(line[:4] + [real_speed] + line[5:-1])
return parsed
Module: check_mk
Branch: master
Commit: 94cb41d7589de8e7ebb38a2cdda0d15bfc034410
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94cb41d7589de8…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri May 13 09:39:33 2016 +0200
3133 windows agent: support for rotated log files and for reading new files from the first line
Please see the check_mk.example.ini for details on how to configure this.
With rotated logs, a pattern has to be specified to match all "generations" of the log and the agent
will read each in sequence and report them as one item.
---
.werks/3133 | 11 +
ChangeLog | 1 +
agents/windows/Configuration.cc | 426 +++++++++++++++-------
agents/windows/Configuration.h | 29 +-
agents/windows/Makefile | 5 +-
agents/windows/PerfCounter.cc | 8 +-
agents/windows/build_version | 2 +-
agents/windows/check_mk.example.ini | 16 +
agents/windows/check_mk_agent-64.exe | Bin 1157632 -> 1250304 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1157632 -> 1250304 bytes
agents/windows/check_mk_agent.cc | 226 ++++++------
agents/windows/check_mk_agent.exe | Bin 1121792 -> 1222656 bytes
agents/windows/check_mk_agent.msi | Bin 2545152 -> 2740224 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1121792 -> 1222656 bytes
agents/windows/install_agent-64.exe | Bin 517316 -> 554242 bytes
agents/windows/install_agent.exe | Bin 509285 -> 550946 bytes
agents/windows/stringutil.cc | 5 +
agents/windows/stringutil.h | 1 +
agents/windows/types.h | 18 +-
19 files changed, 495 insertions(+), 253 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=94cb41d758…