Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-21-2017, 11:01 AM
retsam111 retsam111 is offline
Registered User
 
Join Date: Mar 2017
Posts: 2
Do show command in Cisco cli

I'm trying to check for a specific configuration for each interface.
After I log in with telnet, this is my script
' When telnet session is opened successfully do the following

' Push the cli commands to the device
crt.Screen.Synchronous = True
strCommand = "show interface status" & vbCr
crt.Screen.Send strCommand
crt.Screen.WaitForString strCommand
screenOut = crt.Screen.ReadString("#")

tempArray = Split(screenOut, vbcr)
For i = 2 to Ubound(tempArray)-1
interfaces = Split(tempArray(i))
strCommand = "show run interface "& interfaces(0) & vbCr
crt.Screen.Send strCommand
crt.Screen.WaitForString strCommand
screenOut = crt.Screen.ReadString("#")
objStream.WriteLine screenOut
Next

However, strCommand = "show run interface "& interfaces(0) & vbCr doesn't work in the Cisco cli. It shows up as two commands, but it's clearly one line.

Output from Cisco cli
uct-m60mike-desk-1#show interface status

Port Name Status Vlan Duplex Speed Type
Gi0/1 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/2 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/3 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/4 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/5 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/6 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/7 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/8 notconnect 2002 auto auto 10/100/1000BaseTX
Gi0/9 UCT-m50-l2-1 connected trunk a-full a-1000 10/100/1000BaseTX
Gi0/10 disabled 1 auto auto Not Present
uct-m60mike-desk-1#show run interface
% Incomplete command.

uct-m60mike-desk-1#Gi0/1
^
% Invalid input detected at '^' marker.

uct-m60mike-desk-1#
Reply With Quote
 

Tags
cisco , show run


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 02:18 AM.