diff options
author | Saku Ytti <saku@ytti.fi> | 2018-06-22 11:02:24 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2018-06-22 11:02:24 +0300 |
commit | 73b92861a46f1f1d3be560c12e0e9dd0eab00707 (patch) | |
tree | 9cfd758ff1fdc13a7aae066a9b6ddf30b0d6271b /lib/oxidized/input/ssh.rb | |
parent | f0947761b46e4ee6cdadd866b1cf3cf25bdfeedd (diff) |
enable SSH logging if input logging is true
Diffstat (limited to 'lib/oxidized/input/ssh.rb')
-rw-r--r-- | lib/oxidized/input/ssh.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index d321a11..0bc846f 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -45,9 +45,10 @@ module Oxidized ssh_opts[:proxy] = proxy end - ssh_opts[:keys] = vars(:ssh_keys).is_a?(Array) ? vars(:ssh_keys) : [vars(:ssh_keys)] if vars(:ssh_keys) - ssh_opts[:kex] = vars(:ssh_kex).split(/,\s*/) if vars(:ssh_kex) + ssh_opts[:keys] = [vars(:ssh_keys)].flatten if vars(:ssh_keys) + ssh_opts[:kex] = vars(:ssh_kex).split(/,\s*/) if vars(:ssh_kex) ssh_opts[:encryption] = vars(:ssh_encryption).split(/,\s*/) if vars(:ssh_encryption) + ssh_opts[:verbose] = Logger::DEBUG if Oxidized.config.input.debug? Oxidized.logger.debug "lib/oxidized/input/ssh.rb: Connecting to #{@node.name}" @ssh = Net::SSH.start(@node.ip, @node.auth[:username], ssh_opts) |