Module: check_mk
Branch: master
Commit: 1a599ae200eca3868e9b3537914c941f42b327d2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a599ae200eca3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 11 13:38:59 2013 +0200
Fix problems in template with various PING checks
---
check_mk_templates.cfg | 23 ++++++++++++++---------
modules/check_mk.py | 2 +-
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/check_mk_templates.cfg b/check_mk_templates.cfg
index 40b9ed6..e764510 100644
--- a/check_mk_templates.cfg
+++ b/check_mk_templates.cfg
@@ -95,7 +95,7 @@ define host {
retain_status_information 1
retain_nonstatus_information 1
process_perf_data 0
- check_command check-mk-ping
+ check_command check-mk-host-ping
check_interval 1
check_period 24X7
max_check_attempts 1
@@ -133,7 +133,7 @@ define host {
define host {
name check_mk_cluster
use check_mk_default
- check_command check-mk-ping-cluster
+ check_command check-mk-host-ping-cluster
register 0
}
@@ -315,18 +315,28 @@ define command {
command_line echo "DUMMY - Always OK"
}
+# Commands for services of PING-only hosts
define command {
command_name check-mk-ping
command_line @CHECK_ICMP@ $ARG1$ $HOSTADDRESS$
}
-# Check for clusters: it is UP if at least one node is up
define command {
command_name check-mk-ping-cluster
command_line @CHECK_ICMP@ -m 1 $ARG1$ $_HOSTNODEIPS$
}
-# Dummy host check that always assumes that the host is up
+# Host check commands
+define command {
+ command_name check-mk-host-ping
+ command_line @CHECK_ICMP@ $ARG1$ $HOSTADDRESS$
+}
+
+define command {
+ command_name check-mk-host-ping-cluster
+ command_line @CHECK_ICMP@ -m 1 $ARG1$ $_HOSTNODEIPS$
+}
+
define command {
command_name check-mk-host-ok
command_line echo "OK - Host is always assumed to be up"
@@ -337,11 +347,6 @@ define command {
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}
-define command {
- command_name check-mk-host-ping
- command_line @CHECK_ICMP@ $ARG1$ $HOSTADDRESS$
-}
-
# General notification script. Details can be configured
# in main.mk via notification_... options
diff --git a/modules/check_mk.py b/modules/check_mk.py
index f9fe105..11cedc2 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1671,7 +1671,7 @@ def create_nagios_hostdefs(outfile, hostname):
# Host check uses (service-) IP address if available
if ip:
- outfile.write(" check_command\t\t\tcheck-mk-ping\n")
+ outfile.write(" check_command\t\t\tcheck-mk-host-ping\n")
# Output alias, but only if it's not define in extra_host_conf
aliases = host_extra_conf(hostname, extra_host_conf.get("alias", []))