Module: check_mk
Branch: master
Commit: 8228c64f0895e087a366f5e2dc21bba4c4f48d85
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8228c64f0895e0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 8 13:58:43 2011 +0100
FIX: fix aggregate_check_mk (Summary host agent status)
---
ChangeLog | 3 +++
modules/check_mk_base.py | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3b20a03..147b8fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@
1.1.12p1:
+ Core, Setup, etc.:
+ * FIX: fix aggregate_check_mk (Summary host agent status)
+
Checks & Agents:
* FIX: mk_oracle now also detects XE databases
* FIX: printer_alerts: handle 0-entries of Brother printers
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 8f71d42..92a2646 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -213,7 +213,7 @@ def submit_check_mk_aggregation(hostname, status, output):
return
if not opt_dont_submit:
- submit_to_nagios(hostname, "Check_MK", status, output)
+ submit_to_nagios(summary_hostname(hostname), "Check_MK", status,
output)
if opt_verbose:
color = { 0: tty_green, 1: tty_yellow, 2: tty_red, 3: tty_magenta }[status]
@@ -714,6 +714,9 @@ def do_check(hostname, ipaddress):
if opt_debug:
raise
+ if checkresult_file_fd != None:
+ close_checkresult_file()
+
run_time = time.time() - start_time
output += "execution time %.1f sec|execution_time=%.3f\n" % (run_time,
run_time)
sys.stdout.write(output)
@@ -808,8 +811,6 @@ def do_all_checks_on_host(hostname, ipaddress):
error_sections.add(infotype)
submit_aggregated_results(hostname)
- if checkresult_file_fd != None:
- close_checkresult_file()
try:
if is_tcp_host(hostname):
@@ -841,9 +842,11 @@ def open_checkresult_file():
def close_checkresult_file():
+ global checkresult_file_fd
if checkresult_file_fd != None:
os.close(checkresult_file_fd)
file(checkresult_file_path + ".ok", "w")
+ checkresult_file_fd = None
def nagios_pipe_open_timeout(signum, stackframe):