Module: check_mk
Branch: master
Commit: 6015b3af993ab59a9ed568a13ab33ca8e13101bf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6015b3af993ab5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 5 15:57:23 2016 +0200
Cleaned up yesterdays sigint handling change
---
modules/check_mk_base.py | 12 +++++++++++-
modules/notify.py | 1 -
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 89f3ff3..913445e 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -2521,7 +2521,7 @@ def submit_check_mk_aggregation(hostname, status, output):
# '----------------------------------------------------------------------'
# register SIGINT handler for consistent CTRL+C handling
-# TODO: use MKTermiante() signal instead and handle output and exit code in check_mk.py
+# TODO: use MKTerminate() signal instead and handle output and exit code in check_mk.py
def interrupt_handler(signum, frame):
sys.stderr.write('<Interrupted>\n')
sys.exit(1)
@@ -2529,3 +2529,13 @@ def interrupt_handler(signum, frame):
def register_sigint_handler():
signal.signal(signal.SIGINT, interrupt_handler)
+
+
+
+# register SIGINT handler for consistent CTRL+C handling
+def handle_keepalive_interrupt(signum, frame):
+ raise MKTerminate()
+
+
+def register_keepalive_sigint_handler():
+ signal.signal(signal.SIGINT, handle_keepalive_interrupt)
diff --git a/modules/notify.py b/modules/notify.py
index 7da20d0..224a29d 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -340,7 +340,6 @@ def notification_analyse_backlog(nr):
# TODO: Make use of the generic do_keepalive() mechanism?
def notify_keepalive():
- load_module("keepalive")
register_keepalive_sigint_handler()
event_keepalive(
event_function = notify_notify,