Telnet Script For Backup a CISCO [2]

Telnet Script For Backup a CISCO

Monday, February 29, 2016 2:21 PM - Rene

Hello guys,
I recently downloaded your application and do not know how can make a script that is connected to a CISCO through TELNET with user and password and execute a command; (show configuration) and store the result in to TXT file, and jump to another IP and repeat the same process, in order to automatized a maintenance.

Thanks you guys for your time and help.

Program Ver. : Xshell 5


Re: Telnet Script For Backup a CISCO

Thursday, March 3, 2016 8:30 AM - zoo

Here is a sample script for your job.

Sub Main

DIM servers, loopno
servers = Array("telnet://user1:passwd1@server1","telnet://user2:passwd2@server2", "telnet://user3:passwd3@server3")
serverNo = Ubound(servers)
loopno = 0
Do
While TRUE
if(loopno = serverNo +1 ) then
exit do
end if

xsh.Session.Open(servers(loopno))
xsh.Screen.Synchronous = false
xsh.Session.Sleep(1000)

'*** StartLog, StopLog ***
xsh.Session.LogFilePath = "d:\"&xsh.Session.RemoteAddress&"-%t.log"
xsh.Session.StartLog()

xsh.Screen.Send("ls"&vbcr)
xsh.Session.Sleep(1000)

xsh.Session.StopLog()
xsh.Session.Close()
xsh.Session.Sleep(1000)
loopno = loopno + 1

Wend
Loop

End Sub

The results are saved to log files.


Re: Telnet Script For Backup a CISCO

Monday, March 21, 2016 1:33 PM - NandDigital

thanks for the help.

but I cant see how insert the commands: ENABLE and then SHOW RUN in order to save the Reuters configuration.

Thanks again


Previous views: 205