Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-28-2018, 01:52 PM
bgoulet bgoulet is offline
Registered User
 
Join Date: Aug 2018
Posts: 2
handling SecureCRT interactive prompts

I have a script to connect to a large list of cisco devices that I would like to run unattended but there are a number of cases where SecureCRT generates an interactive prompt which halts the script. so far these are the 2 cases I have run into but i'm in early testing so there may be others.

1) when the username/password provided by the script fails SecureCRT pops up and error prompt with the options SKIP and OK. you then have the option to provide new credentials. if the login fails per the script credentials I would like the script to just skip that system and move on, not prompt the user interactively. I have found that if you just let it sit there it eventually times out on its own but I would like to handle the error and move on faster.

2) the first time connecting to a new device SecureCRT presents the 'new host key' dialog where you have to Accept&Save before the connection completes. I need this to automatically happen.

are there any good ways at handling these interactive dialogs? having to attend the user interface and click on prompts kind of defeats the point of scripting.
Reply With Quote
  #2  
Old 08-28-2018, 02:25 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 526
Hi bgoulet,

This example script should help demonstrate handling authentication issues. It demonstrates how to connect to hosts read in from a "hosts" file and for each host, send a list of commands read in from a "commands" file.

The Connect/ConnectInTab methods takes a string parameter that specifies how a connection is to be made. The format of the string parameter matches the format of the command line arguments to SecureCRT. One of the optional commands is /ACCEPTHOSTKEYS. This will instruct SecureCRT to automatically accept host keys without prompting.

Does this help get you the behavior you're looking for?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 08-29-2018, 08:36 AM
bgoulet bgoulet is offline
Registered User
 
Join Date: Aug 2018
Posts: 2
wow! that's quite the script. the /ACCEPTHOSTKEYS absolutely helped. i'm still trying to sort out the rest of your code. i'll probably just re-write my script from scratch starting with yours as a base. thank you.
Reply With Quote
  #4  
Old 08-29-2018, 09:17 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 526
Hi bgoulet,

I'm glad to hear the /ACCEPTHOSTKEYS option is working as expected.

Please let us know if you have any specific questions that we can help answer about the example script or its use.

In the meantime this forum post contains many good example scripts. If you are connecting to Cisco devices the Cisco Save Running/Startup Config to Local File script may be of interest. It is designed to save a copy of your Cisco router's running-config or startup-config to a file on your local machine.
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:13 AM.