Module: check_mk
Branch: master
Commit: e842afe6103a8d4140d3ffe875ff1a2fa2b3664d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e842afe6103a8d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 14:55:25 2013 +0100
FIX: PING services on clusters are treated like the host check of clusters
---
.bugs/786 | 7 +++++--
ChangeLog | 1 +
modules/check_mk.py | 9 +++++++--
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/.bugs/786 b/.bugs/786
index 7f09683..9ddd303 100644
--- a/.bugs/786
+++ b/.bugs/786
@@ -1,9 +1,9 @@
Title: PING check for clusters without services UNKNOWN
Component: core
-State: open
+Class: nastiness
+State: done
Date: 2012-07-26 16:29:56
Targetversion: 1.2.2
-Class: nastiness
If you have a cluster without any services, then Check_MK will
create a PING services. This will be UNKNOWN. Couldn't we doe
@@ -16,3 +16,6 @@ should behave just like the host check:
* Use the IP Adress of the cluster if available
* PING all nodes with check_icmp otherwise
+
+2013-01-17 14:54:46: changed state open -> done
+Using existing check-mk-ping-cluster command now for PING services on clusters.
diff --git a/ChangeLog b/ChangeLog
index f009631..86173bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core:
* Improved handling of CTRL+C (SIGINT) to terminate long runnining tasks
(e.g. inventory of SNMP hosts)
+ * FIX: PING services on clusters are treated like the host check of clusters
Checks & Agents:
* Linux Agent, diskstat: Now supporting /dev/emcpower* devices (Thanks to Claas
Rockmann-Buchterkirche)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index ad39048..bfe2d7b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1931,17 +1931,22 @@ define service {
""" % (template, hostname, description, simulate_command(command),
command_line and 1 or 0, extraconf))
+ # Levels for host check
+ if is_cluster(hostname):
+ ping_command = 'check-mk-ping-cluster'
+ else:
+ ping_command = 'check-mk-ping'
# No check_mk service, no legacy service -> create PING service
if not have_at_least_one_service and not legchecks and not actchecks:
outfile.write("""
define service {
use\t\t\t\t%s
- check_command\t\t\tcheck-mk-ping!%s
+ check_command\t\t\t%s!%s
%s host_name\t\t\t%s
}
-""" % (pingonly_template, check_icmp_arguments(hostname),
extra_service_conf_of(hostname, "PING"), hostname))
+""" % (pingonly_template, ping_command, check_icmp_arguments(hostname),
extra_service_conf_of(hostname, "PING"), hostname))
def simulate_command(command):
if simulation_mode: