And you can create plenty of buttons in the button bar to run those scripts. These oneshot or periodic tasks can be done by different python scripts. In the other scenario, we are going to do a burn-in test to check if a function works fine repeatedly like a rebooting test. These actions are **oneshot** and are launched again and again.
And then, I download it through TFTP from DUT to my server. For example, I often build a binary and scp it from a server to the other. In a scenario, when developing new functions in a firmware or a binary, there are plenty of duplicated actions to do. # tags: `development`, `python`, `SecureCRT`, `automated script execution` 'To find out the router name for future useĬrt.Screen.WaitForStrING Strline(1) & ">"Ĭrt.Screen.# Make SecureCRT scripts simpler
' If the router is login for the first time, the solaris system need to confirm to save the password information. ' login to the device use ssh or telnet, the command line is differentĬrt.Screen.Send NeInfo(3) & " " & NeInfo(4) & & NeInfo(2) & vbCrĬrt.Screen.Send NeInfo(3) & " " & NeInfo(2) & vbCr ' Sperate the information and put into an array NeInfo 'Read line by line for the document, and for each line, login in the the NE represented and do the related activity ' according to the constant Startline, read the file until the startline Set file1 = fso.openTextFile("d:\all.csv", ForReading, False)
Set fso = CreateObject("Scripting.FileSystemObject") 'open file all.csv, to read line by line later 'line store the information of one NE in one line 'To define file system object, and related parameters Based on this information, combine them into the login command line, then enter the command to perform the corresponding operation.Ĭonst ForReading = 1, ForWriting =2, ForAppending = 8 The fields in the data indicate the device name, device type, IP address, login user name, and password. Each time a line is read from the data file and stored in the array. The advantage is that the program can be processed efficiently, and the device list can be easily copied from other data files in Excel format.Īfter logging in to the server, run the script. This is convenient for processing the corresponding script after logging in to a server.įor automatic processing, the name, IP address, and user name and password of the router to be accessed are stored in the. In this way, automatic design can be performed according to these prompts and responses.įor security and auditing purposes, basically the login of the devices is now based on a server as a springboard. The login prompt of the device, the prompt after login, and the response to each command line can be expected.
Terminal software such as SecureCRT supporting the VBSCRIPT. In addition, the careful design before the execution can ensure no problem occurs. But a more common approach is to use VBSCRIPT, the script execution can automate the login process, which greatly improves efficiency. If the device supports ZTP, it will be very convenient. If you need to configure the same configuration for a large number of devices, it is a waste of time to log in and configure the device one by one and it is more error-prone.