Module: check_mk
Branch: master
Commit: 4d0ec4ca0b777d3b1ebfc15de3e9cc07c64c8b2c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4d0ec4ca0b777d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Mar 5 17:42:32 2013 +0100
FIX: allow TCP checks on SNMP hosts if piggybacked
---
modules/check_mk_base.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 13658e4..fe87abb 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -352,6 +352,9 @@ def get_realhost_info(hostname, ipaddress, check_type,
max_cache_age):
write_cache_file(cache_relpath, repr(table) + "\n")
return table
+ # Note: even von SNMP-tagged hosts TCP based checks can be used, if
+ # the data comes piggyback!
+
# No SNMP check. Then we must contact the check_mk_agent. Have we already
# tries to get data from the agent? If yes we must not do that again! Even if
# no cache file is present.
@@ -383,8 +386,10 @@ def get_realhost_info(hostname, ipaddress, check_type,
max_cache_age):
output += piggy_output
- if len(output) == 0:
+ if len(output) == 0 and is_tcp_host(hostname):
raise MKAgentError("Empty output from agent")
+ elif len(output) == 0:
+ return
elif len(output) < 16:
raise MKAgentError("Too short output from agent: '%s'" %
output)