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 02-11-2019, 12:11 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Track and Close multiple tabs

I have a script that will open and work with multiple tabs. I tried closing all of them if a close option is used but it crashes secureCRT 75% of the time.

Is there a better way to check if a tab has been used and close it and not touch any other tabs a user may have open?

This is the part of my script I think is crashing SecureCRT.
Code:
Select Case Action
					Case "CLOSE"
						On Error Resume Next
						If bsmTab.Session.Connected = -1 Then bsmTab.Close
						If csrTab.Session.Connected = -1 Then csrTab.Close
						If lteTab.Session.Connected = -1 Then lteTab.Close
						If cdmaTab.Session.Connected = -1 Then cdmaTab.Close
						If mwTab.Session.Connected = -1 Then mwTab.Close
						On Error GoTo 0
						Exit Sub
					Case "CANCEL"
						If bsmTab.Session.Connected = -1 Then bsmTab.Close
						Exit Do
I tried just closing them all with .Close but that crashed every time. So then I tried with the .Connected test but that didn't help much.

If I don't use the on error goto next I get an exception every time as only some of the tabs get set most of the time. It is rare that all tabs will be open.

The error is
SecureCRT experienced a fatal error and must close.
Version 6.7.3 (build 292)
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #2  
Old 02-11-2019, 01:34 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi bstedh,

Why are you using such an old version? Version 6.7.3 is 7-8 years old.

Your crashing problem may be as simple as upgrading to the next maintenance release:

Changes in SecureCRT 6.7.4 (Official) -- February 2, 2012
---------------------------------------------------------
  • SecureCRT crashed if a tabbed session was disconnected while a script was running.
But SecureCRT also had a v6.7.5 release (if your license is valid for 6.7.3, it's valid for 6.7.5) and the last release in any version is what's available on our website. You can check Upgrade Eligibility here.


Quote:
I tried just closing them all with .Close but that crashed every time.
Per the documentation in SecureCRT's Help file for the Close method available to the Tab object:
Quote:
Remarks
Any active connection associated with the tab (or tiled session window) referenced by object is terminated when the tab (or tiled session window) is closed. The tab or tiled session window running the script cannot be closed.

Quote:
Is there a better way to check if a tab has been used and close it and not touch any other tabs a user may have open?
What do you mean by "if a tab has been used"? Are you checking for output? How are you determining if a tab's been "used"?

Rather than a shotgun approach, I expect you would put focus on that one tab (with Activate method) and then close it (as long as it's not the tab the script was started in).
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 02-11-2019, 01:51 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
I will give the maintenance upgrade a try. However getting everyone else to do it would be an issue. We gets what IT puts on the putters... No more no less... and have little to no input on what they licence.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #4  
Old 02-11-2019, 02:09 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Have to bounce between multiple devices to check alarms and connections so I wanted to have the tabs open until the user switches to another site. That way it doesn't have to log into the devices multiple times in one session. Basically each session will have a jumpbox connection which stays open and then connect to a region and site with each site having 3 to 6 devices that need to be checked each with their own command set. My script alleviates having to log into multiple management apps as each device type has its on management application. So basically I am consolidating 4 management applications into one script to have all the commands at your fingertips without bouncing around. Especially as we have to connect over a VPN and the applications are very slow on cellular connection. Using cli commands makes this super fast and easy.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #5  
Old 02-11-2019, 02:23 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
Quote:
What do you mean by "if a tab has been used"? Are you checking for output? How are you determining if a tab's been "used"?
Each site will have at a minimum a cisco router. So my script logs into that and then scans its ports to determine what other equipment is on site. It will then open tabs for those pieces of equipment as the user selects them. I leave those tabs open while working within that site and don't close any of the tabs until the user either closes out the script or backs out to a different site. Currently I am not tracking what tabs are open, I am thinking of just defining a dictionary to assign true and false variables for when tabs are opened for a device. However if it is a bug that is fixed in a later version I might not be able to work around it as most of the other techs will not upgrade their version of SCRT.

Basically everything is built around HTML pages to display status and command options for the various devices. Right now most techs have a spreadsheet of commands for all the different devices and just copy and paste for what they need.. =] Teaching old dogs new tricks is an uphill battle.
__________________
Version 6.7.3 (build 292)
Reply With Quote
  #6  
Old 02-11-2019, 02:42 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,937
Hi bstedh,

Since v6.7.x is no longer in active development I can't help with the crashing issue.

It sounds like you have been using at least some form of this script for awhile. If it just started crashing, then possibly it's due to changes in the script.

Is there an issue outside of the crashing issue you need assistance with?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 02-12-2019, 02:25 PM
bstedh bstedh is offline
Registered User
 
Join Date: Jan 2018
Posts: 41
No, re-writing existing script to make things quicker and more reliable.... The use of more than 2 to 3 tabs at a time is the only real structural difference. I went this route to store passwords in sessions instead of in plain text. also using the session descriptions to store memory type things like last site connected to and highlighting preferences.
__________________
Version 6.7.3 (build 292)
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 07:21 AM.