summaryrefslogtreecommitdiff
path: root/lib/oxidized/input/ssh.rb
diff options
context:
space:
mode:
authorElvin Efendi <elvin.efendiyev@gmail.com>2016-06-02 23:53:29 +0200
committerElvin Efendi <elvin.efendiyev@gmail.com>2016-06-02 23:53:29 +0200
commitaef81bd14989797d26d349fdf1a517045f5af33c (patch)
treedb194c27c1fa4c8542a048e4afd8dcb0793acb27 /lib/oxidized/input/ssh.rb
parent779f20dd18a361b5bde51f3f11c6d048efe100a0 (diff)
parent64bdbeb673a8ab7155478ee5e0d1d58c1631a9d3 (diff)
Merge pull request #25 from Shopify/debug-statements
Debug statements
Diffstat (limited to 'lib/oxidized/input/ssh.rb')
-rw-r--r--lib/oxidized/input/ssh.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index fef20d6..db39a7e 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -37,6 +37,7 @@ module Oxidized
ssh_opts[:kex] = vars(:ssh_kex).split(/,\s*/) if vars(:ssh_kex)
ssh_opts[:encryption] = vars(:ssh_encryption).split(/,\s*/) if vars(:ssh_encryption)
+ Oxidized.logger.debug "lib/oxidized/input/ssh.rb: Connecting to #{@node.name}"
@ssh = Net::SSH.start(@node.ip, @node.auth[:username], ssh_opts)
unless @exec
shell_open @ssh
@@ -54,7 +55,7 @@ module Oxidized
end
def cmd cmd, expect=node.prompt
- Oxidized.logger.debug "SSH: #{cmd} @ #{node.name}"
+ Oxidized.logger.debug "lib/oxidized/input/ssh.rb #{cmd} @ #{node.name} with expect: #{expect.inspect}"
if @exec
@ssh.exec! cmd
else
@@ -123,6 +124,7 @@ module Oxidized
end
def expect regexp
+ Oxidized.logger.debug "lib/oxidized/input/ssh.rb: expecting #{regexp.inspect} at #{node.name}"
Timeout::timeout(Oxidized.config.timeout) do
@ssh.loop(0.1) do
sleep 0.1
@@ -130,6 +132,5 @@ module Oxidized
end
end
end
-
end
end