Using EDP output in scripting
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
04-03-2014 01:01 PM
I would like to use sh edp ports all in script to indentify trunk ports.
Created script, loaded it and got error in that line. Is there some limitation to this?
"
...
set var CLI.OUT " "
show edp ports all
set var inputA $TCL(list ${CLI.OUT})
set var listA $TCL(split $inputA "\n")
set var countA $TCL(llength $listA)
....
"
BR
Davor
Created script, loaded it and got error in that line. Is there some limitation to this?
"
...
set var CLI.OUT " "
show edp ports all
set var inputA $TCL(list ${CLI.OUT})
set var listA $TCL(split $inputA "\n")
set var countA $TCL(llength $listA)
....
"
BR
Davor
18 REPLIES 18
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
04-04-2014 04:05 PM
Hey Davor
what are you trying to get out of the script?
the above looks like you are trying to get the MAC address or something
Thanks
P
what are you trying to get out of the script?
the above looks like you are trying to get the MAC address or something
Thanks
P
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
04-04-2014 01:07 PM
Hello,
I'm struggling with regxp that will read out output from “sh edp”. Currently using {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)}.
Could you help me defining how should regxp for reading out "sh edp ports all" output look like.
BR
Davor
I'm struggling with regxp that will read out output from “sh edp”. Currently using {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)}.
Could you help me defining how should regxp for reading out "sh edp ports all" output look like.
BR
Davor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
04-03-2014 01:57 PM
Hey Devor
I ran it again using my VM image in a virtual lab and here's the output running it as a script. I have the show var commands still in there to show what is in each var statement.
Summit-PC.1 # tftp 192.168.56.1 -v vr-m -g -r testscript.xsf
Downloading testscript.xsf on primary Node ... done!
Summit-PC.2 # load script testscript
{
Port Neighbor Neighbor-ID Remote Age Num
Port Vlans
=============================================================================
2 Summit-PC 00:00:08:00:27:57:b0:6a 1:2 41 1
=============================================================================
}
\{ {Port Neighbor Neighbor-ID Remote Age Num} { Port Vlans} ============================================================================= {2 Summit-PC 00:00:08:00:27:57:b0:6a 1:2 41 1 } ============================================================================= \}
7
Summit-PC.3 #
I ran it again using my VM image in a virtual lab and here's the output running it as a script. I have the show var commands still in there to show what is in each var statement.
Summit-PC.1 # tftp 192.168.56.1 -v vr-m -g -r testscript.xsf
Downloading testscript.xsf on primary Node ... done!
Summit-PC.2 # load script testscript
{
Port Neighbor Neighbor-ID Remote Age Num
Port Vlans
=============================================================================
2 Summit-PC 00:00:08:00:27:57:b0:6a 1:2 41 1
=============================================================================
}
\{ {Port Neighbor Neighbor-ID Remote Age Num} { Port Vlans} ============================================================================= {2 Summit-PC 00:00:08:00:27:57:b0:6a 1:2 41 1 } ============================================================================= \}
7
Summit-PC.3 #
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
04-03-2014 01:37 PM
Hey Devor I tried this and it worked for me. Here's the output of running the script I added show statement to show what the var are. Unfortunately I did this on my VM so I didn't have any data. Summit-PC.18 # enable cli scripting Summit-PC.19 # enable cli scripting Summit-PC.20 # set var CLI.OUT " " Summit-PC.21 # show edp ports all Port Neighbor Neighbor-ID Remote Age Num Port Vlans ============================================================================= Summit-PC.22 # set var inputA $TCL(list ${CLI.OUT}) Summit-PC.23 # set var listA $TCL(split $inputA "\n") Summit-PC.24 # set var countA $TCL(llength $listA) Summit-PC.25 # show var inputA { Port Neighbor Neighbor-ID Remote Age Num Port Vlans ============================================================================= } Summit-PC.26 # show var listA \{ {Port Neighbor Neighbor-ID Remote Age Num} { Port Vlans} ============================================================================= \} Summit-PC.27 # show var countA 5 Summit-PC.28 # Please let me know what your output is when you run this Thanks P
