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 02-09-2014, 07:57 PM
christiandg christiandg is offline
Registered User
 
Join Date: Dec 2007
Posts: 12
Check the Status of JumpServer session

I have setup a Secure Shell Connection as a SOCKS Proxy from my Jump server and it is working. I can launch a connection now from any host using it as a Firewall from a script.

Dim szCmd
szCmd = "/FIREWALL " & "/TELNET " & strIP

crt.Session.Connect szCmd

Basically, I am connecting manually to the JumpServer first before I launch any connection from my script. Is there a way to include the jumpserver session from my script?

crt.Session.ConnectInTab "/s ""JumpServer"""

I know I can just launch the saved session of the jumpserver before connecting through hosts but it will launch multiple sessions of "JumpServer" every time you run the script.

Is there a way I can insert some if statement like if JumpServer is already established then dont open another Jumpserver session and if there is none then open a JumpServer session before connecting to a host. Or check if the prompt of the server "$" is there before continuing with the script.
Reply With Quote
  #2  
Old 02-10-2014, 11:05 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi christiandg,

It would be possible to check to see if the jump server session already exists. You could give the tab a particular caption, and then check each tab that is open to see if the jump server is connected.

The script could also connect the jump server session if it is not found as you iterate over each tab.

You can find the documentation for the scripting objects in the ActiveX Scripting / Script Objects Reference chapter of the help file.

You could use the GetTabCount(), GetTab() methods of the Application object in conjunction with the Caption property of the Tab object.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 02-27-2014, 09:57 AM
christiandg christiandg is offline
Registered User
 
Join Date: Dec 2007
Posts: 12
How to refer to securecrt tabs from a native vbscript and not from SecureCRT? The script below will check if SecureCRT is running. How will I know if a specific session is connected or echo all the opened connected tabs. This script will be run from outside the securecrt so I supposed GetTabCount(), GetTab() will not be recognized. Thanks.

Set wmi = GetObject("winmgmts:")
Set procs = wmi.ExecQuery("select * from Win32_Process Where Name='Securecrt.Exe'")
If procs.Count > 0 Then
wscript.echo "SecureCRT Running"
wscript.quit
Else
wscript.echo "SecureCRT NOT Running"
End If
wscript.quit
Reply With Quote
  #4  
Old 02-27-2014, 11:33 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi christiandg,

You are correct. SecureCRT doesn't currently expose the scripting API.

You could run a script from within SecureCRT to write the captions to a file.
__________________
--Todd

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

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 02:56 PM.