View Single Post
  #3  
Old 07-24-2015, 08:54 AM
e2script e2script is offline
Registered User
 
Join Date: Sep 2014
Posts: 34
Hi Todd,

I have started working on a script now based on something that I found here.

My script looks like this:
Code:
#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

ClipText = crt.Clipboard.Text
Command = "sh port " & ClipText & " no | i " & ClipText

crt.Screen.Send Command & vbcr
crt.Screen.WaitForString vbcr
strResult = crt.Screen.ReadString(vbcrlf)
The information placed on the clipboard will be a port number so that when the script is run the command that will be sent is the following:
sh port <port number> no | i <port number>
Ex. sh port 1:71 no | i 1:71

The output the router will give me based on the command sh port 1:71 no | i 1:71 is 1:71 11001101_jdhasddVL_1111_11001101 E A 1000 FULL
The output the router will give me based on the command sh port 1:72 no | i 1:72 is 1:72 44551144_gnitsetVL_0001_44551144 E R
The output the router will give me based on the command sh port 1:73 no | i 1:73 is 1:73 98984477_dfegeerVL_8473_98984477 D R

Now the thing that I'm after is the 4digit numbers; 1111, 0001 and 8473.

The next command the script will then run is (not fixed in the script above because this is what I'm struggling with):
sh fdb VL_<4digit number found in the previous output from the router>
Ex. sh fdb VL_1111

How can I achieve this?

Last edited by jdev; 11-09-2017 at 11:36 AM.
Reply With Quote