From 55602de1caa49016a2b54a34424e08c37ab2f398 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Wed, 27 Jun 2018 19:50:59 +0300 Subject: Don't use SSH logger unless input debug is set --- lib/oxidized/input/ssh.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.1