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 12-18-2019, 09:37 AM
dougbert dougbert is offline
Registered User
 
Join Date: Dec 2019
Posts: 3
Disabling Anti-Idle for the duration of a script

I'm wondering if it's possible to disable the anti-idle setting that's defined on the session when you run a python/VBScript. I'm finding the anti-idle characters can really mess up my scripts whenever my script has to wait for a device to finish a process (i.e. downloading new firmware on a switch/reloading/etc). Seems like I should be able to make a call in my script to disable that session option and then re-enable it before my script is done.

I love the scripting option for SecureCRT but there really isn't very full documentation on what variables and options can be called. I hope you can flesh this out more for all the different scripting languages you support in the future.
Reply With Quote
  #2  
Old 12-18-2019, 10:36 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,104
Hi dougbert,

What version of SecureCRT are you using?

Are you using the "NO-OP" anti-idle?

Quote:
I love the scripting option for SecureCRT but there really isn't very full documentation on what variables and options can be called. I hope you can flesh this out more for all the different scripting languages you support in the future.
Every object, property and method is documented in the Help topic Scripting / Script Objects Reference. And there are examples for both VBScript and Python. The specific object you need is the SessionConfiguration object.

Using that, you can get to just about any entry in the session's INI file.

Code:
objTab = crt.GetScriptTab()
objConfig = objTab.Session.Config
strOrigIdle = objConfig.GetOption("Idle NO-OP Check")
if strOrigIdle:
    objConfig.SetOption("Idle NO-OP Check", False)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-18-2019, 12:37 PM
dougbert dougbert is offline
Registered User
 
Join Date: Dec 2019
Posts: 3
Thanks for the prompt reply Brenda. The help topics in the program itself has what I was looking for. Appreciate the assistance.
Reply With Quote
  #4  
Old 12-19-2019, 08:34 AM
dougbert dougbert is offline
Registered User
 
Join Date: Dec 2019
Posts: 3
I was able to get this to work, here's a sample of what I did via python:
Code:
def IdleCheck():
    IdleCheckSet = False
    objTab = crt.GetScriptTab()
    objConfig = objTab.Session.Config
    strOrigIdle = objConfig.GetOption("Idle Check")
    if strOrigIdle:
        objConfig.SetOption("Idle Check", False)
        IdleCheckSet = True
        crt.Dialog.MessageBox("Idle Check is now disabled")
    if IdleCheckSet is False:
        objConfig.SetOption("Idle Check", True)
        crt.Dialog.MessageBox("Idle Check is now enabled")
IdleCheck()
If the user has the Idle Check option turned on, it turns it off and vice-versa but I was able to use the IdleCheckSet variable to test this in my script and if the user has it enabled, it disables it for the duration of the script and then re-enables it without the user having to interact.

Last edited by dougbert; 12-19-2019 at 08:36 AM.
Reply With Quote
Reply

Tags
anti-idle , disabling , options , python


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 09:06 PM.