diff options
author | Saku Ytti <saku@ytti.fi> | 2017-02-04 11:49:31 +0200 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2017-02-04 11:49:31 +0200 |
commit | e2899b55638101ddf97aeab919a9f064daf05451 (patch) | |
tree | d39ab735d998768d0057f69a5a4d7c26df80966c /lib/oxidized/node.rb | |
parent | 66911c18259e17e6381517b9a495b61423ed44ad (diff) |
give option to stop resolving name to IP
With ssh proxy you might want to have far-end resolve
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r-- | lib/oxidized/node.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 6f89b56..7201a73 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -14,7 +14,8 @@ module Oxidized ip_addr, _ = opt[:ip].to_s.split("/") Oxidized.logger.debug 'IPADDR %s' % ip_addr.to_s @name = opt[:name] - @ip = IPAddr.new(ip_addr).to_s rescue nil + @ip = @name unless Oxidized.config.resolve_dns? + @ip ||= IPAddr.new(ip_addr).to_s rescue nil @ip ||= Resolv.new.getaddress @name @group = opt[:group] @input = resolve_input opt |