Securecrt Script Loop



SecureCRT is one of my favourite tools, today I had a chance to use it in a way I didn’t expected.

A Do.Until loop is used when we want to repeat a set of statements as long as the condition is false. The Condition may be checked at the beginning of the loop or at the end of loop. The syntax of a Do.Until loop in VBScript is −. Do Until condition statement 1 statement 2. Automate repetitive tasks in SecureCRT by running scripts using VBScript, JScript, PerlScript, or Python. The script recorder builds your keystrokes into a VBScript or Python script. Transfer files between network devices with SFTP, Xmodem, Ymodem, Zmodem, or Kermit. A built-in TFTP server provides additional file transfer flexibility.

A customer called with a problem: he has a radio bridge that sometimes loses connection with the remote unit. The workaround is to reload the base unit. The process is manual, he monitors the radio bridge status and reload when required.

Thank you Lankymart!. But problem is, i am running VB script from windows desktop and executing a linux shell script present in RHEL Jump server, i want the output of the linux scipt to be printed in the windows command prompt. So that i can parse the output. – Fla-Hyd May 5 '16 at 15:47.

Since the radio bridge is not business critical he doesn’t have budget to replace tha radio bridge or troubleshoot the problem, the request was to automate the check/reload process.

Securecrt script loop tutorial

I checked the available tools: no Linux servers, no monitoring, no management platform… just a Windows server and… SecureCRT!A quick look on SecureCRT website confirmed that it supports scripting with Python, VBScript, Jscript and PerlScript. I’m familiar with Python so it is my choice.

The idea is simple:

  • connect to the remote device via telnet

  • verify the radio bridge is up

  • reload the device if radio bridge is down

The script with comments is quite self explanatory:

Securecrt Vbscript

This script is scheduled to run every 30 minutes on the Windows server using this sintax:

I’d have prefered a better implementation on a Linux machine but this works so far, the customer is happy and I learnt something new: win-win!

###Useful links

Please enable JavaScript to view the comments powered by Disqus.comments powered by

Securecrt Script Loop Syntax

Securecrt script loop example

Securecrt Script Commands

Disqus