Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-14-2015, 08:02 PM
thewhite thewhite is offline
Registered User
 
Join Date: Jan 2015
Posts: 2
Question Run SecureCRT script on linux command line

Dear All,

I encountered a problem on running SecureCRT python script by Linux command line.
Here is the command that I use to run the script.
# SecureCRT /script test.py

It can succeed to open the SecureCRT window and open the session in tab.
But it stop on login prompt.
It seems the crt.Screen.WaitForString() can't capture the string and then the crt.Screen.Send() can't send the response sting.
Is there other methods I can use?
Thanks.
Reply With Quote
  #2  
Old 01-15-2015, 07:51 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello thewhite,

I am not sure if you intended to, but you did not attach your script.

What version of SecureCRT are you using?

What protocol are you using in your connection?

How are you making the connection in the script (ie: is it a saved session or an ad hoc connection)?

If I had to make a guess at the cause of the issue (if SSH2 protocol), I would say you probably have not enabled the Display logon prompts in terminal window option in the Connection / Logon Actions category of SecureCRT's Session Options.

If connecting to existing saved sessions and you need to make that change to many (or all) sessions, see these tips on our website:

http://www.vandyke.com/support/tips/defaultset.html
http://www.vandyke.com/support/tips/multisessions.html

If an ad hoc connection, you would use the Default Session tip, but could change Default Session only (instead of all sessions).
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-16-2015, 02:56 AM
thewhite thewhite is offline
Registered User
 
Join Date: Jan 2015
Posts: 2
Dear Brenda,

Many thanks for your reply.
The problem is fixed. But I totally have no idea how it is fixed.

And I encountered another problem when I run the script by crontab.
It shows the error message "SecureCRT: cannot connect to X server".
Do you have any idea about this error message?
Thanks.

- Aries
Reply With Quote
  #4  
Old 01-16-2015, 08:52 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello aries,

There is not enough information to know at this point.

What is the command-line you use in crontab to run SecureCRT and connect?

Are you able to connect the session successfully outside of crontab?

I am puzzled by the "X server" reference you noted in the error message. Are you attempting to forward X11 packets in the SecureCRT session?

The best way to troubleshoot this would be to get trace options output. If you are running SecureCRT from the command-line, this has to be done by editing the session (or Default Session) INI file.

Please contact support@vandyke.com and reference "Attn Brenda - Forum Thread #11850" in the subject line.
__________________
Thanks,
--Brenda

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

Tags
command line , python

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 06:36 AM.