Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 10-25-2019, 07:11 AM
MichelLapointe MichelLapointe is offline
Registered User
 
Join Date: Oct 2019
Posts: 8
How many open sessions ?

Bonjour,
Is there a way to quickly view the number of opened sessions ?
I open many sessions at the same time and shift-button to execute the same file transfer simulteneously from all the switches to a main storage.
If I check the main storage, I quickly see the number of new files. I want to compare it with the number of opened sessions to be sure every switches correctly did it's deed. So I'd like to compare that number with the number of opened sessions.
Merci,
Michel Lapointe
Reply With Quote
  #2  
Old 10-25-2019, 12:56 PM
ashiosee ashiosee is offline
Member
 
Join Date: Oct 2019
Posts: 24
Post

Quote:
Originally Posted by MichelLapointe View Post
Is there a way to quickly view the number of opened sessions?
That is a great question!

Currently SecureCRT does not support that functionality natively.

I have recorded a feature request on your behalf for the ability to display or view the number of opened sessions. 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 with a subject of: "Feature Request - Forum Thread #13951".

In the mean time, there is a way to display this information via a script. Imagine having a button mapped to run the script. When pressed, the number of connected/total tabs would appear in the status bar for a brief moment.
Code:
# $language = "VBScript"
# $interface = "1.0"

nTotalTabs = crt.GetTabCount
nConnected = 0

' Iterate through all of the tabs, finding out how many are connected:
For nIndex = 1 To nTotalTabs
    Set objCurTab = crt.GetTab(nIndex)
    If objCurTab.Session.Connected Then
        nConnected = nConnected + 1
    End If
Next

' Compose a report of the number of connected/total tabs:
strTabReport = nConnected & "/" & nTotalTabs & " connected tabs."
' Display the data to SecureCRT's status bar
crt.GetScriptTab().Session.SetStatusText strTabReport
' Wait a couple of seconds
crt.Sleep(2000)
' Clear the status bar
crt.GetScriptTab().Session.SetStatusText ""
Does this script workaround seem like it might meet your needs in the interim?
__________________
--Allen

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 10-29-2019, 09:36 AM
MichelLapointe MichelLapointe is offline
Registered User
 
Join Date: Oct 2019
Posts: 8
Bonjour Allen,
just checked the answer. Thanks for suggesting.

I'll try the script. Merci beaucoup.

by the way is there a way for me to be emailed when change is made to a thread ?

Michel
Reply With Quote
  #4  
Old 10-29-2019, 11:49 AM
ashiosee ashiosee is offline
Member
 
Join Date: Oct 2019
Posts: 24
Quote:
Originally Posted by MichelLapointe View Post
by the way is there a way for me to be emailed when change is made to a thread?
When you are signed in to the forums and viewing a thread, you should be able to click on the Thread Tools and choose to subscribe.
__________________
--Allen

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 10-29-2019, 01:12 PM
MichelLapointe MichelLapointe is offline
Registered User
 
Join Date: Oct 2019
Posts: 8
pushing my luck ...

bonjour again Allen,
thanks for the thread tools, that is done.
I am about to try the count vbs script. I'lll keep you posted.
In the meantime, I have another request that looks a bit like the "count tabs" one. I know I am pushing it, but hey ...
I am using SecureCRT to monitor let's say 50 switches displaying messages. How about a vbs script that would circle through all the tabs, pause for 2 seconds for me to see if Something wrong, and display the next tab. And if I see something wrong, the 2 seconds display gives me time to bang the spacebar and stop the circling

would'n that be a nice add-on ??? :-) :-) :-)
Michel
Reply With Quote
  #6  
Old 10-29-2019, 01:16 PM
MichelLapointe MichelLapointe is offline
Registered User
 
Join Date: Oct 2019
Posts: 8
it works !!!

thanks for the script. It works .
I changed the length to 5 seconds so I could find it on the screen. Great.
like we say in french
"Merci beaucoup"
Michel
Reply With Quote
  #7  
Old 10-29-2019, 05:13 PM
ashiosee ashiosee is offline
Member
 
Join Date: Oct 2019
Posts: 24
Quote:
Originally Posted by MichelLapointe View Post
thanks for the script. It works.
That's great news to hear. I'm glad the script worked for you!

Quote:
Originally Posted by MichelLapointe View Post
How about a vbs script that would circle through all the tabs, pause for 2 seconds for me to see if Something wrong, and display the next tab. And if I see something wrong, the 2 seconds display gives me time to bang the spacebar and stop the circling
You can use SecureCRT's WaitForKey() method to wait for any keystroke. Making a few modifications to the existing script to iterate over all the tabs and make use of this WaitForKey() call, you can achieve somewhat the behavior that you desire. For example:
Code:
# $language = "VBScript"
# $interface = "1.0"

' Start with the tab in which the script is launched.
nCurTab = crt.GetScriptTab().Index

Do

    ' First, prepare the "x/y Connected" report for the status bar...
    ' ###############################################################
    nTotalTabs = crt.GetTabCount
    nConnected = 0

    ' Iterate through all of the tabs, finding out how many are connected:
    For nIndex = 1 To nTotalTabs
        Set objCurTab = crt.GetTab(nIndex)
        If objCurTab.Session.Connected Then
            nConnected = nConnected + 1
        End If
    Next

    ' Compose a report of the number of connected/total tabs:
    strTabReport = nConnected & "/" & nTotalTabs & " connected tabs."
    ' ###############################################################

    ' Now, activate the current tab and display the report:
    ' Activate the current tab we're on.
    Set objCurTab = crt.GetTab(nCurTab)
    objCurTab.Activate

    ' Display the data to SecureCRT's active tab
    objCurTab.Session.SetStatusText strTabReport

    ' Now, wait a couple of seconds for any keystroke to occur
    If objCurTab.Screen.WaitForKey(2) Then
        ' Let the user know we've bailed on the script.
        objCurTab.Session.SetStatusText "Bailed due to keystroke."
        Exit Do
    Else
        ' Clear the status text on the current tab before we move
        ' on to the next tab -- this way, there isn't stale data
        ' in the status bar on tabs after this script exits/bails.
        objCurTab.Session.SetStatusText ""
    End If

    ' Otherwise, move on to the next tab.
    nCurTab = nCurTab + 1
    ' If we've gone beyond the last tab, cycle through to tab #1:
    If nCurTab > nTotalTabs Then nCurTab = 1
Loop
__________________
--Allen

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

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 05:52 PM.