From c39e8ebb2e19d718d039dc0c659d76b4469a750f Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Mon, 25 Jan 2016 13:17:09 +0200 Subject: SSH does not prompt for username/password Some devices, like Cisco WLC do not authenticate using SSH (ssh is noauth) and actually prompt for auth via shell. CiscoSMB is not one of those kits. We probably should do sepearate bug for the error messages this caused. ``` begin @username ? shell_login : expect(@node.prompt) rescue Timeout::Error raise PromptUndetect, [ @output, 'not matching configured prompt', @node.prompt ].join(' ') end ``` Here Timeout:Error is not raised by ```expect(@node-prompt)``` it is raised by ```shell-login```, which is triggered due to @username prompt set. Potential fixes 1. change the error to more generic one, covering both cases 2. add rescue in 'def shell_login' for Timeout::Error and report it there --- lib/oxidized/model/ciscosmb.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb index 47e8391..3ef9a85 100644 --- a/lib/oxidized/model/ciscosmb.rb +++ b/lib/oxidized/model/ciscosmb.rb @@ -33,9 +33,12 @@ class CiscoSMB < Oxidized::Model cfg end - cfg :telnet, :ssh do + cfg :telnet do username /^User Name:/ password /^\r?Password:$/ + end + + cfg :telnet, :ssh do post_login 'terminal datadump' # Disable pager post_login 'terminal width 0' pre_logout 'exit' -- cgit v1.2.1