summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-06-27 19:50:59 +0300
committerSaku Ytti <saku@ytti.fi>2018-06-27 19:50:59 +0300
commit55602de1caa49016a2b54a34424e08c37ab2f398 (patch)
tree1dc36aaa8bf64ff012b3721facce5ed0b4baf6bf /lib
parent23603127362e6f4a7606325501a3ce26ef8317a1 (diff)
Don't use SSH logger unless input debug is set
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/input/ssh.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index d97633d..8caa801 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -123,7 +123,6 @@ module Oxidized
port: (vars(:ssh_port) || 22).to_i,
paranoid: secure,
keepalive: true,
- logger: Oxidized.logger,
password: @node.auth[:password],
timeout: Oxidized.config.timeout,
number_of_password_prompts: 0
@@ -144,7 +143,11 @@ module Oxidized
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?
+
+ if Oxidized.config.input.debug?
+ ssh_opts[:logger] = Oxidized.logger
+ ssh_opts[:verbose] = Logger::DEBUG
+ end
ssh_opts
end