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 04-03-2013, 06:25 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
SSH to different hosts fails

My script to SSH into different Cisco Wireless LAN Controllers sequentially to program LWAPs only connects to the first Controller. Upon trying to SSH to the next Cisco Controller it states CRT Scripting Runtime error
ERror: Connection failed
Line 256

after clicking OK
the console states "The specified address is not available from the local computer"

If I try accessing the controllers in reverse IP address order, the 2nd controller which was not accessible IS accessible. It's something to do with the disconnect of the first controller and SSH connection into second controller.

Last edited by olivebranch2006; 04-03-2013 at 06:31 PM. Reason: more detail
Reply With Quote
  #2  
Old 04-04-2013, 07:23 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi olivebranch2006,

What is the version of SecureCRT that you are using?

Is this a new issue?

If it is, what has changed in your environment?

Please post the script you are using (after removing any sensitive data).
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 04-04-2013, 09:31 AM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
Script Code

This problem has existed since I wrote the script and I haven't been able to figure it out. SecureCRT is version 7.0.1 (x64 build 374). Platform is Windows 7 Enterprise N 64 bit.

Thanks!
Attached Files
File Type: txt lwap-script.txt (16.5 KB, 504 views)
Reply With Quote
  #4  
Old 04-04-2013, 02:49 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi olivebranch2006,

Thanks for the data and the script. We are investigating this issue.

In the meantime, would you make a change to your Default.ini file and post whether the issue is resolved?
To edit the Default.ini file:
  1. Close all instances of SecureCRT. If changes are made to the Default.ini file while SecureCRT is running, the changes made will be undone when SecureCRT is closed.
  2. Edit Default.ini file (located in the Sessions subfolder of SecureCRT's configuration folder location indicated by the Configuration folder field in the General category of the Global Options dialog. Add/modify lines as instructed.
  3. Save the Default.ini file and start SecureCRT.

    Note: If you have a /f in the target of the shortcut used to launch SecureCRT, then the path to the Config folder will be different than the path in step 2 above.
The line to edit is:
From:
D:"Force Close On Exit"=00000000
To:
D:"Force Close On Exit"=00000001
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 04-04-2013, 03:01 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
Edited Default.ini

Edited Default file and ran the script. Same problem:
CRT Scripting Runtime error

Error: Connection failed

LWAP-Program-3.31.vbs
Line: 256

After clicking OK, the first session is now disconnected in SecureCRT with the only text in terminal window being:
The specified address is not available from the local computer.

Thanks!

Last edited by olivebranch2006; 04-04-2013 at 03:02 PM. Reason: typo
Reply With Quote
  #6  
Old 04-04-2013, 03:13 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Thanks for the test olivebranch2006. I will post here with any other questions we might have as we investigate this issue.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 04-09-2013, 10:08 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi olivebranch2006,

We would like to get some additional data. Would you comment out the calls to ProgramAllAPs and let me know if you still see the issue when connecting to the second device?

If you do, would you enable logging for each connection to a separate file?

For example:
Code:
' Set log file name
crt.Session.logfilename = "c:\temp\connection1.log"
' Enable logging
crt.Session.log true
' Get current trace level so we can set it back after the test
nCurrentTraceLevel = CInt(crt.Session.Config.GetOption("Trace Level"))
' Set new trace level
crt.Session.Config.SetOption "Trace Level", 5
' Connect to remote
crt.Session.Connect "/ssh2 /l user /password password host"
' Set trace level back
crt.Session.Config.SetOption "Trace Level", nCurrentTraceLevel
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 04-09-2013, 05:19 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
Any luck?

Any luck? Can I help? Oh I didn't see your reply. I'll get that as soon as possible.

Last edited by olivebranch2006; 04-09-2013 at 05:22 PM.
Reply With Quote
  #9  
Old 04-10-2013, 09:00 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi olivebranch2006,

Since the trace output can have sensitive data, you may want to send this to support@vandyke.com with a subject of Attn Todd - Forum thread #10971.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #10  
Old 04-11-2013, 03:18 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
logs created but blank

I added the code like so:

' Set log file name
crt.Session.logfilename = "c:\FTPROOT\connection1.log"
' Enable logging
crt.Session.log true
' Get current trace level so we can set it back after the test
nCurrentTraceLevel = CInt(crt.Session.Config.GetOption("Trace Level"))
' Set new trace level
crt.Session.Config.SetOption "Trace Level", 5

ConnectWLC1 'connect to 1st WLC
'ProgramAllAPs

' Set trace level back
crt.Session.Config.SetOption "Trace Level", nCurrentTraceLevel

for each connect WLC instance (1, 2, 3) and the logs were blank except the last one which was me manually logging out of the last WLC. The script did work though. It connected to 1st WLC, had a long pause, then connected to 2nd WLC. It could be something in the ProgramAllAPs function? do you agree?

Thanks!
Reply With Quote
  #11  
Old 04-11-2013, 03:48 PM
olivebranch2006 olivebranch2006 is offline
Registered User
 
Join Date: Apr 2010
Posts: 35
Tried another change but failed

Screen JPEG attached. This is after:
1. enabling ProgramAllAPs function again.
2. increased pause at end of SaveConfig function from 500ms to 3second
3. added 3 second pause at middle of SaveConfig function before it sends console "logout" command.

So it appears something is broken in the ProgramAllAPs function which also calls out many other functions.

The connection log files are blank, which is strange.

The ProgramAllAPs function successfully executes all of its ancillary functions down to saveconfig.

Your help is always appreciated, thank you.
Attached Images
File Type: jpg SS.jpg (63.2 KB, 378 views)
Reply With Quote
  #12  
Old 04-11-2013, 04:09 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi olivebranch2006,

Thanks for the update. I am not sure why the log files are blank. In my tests, they are not. There is likely some simple thing that is causing a problem.

I do think that there is a bug in your code, but I am not sure what it is.

I would suggest that you comment all function calls in ProgramAllAPs and see if you have a problem. If you don't, slowly add one function call back in at a time and see which one is causing the problem. Once you find that, post it, and I will see if I can find out what might be causing the problem, and what data we might need to get.
__________________
--Todd

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 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 03:54 PM.