summaryrefslogtreecommitdiff
path: root/lib/oxidized/node.rb
diff options
context:
space:
mode:
authorMarno van der Molen <marnovandermolen@acknowledge.nl>2015-11-03 08:08:22 +0100
committerMarno van der Molen <marnovandermolen@acknowledge.nl>2015-11-03 08:08:22 +0100
commita9996e8115bafd9837672c26dc9b76cbf3696840 (patch)
tree37341d43b14c635718deb46b850bc112f6a6de0a /lib/oxidized/node.rb
parent97a1c5c982dff389c205cae1b074cd0f1cd7af60 (diff)
Adds optional debug output when loading hosts (resolving DNS)
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r--lib/oxidized/node.rb3
1 files changed, 3 insertions, 0 deletions
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