Module: check_mk
Branch: master
Commit: 5ea505ea9e5acd921f3d49376723152659e15fc4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ea505ea9e5acd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 4 17:37:25 2014 +0200
Make option -v active on cmk --update-dns-cache
---
modules/check_mk.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index eb34e88..796c34b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1291,13 +1291,17 @@ def do_update_dns_cache():
if opt_verbose:
print "Updating DNS cache..."
for hostname in all_active_hosts() + all_active_clusters():
+ if opt_verbose:
+ sys.stdout.write("%s..." % hostname)
+ sys.stdout.flush()
# Use intelligent logic. This prevents DNS lookups for hosts
# with statically configured addresses, etc.
try:
- lookup_ipaddress(hostname)
+ ip = lookup_ipaddress(hostname)
+ sys.stdout.write("%s\n" % ip)
except Exception, e:
if opt_verbose:
- print "Failed to lookup IP address of %s: %s" % (hostname, e)
+ sys.stdout.write("lookup failed: %s\n" % e)
if opt_debug:
raise
continue