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 01-24-2012, 06:19 PM
climbingmike climbingmike is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Calling on 3 text files for changing interface decscriptions

Hello All

I have a need to change about 400 interface descriptions on Cisco 3750 switches. I have a list of device names, interfaces and the correct descriptions. I want a script that will log into the first device on the list, then the interface and then the description. Is this posible?

I already have a script that I use to log onto multiple devices and add config, but I dont fully understand it, just was I need to change each time to make it work. So I dont know how to modify it in this case.

Here is was I use currently;

Sub main

Dim fso, fil, user, passwd, line, params
Set fso = CreateObject("Scripting.FileSystemObject")
Set fil = fso.OpenTextFile("C:\List.txt", ForReading, 1)

Do While fil.AtEndofStream <> True
line = fil.Readline
' params = Split(line, ",")
crt.Session.Log False
crt.Screen.Synchronous = True

crt.screen.send "ssh" & " " & line & vbcr



Dim nResult
nResult = crt.Screen.WaitForString("?", 10)
if nResult = 0 Then
' msgbox params(0) & " " & "Not Found"
crt.screen.send chr(3)

' metname1 = params(0)
' port1 = params(1)

' strmetname1 = strmetname1 & metname1 & "," & params(1) & vbcrLf

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("C:\NoAccess.txt", ForWriting)

objFile.Write
objFile.Close

Else


crt.Screen.Send "yes" & chr(13)
crt.Screen.WaitForString "password:"
crt.Screen.Send "PASSWORD" & chr(13)
crt.Screen.WaitForString "A:"
More config.......


end if
crt.screen.send " logout" & vbcr
crt.Screen.Synchronous = False

crt.screen.waitforstring "mike.adams@adminjumphost1:~$"
loop
end Sub

Any help would be much appreciated.

Many thanks
Mike
Reply With Quote
  #2  
Old 01-25-2012, 10:21 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,019
Hello Mike,

Could you clarify what you mean in the statements below?

Quote:
I have a need to change about 400 interface descriptions on Cisco 3750 switches. I have a list of device names, interfaces and the correct descriptions. I want a script that will log into the first device on the list, then the interface and then the description.
In the first sentence you said you need to change the interface descriptions. What are the manual steps you would perform to accomplish that task?

The scripting manual that is available here on our website is the best resource for VBScript tips in regards to automating tasks in SecureCRT.
__________________
Thanks,
--Brenda

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