From a9996e8115bafd9837672c26dc9b76cbf3696840 Mon Sep 17 00:00:00 2001 From: Marno van der Molen Date: Tue, 3 Nov 2015 08:08:22 +0100 Subject: Adds optional debug output when loading hosts (resolving DNS) --- lib/oxidized/node.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/oxidized') diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index d50317f..c847416 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -9,6 +9,9 @@ module Oxidized attr_accessor :running, :user, :msg, :from, :stats, :retry alias :running? :running def initialize opt + if CFG.debug == true or opt[:debug] == true + puts 'resolving DNS for %s...' % opt[:name] + end @name = opt[:name] @ip = IPAddr.new(opt[:ip]).to_s rescue nil @ip ||= Resolv.new.getaddress @name -- cgit v1.2.1