I have really scoured the forums and google thoroughly. I can't figure this one out on my own.
We have NA 9.22 running on Linux.
We don't have "Use Single Sign-On" enabled.
Our standard scripts run fine.
I can't get advanced Perl or Expect Scripts to connect to our devices.
When the advanced scripts fail, NA does a successsful snapshot afterwards!
I am currently trying Expect.
When I run an SSH session on the CLI proxy, and then "Convert to Expect Script" I get:
spawn telnet localhost $tc_proxy_telnet_port$ expect "$tc_proxy_login_prompt$" send "$tc_user_username$\r" expect "$tc_proxy_password_prompt$" send "$tc_user_password$\r" expect "$tc_proxy_prompt$" set prompt "#" set more_prompt "!!unknown!!" set config_prompt "!!unknown!!" set timeout 60 send "connect -info -nosession #$tc_device_id$\r"
When I run this I get:
Could not connect to device my-adm-rtr-1 (220.127.116.11). Failure Reason: Can't open SSH v2 connection to 18.104.22.168: username/password incorrect NA> Successful snapshot taken. <snip> Begin Post-task Snapshot Step: Retrieve version information Running: getversion (retrieve version information via CLI) Connect Creating ssh connection to 22.214.171.124 [in realm WEST Core] with Last successful password (Password rule PWDR1) Connect - Attempting connection via SSH to 126.96.36.199 (port 22) Connected via SSHv2 to 188.8.131.52 (port 22) Receive: my-adm-rtr-1 line 706 my-adm-rtr-1# <snip>
So I tried adding the device login and password using:
$tc_device_username$ / $tc_device_password$
$tc_device_enable_username$ / $tc_device_enable_password$
I had similar results.
What is the right way to do "connect -info -nosession #$tc_device_id$\r" once the script has successfully connected to the proxy host and sees the "NA>" prompt?
I would like it to loop through the Device Password Rules like I've been told the standard scripts do. Notice that when it does the snapshot it says "Creating ssh connection to 184.108.40.206 [in realm WEST Core] with Last successful password (Password rule PWDR1)."
I would really like to know how to make this work with Perl as well. So far I've had the same results.