Module: check_mk
Branch: master
Commit: 2f6885a55ae1aa0a5c3317cb21db242be02cfd3f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f6885a55ae1aa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 25 09:42:39 2018 +0200
6170 FIX Raw Edition: Fixed monitoring using special agents
When trying to monitor hosts using special agents as data sources with nagios, this
failed with an error like this:
"UNKN - [special_vsphere] 'vsphere'UNKN, Got no information from host, execution time 0.0 sec"
Change-Id: I9748eeba8106c5c330220a714a3f7b4e4cbaedcb
---
.werks/6170 | 14 ++++++++++++++
cmk_base/core_nagios.py | 8 ++++++++
cmk_base/data_sources/programs.py | 5 +++++
3 files changed, 27 insertions(+)
diff --git a/.werks/6170 b/.werks/6170
new file mode 100644
index 0000000..de7c1db
--- /dev/null
+++ b/.werks/6170
@@ -0,0 +1,14 @@
+Title: Raw Edition: Fixed monitoring using special agents
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527233679
+
+When trying to monitor hosts using special agents as data sources with nagios, this
+failed with an error like this:
+
+"UNKN - [special_vsphere] 'vsphere'UNKN, Got no information from host, execution time 0.0 sec"
diff --git a/cmk_base/core_nagios.py b/cmk_base/core_nagios.py
index 68719bf..edaa0f4 100644
--- a/cmk_base/core_nagios.py
+++ b/cmk_base/core_nagios.py
@@ -42,6 +42,7 @@ import cmk_base.checks as checks
import cmk_base.rulesets as rulesets
import cmk_base.core_config as core_config
import cmk_base.ip_lookup as ip_lookup
+import cmk_base.data_sources as data_sources
def do_check_nagiosconfig():
@@ -1022,6 +1023,13 @@ if '-d' in sys.argv:
needed_check_plugin_names = set([])
+ # In case the host is monitored as special agent, the check plugin for the special agent needs
+ # to be loaded
+ sources = data_sources.DataSources(hostname, ipaddress=None)
+ for source in sources.get_data_sources():
+ if isinstance(source, data_sources.programs.SpecialAgentDataSource):
+ needed_check_plugin_names.add(source.special_agent_plugin_file_name)
+
# Collect the needed check plugin names using the host check table
for check_plugin_name, _unused_item, _unused_param, descr in host_check_table:
if check_plugin_name not in checks.check_info:
diff --git a/cmk_base/data_sources/programs.py b/cmk_base/data_sources/programs.py
index e3f49e4..4dcf381 100644
--- a/cmk_base/data_sources/programs.py
+++ b/cmk_base/data_sources/programs.py
@@ -169,6 +169,11 @@ class SpecialAgentDataSource(ProgramDataSource):
return "special_%s" % self._special_agent_id
+ @property
+ def special_agent_plugin_file_name(self):
+ return "agent_%s" % self._special_agent_id
+
+
def _get_individual_exit_code_spec(self, exit_code_spec):
return exit_code_spec["individual"]["special"]
Module: check_mk
Branch: master
Commit: 3a3423aa7c9116e3a64ee54a6fd42ff1dcff65d0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a3423aa7c9116…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 25 09:02:17 2018 +0200
Make rules.mk be loadable with less dependencies
The rules.mk files were not initializing some variables in case they are
missing in the context they are loaded into.
This lead into problems in the following situations:
a) When a builtin configuration variable is removed from Check_MK base that
has previously been configured by the user.
b) When a (custom) check which introduces a configuration variable is
removed from an installation that has previously been configured by
user.
The problem is that the rules.mk were not checking whether or not a
configuration variable exists before updating the settings from the
rules.mk to this option.
The rules.mk always needs to lazy initialize all variables during
loading. This way we are able to load the Check_MK configuration e.g.
without loading the checks before. We are also able to drop
configuration options without needed user actions.
The problem is not fully solved: The rules.mk files are not
automatically transformed by the new version. They are only updated to
the new schema in case one saves the rules.mk files. We may need to
build some automatic migration logic in the future.
Change-Id: I91f4f39dec7585a54322d2c7b1e55ba792f2ba5f
---
web/htdocs/watolib.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index af012d5..bcb18b7 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -7887,6 +7887,8 @@ class Ruleset(object):
else:
varname = self.name
+ content += "\nglobals().setdefault(%r, [])\n" % (varname)
+
if self.is_optional():
content += "\nif %s == None:\n %s = []\n" % (varname, varname)
Module: check_mk
Branch: master
Commit: f7e83db8a82dc2f2d94c893daa23f94aa03a2383
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7e83db8a82dc2…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri May 25 08:24:56 2018 +0200
6189 FIX OpenHardwareMonitorCLI did not run on some Win7 machines
OpenHardwareMonitorCLI, the executable wrapper for triggering
OpenHardwareMonitor by Check_MK Windows Agent, did not run on
some Win7 machines. Moreover, it was not possible to compile
OpenHardwareMonitorCLI with versions 4.x of Mono (tried with
Mono 4.6.2.0 / XBuild 14.0). Providing the build option
/p:TargetFrameworkVersion="v4.5" both fixed the build with Mono
4.x and made resulting executable compatible with all tested
Windows versions (tested on Win7 and Server 2016).
Change-Id: Ibb1dbef32dee769a6a0e99ef80a16214c2d01787
---
.werks/6189 | 19 +++++++++++++++++++
omd/packages/openhardwaremonitor/Makefile | 2 +-
.../Bin/Release/OpenHardwareMonitorCLI.exe | Bin 12288 -> 11264 bytes
.../Bin/Release/OpenHardwareMonitorLib.dll | Bin 262144 -> 273408 bytes
4 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/6189 b/.werks/6189
new file mode 100644
index 0000000..a6445dc6
--- /dev/null
+++ b/.werks/6189
@@ -0,0 +1,19 @@
+Title: OpenHardwareMonitorCLI did not run on some Win7 machines
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1527230306
+Class: fix
+
+OpenHardwareMonitorCLI, the executable wrapper for triggering
+OpenHardwareMonitor by Check_MK Windows Agent, did not run on
+some Win7 machines. Moreover, it was not possible to compile
+OpenHardwareMonitorCLI with versions 4.x of Mono (tried with
+Mono 4.6.2.0 / XBuild 14.0). Providing the build option
+/p:TargetFrameworkVersion="v4.5" both fixed the build with Mono
+4.x and made resulting executable compatible with all tested
+Windows versions (tested on Win7 and Server 2016).
+
+
diff --git a/omd/packages/openhardwaremonitor/Makefile b/omd/packages/openhardwaremonitor/Makefile
index 90c352d..feb5f73 100755
--- a/omd/packages/openhardwaremonitor/Makefile
+++ b/omd/packages/openhardwaremonitor/Makefile
@@ -12,7 +12,7 @@ build: clean
if [ -x "`which xbuild`" ] ; then \
unzip -d . $(DIR).zip ; \
cp -R OpenHardwareMonitorCLI OpenHardwareMonitor.sln $(DIR) ; \
- xbuild /p:Configuration=Release $(DIR)/OpenHardwareMonitor.sln /target:OpenHardwareMonitorCLI ; \
+ xbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" $(DIR)/OpenHardwareMonitor.sln /target:OpenHardwareMonitorCLI ; \
fi
install:
diff --git a/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorCLI.exe b/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorCLI.exe
old mode 100644
new mode 100755
index be2bc81..f116955
Binary files a/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorCLI.exe and b/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorCLI.exe differ
diff --git a/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorLib.dll b/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorLib.dll
old mode 100644
new mode 100755
index c953e57..fff3d88
Binary files a/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorLib.dll and b/omd/packages/openhardwaremonitor/openhardwaremonitor-0.8.0/Bin/Release/OpenHardwareMonitorLib.dll differ
Module: check_mk
Branch: master
Commit: 6b35b8ac3f79514b9db1ff6b74b84e6b8ebe96fd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b35b8ac3f7951…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 18:29:44 2018 +0200
6169 FIX Discovery page: Fixed incompatibility with central 1.4 and remote 1.5 site
An error "ValueError: could not convert string to float:" was shown when performing
the service discovery on a host that is monitored by a 1.5 site while the central
WATO site is a 1.4 site.
Change-Id: I5e760cffcee6aaab5d556b20fef33e80be17532b
---
.werks/6169 | 13 +++++++++++++
cmk_base/automations/check_mk.py | 15 ++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/.werks/6169 b/.werks/6169
new file mode 100644
index 0000000..f850c38
--- /dev/null
+++ b/.werks/6169
@@ -0,0 +1,13 @@
+Title: Discovery page: Fixed incompatibility with central 1.4 and remote 1.5 site
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527179297
+
+An error "ValueError: could not convert string to float:" was shown when performing
+the service discovery on a host that is monitored by a 1.5 site while the central
+WATO site is a 1.4 site.
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index 0901dc4..a24f75a 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -1032,8 +1032,16 @@ class AutomationDiagHost(Automation):
hostname, test, ipaddress, snmp_community = args[:4]
agent_port, snmp_timeout, snmp_retries = map(int, args[4:7])
- tcp_connect_timeout = float(args[7])
- cmd = args[8]
+
+ # In 1.5 the tcp connect timeout has been added. The automation may
+ # be called from a remote site with an older version. For this reason
+ # we need to deal with the old args.
+ if len(args) == 14:
+ tcp_connect_timeout = None
+ cmd = args[7]
+ else:
+ tcp_connect_timeout = float(args[7])
+ cmd = args[8]
snmpv3_use = None
snmpv3_auth_proto = None
@@ -1078,7 +1086,8 @@ class AutomationDiagHost(Automation):
source = data_sources.DSProgramDataSource(hostname, ipaddress, cmd)
elif isinstance(source, data_sources.TCPDataSource):
source.set_port(agent_port)
- source.set_timeout(tcp_connect_timeout)
+ if tcp_connect_timeout is not None:
+ source.set_timeout(tcp_connect_timeout)
output += source.run_raw()
Regression in 1.5.0b5)
Message-ID: <5b06d83a.K1UoKjPdZtafvRDU%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 596a4bc179125c8613fa2205e998dc386cdeb491
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=596a4bc179125c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 14:42:17 2018 +0200
6153 FIX Fixed broken notifications and alert handling (Regression in 1.5.0b5)
The notifications and alert handling were not working correctly at all. Better
use the 1.5.0b5 only in test environments where you don't need these features.
Change-Id: I3885b8770e47cb91d4d2759a88077756485f4b25
---
.werks/6153 | 12 ++++++++++++
cmk_base/modes/check_mk.py | 6 +++++-
cmk_base/notify.py | 3 ---
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/6153 b/.werks/6153
new file mode 100644
index 0000000..d55cf67
--- /dev/null
+++ b/.werks/6153
@@ -0,0 +1,12 @@
+Title: Fixed broken notifications and alert handling (Regression in 1.5.0b5)
+Level: 2
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527165633
+
+The notifications and alert handling were not working correctly at all. Better
+use the 1.5.0b5 only in test environments where you don't need these features.
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index 4e499ee..c043a6b 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -1340,14 +1340,18 @@ modes.register(Mode(
# '----------------------------------------------------------------------'
def mode_notify(options, *args):
+ import cmk_base.config as config
import cmk_base.notify as notify
+ config.load(with_conf_d=True, validate_hosts=False)
return notify.do_notify(options, *args)
modes.register(Mode(
long_option="notify",
handler_function=mode_notify,
needs_config=False,
- needs_checks=False,
+ # TODO: Sadly needs to be True because the checks need to initialize the check specific
+ # configuration variables before the config can be loaded.
+ needs_checks=True,
argument=True,
argument_descr="MODE",
argument_optional=True,
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index 6973c25..cf1e6f4 100644
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -169,9 +169,6 @@ def do_notify(options, args):
if keepalive and "keepalive" in options:
keepalive.enable()
- config.load_packed_config()
- else:
- config.load(with_conf_d=True, validate_hosts=False)
convert_legacy_configuration()
rrd conversion) in some cases
Message-ID: <5b06d83a.Ed1B1HQDXxm3ajry%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: e05a7d6678c0442a866072b92c754281feeaff86
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e05a7d6678c044…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 14:44:15 2018 +0200
6154 FIX Fixed different Check_MK calls (parent scan, baking, rrd conversion) in some cases
When using some check specific configuration variables (like e.g. fileinfo_groups), the
mentioned Check_MK calls could not be used. An error like this was shown:
Cannot read in configuration file /omd/sites/beta/etc/check_mk/conf.d/wato/rules.mk: name 'fileinfo_groups' is not defined
Change-Id: I5433c544b5754b044ce50370c1e5b5b7b9ff3055
---
.werks/6154 | 14 ++++++++++++++
cmk_base/modes/check_mk.py | 3 +++
2 files changed, 17 insertions(+)
diff --git a/.werks/6154 b/.werks/6154
new file mode 100644
index 0000000..805a368
--- /dev/null
+++ b/.werks/6154
@@ -0,0 +1,14 @@
+Title: Fixed different Check_MK calls (parent scan, baking, rrd conversion) in some cases
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527165745
+
+When using some check specific configuration variables (like e.g. fileinfo_groups), the
+mentioned Check_MK calls could not be used. An error like this was shown:
+
+Cannot read in configuration file /omd/sites/beta/etc/check_mk/conf.d/wato/rules.mk: name 'fileinfo_groups' is not defined
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index c043a6b..062fd55 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -739,6 +739,9 @@ modes.register(Mode(
long_option="scan-parents",
handler_function=mode_scan_parents,
needs_config=False,
+ # TODO: Sadly needs to be True because the checks need to initialize the check specific
+ # configuration variables before the config can be loaded.
+ needs_checks=True,
argument=True,
argument_descr="HOST1 HOST2...",
argument_optional=True,