#1
|
|||
|
|||
Run multiple scripts to SecureCRT
Hello,
I have a concept in my mind but I don't know if is it possible or if I think wrong. I want to execute a python script from my computer. Theses steps : - Choice (OK) - Check connectivity (OK) - Open a new session from secureCRT + send commands to the CLI (OK) - Execute another independent script to send commands to the CLI (!) I call my first script with subprocess.popen... but how can I run another script to this active session from my main script ? Thanks for your reply |
#2
|
|||
|
|||
Hi jeyro,
To the best of my knowledge, there presently is not a way to run one script from another in SecureCRT. I have added this thread to a feature request in our product enhancement database to add the ability to run multiple scripts in succession (call one script from another). Should a future release of SecureCRT include this feature, notification will be posted here. If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #13256" in the subject line or use this form from the support page of our website. Quote:
Or does it depend on the CLI operations from step 3? You may find this post/example scripts useful.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
I will try to explain me. I have a main script called DDI_ALL.py. In this one, there is :
Step 2 : Code:
#Connexion test ping_serveur = -1 ping_serveur = os.system("ping " + serveur_selected) Code:
#Launch SecureCRT username1=os.getenv('username') SecureCRTpath = 'C:\\Users\\'+str(username1)+'\\AppData\\Local\\VanDyke Software\\SecureCRT\\SecureCRT.exe' Scriptpath = 'C:\\Users\\'+str(username1)+'\\Documents\\PROJET\\SCRIPT\\PREPROD\\DDI_connection_cli.py' print(Scriptpath) #Connexion CLI subprocess.Popen(['C:\\Users\\XXXXXX\\AppData\\Local\\VanDyke Software\\SecureCRT\\SecureCRT.exe', '/SCRIPT', 'C:\\Users\\XXXXXX\\Documents\\PROJET\\SCRIPT\\PREPROD\\DDI_connection_cli.py']) Code:
cmd = "/SSH2 /L %s /PASSWORD %s /C AES-128-CTR /M SHA2-256 /AUTH password,keyboard-interactive,gssapi %s" % (user, passwd, host) Step 5 (ex: DDI_ALL.py calls DDI_parsing_check.py): It will be a parsing from the log file to conclude. I hope I'm clear (: |
#4
|
|||
|
|||
Hi jeyro,
That scenario falls under the "not possible now, feature request" response. ![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Tags |
python , run , script , securecrt , session |
Thread Tools | |
Display Modes | Rate This Thread |
|
|