Hello there,
@Gunner909 wrote:
Are they're any windows based solutions?
SecureCRT supports VB scripts.
Example below for telnetting into several boxes & collecting their configs using VBscript.
Boxes' hostnames are supplied from text file.
# $language = "VBScript"
# $interface = "1.0"
Const username = "aarseniev" ' Username to use for login
Const password = "password123" ' Password for corresponding user
Sub Main
Dim objFso, objShell, objTextStream, szLine
Dim vSessionsArray()
Dim nSessionCount
nSessionCount = 0
' Start of with a reasonable size for the array
ReDim vSessionsArray(300)
' Read in Sessions from a file that contains session names (one per line)
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Dim szMyDocs
' edit the following paths accordingly
' rootdir may be a place where you store all your lists (e.g. routers-site1, routers-site2 etc.)
rootdir = objShell.SpecialFolders("C:")
Set objTextStream = objFso.OpenTextFile(rootdir & "\MyDocuments\RouterList.txt", 1, false)
Dim host
Do While Not objTextStream.AtEndOfStream
host = Trim(objTextStream.ReadLine)
' Don't add empty lines/sessions
if host <> "" then
vSessionsArray(nSessionCount) = host
nSessionCount = nSessionCount + 1
end if
Loop
crt.Screen.Synchronous = True
crt.Screen.Send "date" & vbCr
crt.Screen.WaitForString "$ "
csuffix = "-config-csco"
jsuffix = "-config-jnpr"
For Each host in vSessionsArray
crt.Screen.Send "telnet " & host & vbCr
result = crt.screen.WaitForStrings("Username:", "login:", "Resolver Error")
' 1 for cisco, 2 for juniper, 3 for no-such-name
If result = 1 Then
crt.Screen.Send username & vbCr
crt.Screen.WaitForString "Password: "
crt.Screen.Send password & vbCr
crt.Screen.WaitForString "#"
call EnableCommandIOS ("term len 0", host)
crt.Screen.Send "exit" & vbCr
crt.Screen.WaitForString "$ "
End if
If result = 2 Then
crt.Screen.Send username & vbCr
crt.Screen.WaitForString "Password:"
crt.Screen.Send password & vbCr
crt.Screen.WaitForString ">"
call CommandJunos ("set cli screen-length 0", host)
crt.Session.LogFileName = "c:\MyDocuments\ScriptOutput\" & host & jsuffix
crt.Session.Log(TRUE)
call CommandJunos ("show configuration", host)
crt.Session.Log(FALSE)
crt.Screen.Send "exit" & vbCr
crt.Screen.WaitForString "$ "
End if
If result = 3 then
End if
Next
crt.Screen.Synchronous = False
End Sub
HTH
Thx
Alex