Module: check_mk
Branch: master
Commit: 4c8138ce6158d52f0e430b9cd2d3cb349fcf1d93
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c8138ce6158d5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 4 11:12:34 2015 +0200
#2502 FIX Fixed removing autochecks when a host is configured to be ping only
When a host had already discovered services assigned and was configured to be monitored
as ping only host, by e.g. setting "no agent" in the host properties, the
former
discovered services were not removed.
---
.werks/2502 | 12 ++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 5 ++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/2502 b/.werks/2502
new file mode 100644
index 0000000..f5c1d42
--- /dev/null
+++ b/.werks/2502
@@ -0,0 +1,12 @@
+Title: Fixed removing autochecks when a host is configured to be ping only
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1438679410
+
+When a host had already discovered services assigned and was configured to be monitored
+as ping only host, by e.g. setting "no agent" in the host properties, the
former
+discovered services were not removed.
diff --git a/ChangeLog b/ChangeLog
index 933a479..ef6901a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.7i3:
Core & Setup:
* 2465 FIX: Fixed broken Check_MK Discovery checks (check reports
"(null)")
+ * 2502 FIX: Fixed removing autochecks when a host is configured to be ping only...
Checks & Agents:
* 2312 New checks for EMC VPLEX: emc_vplex_cpu, emc_vplex_director_stats,
emc_vplex_if, emc_vplex_volumes...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 7394b81..57e500d 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -937,6 +937,9 @@ def get_check_table(hostname, remove_duplicates=False, use_cache=True,
world='co
global g_singlehost_checks
global g_multihost_checks
+ if is_ping_host(hostname):
+ skip_autochecks = True
+
# speed up multiple lookup of same host
if not skip_autochecks and use_cache and hostname in g_check_table_cache:
if remove_duplicates and is_dual_host(hostname):
@@ -2546,7 +2549,7 @@ define service {
# Inventory checks - if user has configured them.
if inventory_check_interval \
and not service_ignored(hostname, None, service_discovery_name) \
- and not "ping" in tags_of_host(hostname):
+ and not "ping" in tags_of_host(hostname): # FIXME/TODO: Why not user
is_ping_host()?
outfile.write("""
define service {
use\t\t\t\t%s