Module: check_mk
Branch: master
Commit: e274c3c4b1c7ce895dcbad67533871e3deb5ef9d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e274c3c4b1c7ce…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 7 10:54:17 2016 +0100
3988 Windows agent: no global option disabled_sections
This options allows you to disable specific sections.
If a section is mentioned in <i>sections</i> and
<i>disabled_sections</i> the
<i>disabled_sections</i> takes precedence.
---
.werks/3988 | 12 ++++++++++++
ChangeLog | 1 +
agents/windows/SectionManager.cc | 8 ++++++--
agents/windows/SectionManager.h | 5 +++++
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 1324544 -> 1325056 bytes
agents/windows/check_mk_agent-64.unstripped.exe | Bin 15382636 -> 15385708 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1324544 -> 1325056 bytes
agents/windows/check_mk_agent.exe | Bin 1299456 -> 1299968 bytes
agents/windows/check_mk_agent.msi | Bin 2893824 -> 2894848 bytes
agents/windows/check_mk_agent.unstripped.exe | Bin 13295415 -> 13297463 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1299456 -> 1299968 bytes
agents/windows/install_agent-64.exe | Bin 584764 -> 584849 bytes
agents/windows/install_agent.exe | Bin 581452 -> 581547 bytes
14 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/.werks/3988 b/.werks/3988
new file mode 100644
index 0000000..5ea29da
--- /dev/null
+++ b/.werks/3988
@@ -0,0 +1,12 @@
+Title: Windows agent: no global option disabled_sections
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i2
+Date: 1478512041
+Class: feature
+
+This options allows you to disable specific sections.
+If a section is mentioned in <i>sections</i> and
<i>disabled_sections</i> the
+<i>disabled_sections</i> takes precedence.
+
diff --git a/ChangeLog b/ChangeLog
index 55e285e..3091713 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
* 3949 ucd_cpu_load: Genugate devices are now displaying CPU load...
* 3950 openbsd_sensors: Genugate devices are now handling hardware sensors...
* 3749 storcli_pdisks, storcli_vdrives: New checks to monitor RAID status via StorCLI
utility
+ * 3988 Windows agent: no global option disabled_sections...
* 3894 FIX: mkeventd_status: Fixed bug in case Event Console is not running
* 3907 FIX: oracle_tablespaces: simplyfied free space calculation depending on
version...
* 3819 FIX: windows agent: fixed 2 bugs related to mrpe...
diff --git a/agents/windows/SectionManager.cc b/agents/windows/SectionManager.cc
index f9aba58..b6b3d8b 100644
--- a/agents/windows/SectionManager.cc
+++ b/agents/windows/SectionManager.cc
@@ -22,6 +22,7 @@
SectionManager::SectionManager(Configuration &config, const Environment &env)
: _ps_use_wmi(config, "ps", "use_wmi", false)
, _enabled_sections(config, "global", "sections")
+ , _disabled_sections(config, "global", "disabled_sections")
, _realtime_sections(config, "global", "realtime_sections")
, _script_local_includes(config, "local", "include")
, _script_plugin_includes(config, "plugin", "include")
@@ -41,8 +42,11 @@ void SectionManager::addSection(Section *section) {
bool SectionManager::sectionEnabled(const std::string &name) const {
// if no sections were set, assume they are all enabled
- return !_enabled_sections.wasAssigned() ||
- (_enabled_sections->find(name) != _enabled_sections->end());
+ bool is_disabled = _disabled_sections->find(name) !=
_disabled_sections->end();
+
+ bool is_enabled = !_enabled_sections.wasAssigned() ||
+ (_enabled_sections->find(name) != _enabled_sections->end());
+ return !is_disabled && is_enabled;
}
bool SectionManager::realtimeSectionEnabled(const std::string &name) const {
diff --git a/agents/windows/SectionManager.h b/agents/windows/SectionManager.h
index 870f3b9..d8cc3c0 100644
--- a/agents/windows/SectionManager.h
+++ b/agents/windows/SectionManager.h
@@ -45,6 +45,11 @@ class SectionManager {
SplittingListConfigurable<std::set<std::string>,
BlockMode::BlockExclusive<std::set<std::string>>,
AddMode::SetInserter<std::set<std::string>>>
+ _disabled_sections;
+
+ SplittingListConfigurable<std::set<std::string>,
+
BlockMode::BlockExclusive<std::set<std::string>>,
+
AddMode::SetInserter<std::set<std::string>>>
_realtime_sections;
KeyedListConfigurable<std::string> _script_local_includes;
diff --git a/agents/windows/build_version b/agents/windows/build_version
index dbb8b69..5cc2201 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-2138
+2143
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index 8c57ce9..75ca096 100755
Binary files a/agents/windows/check_mk_agent-64.exe and
b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unstripped.exe
b/agents/windows/check_mk_agent-64.unstripped.exe
index 2956574..4d845d3 100755
Binary files a/agents/windows/check_mk_agent-64.unstripped.exe and
b/agents/windows/check_mk_agent-64.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index d7146ae..941fdd7 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and
b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 6be6e4b..5870e64 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi
index 919fac2..91bc001 100755
Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi
differ
diff --git a/agents/windows/check_mk_agent.unstripped.exe
b/agents/windows/check_mk_agent.unstripped.exe
index 3f182ec..bb0c6f9 100755
Binary files a/agents/windows/check_mk_agent.unstripped.exe and
b/agents/windows/check_mk_agent.unstripped.exe differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index b1c101e..b3f010c 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and
b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index b79f061..2a721ba 100755
Binary files a/agents/windows/install_agent-64.exe and
b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 20143dd..a585f5c 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ