Module: check_mk
Branch: master
Commit: 6d748690132ac55e8c887f841f8d1952dd27d211
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d748690132ac5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 11 08:17:13 2017 +0200
Fixed name resolution during cmk --dump calls
Change-Id: Ifb153dae14bc763905e1b6a1996f922b39611d96
---
cmk_base/modes/check_mk.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index 627e6aa..7122de0 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -316,8 +316,14 @@ modes.register(Mode(
def mode_dump_agent(hostname):
import cmk_base.agent_data as agent_data
import cmk_base.piggyback as piggyback
+ import cmk_base.ip_lookup as ip_lookup
try:
- console.output(agent_data.get_agent_info(hostname, hostname, 999999999))
+ if config.is_cluster(hostname):
+ raise MKBailOut("Can not be used with cluster hosts")
+
+ if config.is_tcp_host(hostname):
+ ipaddress = ip_lookup.lookup_ip_address(hostname)
+ console.output(agent_data.get_agent_info(hostname, ipaddress, 999999999))
console.output(piggyback.get_piggyback_info(hostname))
except MKAgentError, e:
raise MKBailOut("Problem contacting agent: %s" % e)