Module: check_mk
Branch: master
Commit: 46582b9f5b243ae9d1ab521d415b78c7692a8762
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46582b9f5b243a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Aug 15 11:50:34 2014 +0200
#1008 Overall check timeout for Check_MK checks now defaults to CRIT state
When using the Check_MK Micro Core as the core then the service status for Check_MK
services that ran into an overal timeout (default is 60 seconds) was UNKNOWN. This
has changed to CRIT. Furthermore this is configurable via a new
<i>Timeout</i>
option in the ruleset <i>Status of the Check_MK service</i>.
---
.werks/1008 | 12 ++++++++++++
ChangeLog | 3 +++
modules/check_mk.py | 6 ++++--
web/plugins/wato/check_mk_configuration.py | 8 +++++++-
4 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/.werks/1008 b/.werks/1008
new file mode 100644
index 0000000..7627e27
--- /dev/null
+++ b/.werks/1008
@@ -0,0 +1,12 @@
+Title: Overall check timeout for Check_MK checks now defaults to CRIT state
+Level: 2
+Component: core
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408096113
+Class: feature
+
+When using the Check_MK Micro Core as the core then the service status for Check_MK
+services that ran into an overal timeout (default is 60 seconds) was UNKNOWN. This
+has changed to CRIT. Furthermore this is configurable via a new
<i>Timeout</i>
+option in the ruleset <i>Status of the Check_MK service</i>.
diff --git a/ChangeLog b/ChangeLog
index 097f997..15e1a44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.2.5i6:
+ Core & Setup:
+ * 1008 Overall check timeout for Check_MK checks now defaults to CRIT state...
+
Checks & Agents:
* 0185 knuerr_rms_humidity, knuerr_rms_temp: Two new Checks to Monitor the
Temperature and the Humidity on Knürr RMS Devices
* 1065 heartbeat_crm / heartbeat_crm.resources: Rewrote checks / formalized
parameters...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8c03880..07e374e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5533,8 +5533,10 @@ def do_check_keepalive():
signal.alarm(0)
except MKCheckTimeout:
signal.signal(signal.SIGALRM, signal.SIG_IGN) # Prevent ALRM from
CheckHelper.cc
- status = 3
- total_check_output = "UNKNOWN - Check_MK timed out after %d
seconds\n" % timeout
+ spec = exit_code_spec(hostname)
+ status = spec.get("timeout", 2)
+ total_check_output = "%s - Check_MK timed out after %d
seconds\n" % (
+ nagios_state_names[status], timeout)
os.write(keepalive_fd, "%03d\n%08d\n%s" %
(status, len(total_check_output), total_check_output))
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index f6e8637..370efdb 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -2301,6 +2301,11 @@ register_rule(group,
default_value = 2,
title = _("State in case of connection problems")),
),
+ ( "timeout",
+ MonitoringState(
+ default_value = 2,
+ title = _("State in case of a overall timeout")),
+ ),
( "missing_sections",
MonitoringState(
default_value = 1,
@@ -2328,7 +2333,8 @@ register_rule(group,
help = _("This ruleset specifies the total status of the Check_MK service in
"
"case of various error situations. One use case is the monitoring
"
"of hosts that are not always up. You can have Check_MK an OK status
"
- "here if the host is not reachable."),
+ "here if the host is not reachable. Note: the
<i>Timeout</i> setting only works "
+ "when using the Check_MK Micro Core."),
match = "dict",
)