From cf4ab7752cd7c6141f2da0a7491c9f1842c88f09 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 20:24:18 +0200 Subject: some debug statements --- lib/oxidized/input/cli.rb | 7 ++++++- lib/oxidized/input/ssh.rb | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/cli.rb b/lib/oxidized/input/cli.rb index 731b459..fc7f426 100644 --- a/lib/oxidized/input/cli.rb +++ b/lib/oxidized/input/cli.rb @@ -17,10 +17,15 @@ module Oxidized end def connect_cli - @post_login.each { |command, block| block ? block.call : (cmd command) } + Oxidized.logger.debug "lib/oxidized/input/cli.rb: Running post_login commands at #{node.name}" + @post_login.each do |command, block| + Oxidized.logger.debug "lib/oxidized/input/cli.rb: Running post_login command: #{command.inspect}, block: #{block.inspect} at #{node.name}" + block ? block.call : (cmd command) + end end def disconnect_cli + Oxidized.logger.debug "lib/oxidized/input/cli.rb Running pre_logout commands at #{node.name}" @pre_logout.each { |command, block| block ? block.call : (cmd command, nil) } end diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index fef20d6..aa44b37 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -54,7 +54,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 +123,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 +131,5 @@ module Oxidized end end end - end end -- cgit v1.2.1 From 71d9bdc6a529d187d58a855208341409aa872289 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 21:24:48 +0200 Subject: more debug stratements --- lib/oxidized/input/ssh.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index aa44b37..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 -- cgit v1.2.1 From 369bf7c96cfcf342c55f7a57170bd00c352154e3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 23:41:42 +0200 Subject: cleaner spec --- lib/oxidized/input/.telnet.rb.swp | Bin 0 -> 16384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/oxidized/input/.telnet.rb.swp (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/.telnet.rb.swp b/lib/oxidized/input/.telnet.rb.swp new file mode 100644 index 0000000..dc6503d Binary files /dev/null and b/lib/oxidized/input/.telnet.rb.swp differ -- cgit v1.2.1 From 64bdbeb673a8ab7155478ee5e0d1d58c1631a9d3 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 2 Jun 2016 23:51:08 +0200 Subject: fix cli spec --- lib/oxidized/input/.telnet.rb.swp | Bin 16384 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/oxidized/input/.telnet.rb.swp (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/.telnet.rb.swp b/lib/oxidized/input/.telnet.rb.swp deleted file mode 100644 index dc6503d..0000000 Binary files a/lib/oxidized/input/.telnet.rb.swp and /dev/null differ -- cgit v1.2.1