<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Using EDP output in scripting in Scripting</title>
    <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19884#M152</link>
    <description>Per the lawyers:&lt;BR /&gt;
&lt;BR /&gt;
Any scripts that are written and posted on the Hub are provided “AS IS” with no warranty or representation as to its use.  Any use should be carefully considered and be validated by the user. These scripts, regardless of who writes them, assume that the user accepts all of the risk and responsibility, and are not provided pursuant to any authorized services or professional services entitlement or obligation by Extreme Networks, its subsidiaries, agents or licensors.  In no event shall the poster nor Extreme Networks be responsible for the functionality of the script nor are we responsible for any outages or network issues caused by use or integration of the script, including any degradation of functionality of Extreme products or technology. It is strongly recommended that any use of scripts or other technical information posted on this site must be validated before use in any production network by the user of the script.&lt;BR /&gt;
&lt;BR /&gt;
With that said:&lt;BR /&gt;
#@MetaDataStart#@DetailDescriptionStart&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#@DetailDescriptionEnd&lt;BR /&gt;
enable cli scripting&lt;BR /&gt;
disable cli-config-logging&lt;BR /&gt;
disable clipaging&lt;BR /&gt;
create log entry "**********Starting CLI Script**********"&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#@ScriptDescription "Short Script Description"&lt;BR /&gt;
#&lt;B&gt;@VariableFieldLabel&lt;/B&gt; "When this script encounters errors, do you wish to abort or ignore (abort or ignore)"&lt;BR /&gt;
set var ynCliModeAbortEnabled abort&lt;BR /&gt;
#&lt;B&gt;@SeparatorLine&lt;/B&gt;&lt;BR /&gt;
# Begin custom variable definitations&lt;BR /&gt;
# set var addOrDelete $CLI.ARGV1&lt;BR /&gt;
  set var addOrDelete 1&lt;BR /&gt;
# End of custom variable definitations&lt;BR /&gt;
#@MetaDataEnd&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#  CONFIGURATION DETAIL&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# ERROR HANDLING&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
if (!$match($ynCliModeAbortEnabled,ignore)) then&lt;BR /&gt;
 create log entry "CLI mode set for Ignore on error"&lt;BR /&gt;
 configure cli mode scripting ignore-error&lt;BR /&gt;
else&lt;BR /&gt;
 create log entry "CLI mode set for abort on error"&lt;BR /&gt;
 configure cli mode scripting abort-on-error&lt;BR /&gt;
endif&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# Start of CLI Script (Enter the custom script code below)&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
set var CLI.OUT " "&lt;BR /&gt;
show edp ports all&lt;BR /&gt;
set var inputA $TCL(list ${CLI.OUT})&lt;BR /&gt;
set var listA $TCL(split $inputA "\n")&lt;BR /&gt;
set var countA $TCL(llength $listA)&lt;BR /&gt;
set var icountBack ($countA - 0)&lt;BR /&gt;
set var icount 0&lt;BR /&gt;
# &lt;BR /&gt;
#&lt;BR /&gt;
while ($icount &amp;lt; $icountBack) do&lt;BR /&gt;
 set var findIt $TCL(lindex $listA $icount)&lt;BR /&gt;
 set var findTrunkPorts $TCL(regexp {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)} $findIt)&lt;BR /&gt;
 set var findEnd $TCL(regexp {configure\sqosprofile} $findIt)&lt;BR /&gt;
# &lt;BR /&gt;
if ($findTrunkPorts == 1) then&lt;BR /&gt;
  set var vlanNameOnly $TCL(regexp -inline {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)} $findIt)&lt;BR /&gt;
  set var value0 $TCL(lindex $vlanNameOnly 0)&lt;BR /&gt;
  set var value1 $TCL(lindex $vlanNameOnly 1)&lt;BR /&gt;
  set var value3 $TCL(lindex $vlanNameOnly 3)&lt;BR /&gt;
  if ($addOrDelete == 1) then&lt;BR /&gt;
    configure ports $(value0) display-string Trunk_$(value1)_$(value3)&lt;BR /&gt;
  endif&lt;BR /&gt;
  if ($addOrDelete == 0) then&lt;BR /&gt;
    create log entry "NO TURUNK PORTS"&lt;BR /&gt;
  endif&lt;BR /&gt;
endif&lt;BR /&gt;
#&lt;BR /&gt;
if ($findEnd == 1) then&lt;BR /&gt;
  set var icount ($icountBack)&lt;BR /&gt;
endif&lt;BR /&gt;
  set var icount ($icount + 1)&lt;BR /&gt;
endwhile&lt;BR /&gt;
#&lt;BR /&gt;
if ($VAREXISTS(CLI.OUT)) then &lt;BR /&gt;
 delete var CLI.OUT&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(inputA)) then &lt;BR /&gt;
 delete var inputA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(listA)) then &lt;BR /&gt;
 delete var listA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(countA)) then &lt;BR /&gt;
 delete var countA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(icount)) then &lt;BR /&gt;
 delete var icount&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findEnd)) then &lt;BR /&gt;
 delete var findEnd&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findIt)) then &lt;BR /&gt;
 delete var findIt&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(icountBack)) then &lt;BR /&gt;
 delete var icountBack&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value0)) then &lt;BR /&gt;
 delete var value0&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value1)) then &lt;BR /&gt;
 delete var value1&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value3)) then &lt;BR /&gt;
 delete var value3&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(vlanNameOnly)) then &lt;BR /&gt;
 delete var vlanNameOnly&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findTrunkPorts)) then &lt;BR /&gt;
 delete var findTrunkPorts&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(printCommand)) then &lt;BR /&gt;
 delete var printCommand&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(addOrDelete)) then &lt;BR /&gt;
 delete var addOrDelete&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(ynCliModeAbortEnabled)) then &lt;BR /&gt;
 delete var ynCliModeAbortEnabled&lt;BR /&gt;
endif&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# End of CLI Script&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
create log entry "**********Finshed running CLI Script**********"&lt;BR /&gt;
enable clipaging&lt;BR /&gt;
disable cli-config-logging&lt;BR /&gt;
disable cli scripting&lt;BR /&gt;
&lt;BR /&gt;</description>
    <pubDate>Mon, 14 Apr 2014 19:09:00 GMT</pubDate>
    <dc:creator>Davor</dc:creator>
    <dc:date>2014-04-14T19:09:00Z</dc:date>
    <item>
      <title>Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19870#M138</link>
      <description>I would like to use sh edp ports all in script to indentify trunk ports. &lt;BR /&gt;
Created script, loaded it and got error in that line. Is there some limitation to this?&lt;BR /&gt;
&lt;BR /&gt;
"&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
set var CLI.OUT " "&lt;BR /&gt;
show edp ports all&lt;BR /&gt;
set var inputA $TCL(list ${CLI.OUT})&lt;BR /&gt;
set var listA $TCL(split $inputA "\n")&lt;BR /&gt;
set var countA $TCL(llength $listA)&lt;BR /&gt;
&lt;BR /&gt;
....&lt;BR /&gt;
&lt;BR /&gt;
"&lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
Davor</description>
      <pubDate>Thu, 03 Apr 2014 20:01:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19870#M138</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-03T20:01:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19871#M139</link>
      <description>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</description>
      <pubDate>Thu, 03 Apr 2014 20:37:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19871#M139</guid>
      <dc:creator>Paul_Russo</dc:creator>
      <dc:date>2014-04-03T20:37:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19872#M140</link>
      <description>Hey Devor&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Summit-PC.1 # tftp 192.168.56.1 -v vr-m -g -r testscript.xsf&lt;BR /&gt;
Downloading testscript.xsf on primary Node ... done!&lt;BR /&gt;
Summit-PC.2 # load script testscript&lt;BR /&gt;
{&lt;BR /&gt;
Port   Neighbor                       Neighbor-ID         Remote  Age    Num&lt;BR /&gt;
                                                           Port         Vlans&lt;BR /&gt;
=============================================================================&lt;BR /&gt;
2      Summit-PC                 00:00:08:00:27:57:b0:6a   1:2    41     1&lt;BR /&gt;
=============================================================================&lt;BR /&gt;
}&lt;BR /&gt;
\{ {Port   Neighbor                       Neighbor-ID         Remote  Age    Num} {                                                           Port         Vlans} ============================================================================= {2      Summit-PC                 00:00:08:00:27:57:b0:6a   1:2    41     1    } ============================================================================= \}&lt;BR /&gt;
7&lt;BR /&gt;
Summit-PC.3 #&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Apr 2014 20:57:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19872#M140</guid>
      <dc:creator>Paul_Russo</dc:creator>
      <dc:date>2014-04-03T20:57:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19873#M141</link>
      <description>Hello,  &lt;BR /&gt;
  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+)}.&lt;BR /&gt;
  Could you help me defining how should regxp for  reading out "sh edp ports all" output look like.&lt;BR /&gt;
  &lt;BR /&gt;
  BR&lt;BR /&gt;
  Davor&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Apr 2014 20:07:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19873#M141</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-04T20:07:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19874#M142</link>
      <description>Hey Davor&lt;BR /&gt;
&lt;BR /&gt;
what are you trying to get out of the script?  &lt;BR /&gt;
&lt;BR /&gt;
the above looks like you are trying to get the MAC address or something&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
P&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Apr 2014 23:05:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19874#M142</guid>
      <dc:creator>Paul_Russo</dc:creator>
      <dc:date>2014-04-04T23:05:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19875#M143</link>
      <description>I would like to use and identify all fields and use them later on to mark my trunk ports using port description. Maybe even to disable edp on all ports except one that has edp enabled device connected. As template, i'm using Mr. Padilla's ELRPOn.xsf script. At final stage i would like to identify my trunk ports on all of my edge switches and enable dhcp snooping/trusted server. Configuration on dhcp snooping has differences on trunk and edge ports.&lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
Davor</description>
      <pubDate>Tue, 08 Apr 2014 18:39:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19875#M143</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-08T18:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19876#M144</link>
      <description>So, to be clear, you want a script to check each port to see if an EDP neighbor is found, and if not, to "disable EDP" on that port. You then want a script to discover which ports are participating in sharing, and then "configure trusted-ports {ports} trust-for dhcp-server" on the master port. Presumably, you also want to "enable ip-security dhcp-snooping vlan..." on the ports not sharing nor having any EDP neighbor, correct? The last bit will require finding out the VLANs on those ports to enable dhcp-snooping on them. Is this an accurate summary? Will you be loading this script on each edge-switch only once?&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Apr 2014 21:07:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19876#M144</guid>
      <dc:creator>Matthew_Helm1</dc:creator>
      <dc:date>2014-04-08T21:07:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19877#M145</link>
      <description>That is correct. Also would like to add description to each trunk port copying from EDP peer name. Tried modifying ELRPON.xsf script but it is not working as it should. I can send you what i made so far. &lt;BR /&gt;
&lt;BR /&gt;
Thing that dhcp-snoping script would be very valuable &lt;BR /&gt;
&lt;BR /&gt;
Thanks for help,&lt;BR /&gt;
&lt;BR /&gt;
Davor</description>
      <pubDate>Tue, 08 Apr 2014 21:35:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19877#M145</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-08T21:35:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19878#M146</link>
      <description>Ok. I have a grab-bag of scripts that do something close to what you need. Let me crank something out and get it back to you.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Apr 2014 21:47:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19878#M146</guid>
      <dc:creator>Matthew_Helm1</dc:creator>
      <dc:date>2014-04-08T21:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19879#M147</link>
      <description>Great thanks Matt&lt;BR /&gt;
&lt;BR /&gt;
Disclosure statement:&lt;BR /&gt;
Davor any scripts that are written and posted on the Hub are best effort and must be validated by the user.  These scripts, regardless of who writes them, assume that the user accepts all of the risk and responsibility. &lt;BR /&gt;
&lt;BR /&gt;
If Matt posts some of his scripts know that neither he nor Extreme Networks are responsible for the ongoing operation of the script nor are we responsible for any outages or network issues caused by the script.  Use any script posted on this site as test scripts that must be validated before use in any production network by the user of the script.&lt;BR /&gt;
&lt;BR /&gt;
I just want to make sure that everyone realizes these are not done as part of a true Professional Services scope.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
P&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Apr 2014 23:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19879#M147</guid>
      <dc:creator>Paul_Russo</dc:creator>
      <dc:date>2014-04-08T23:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19880#M148</link>
      <description>Sorry to be a pain. I have the script, but I'm waiting for legal boilerplate to post it. I apologize for the delay, Davor.&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Apr 2014 23:47:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19880#M148</guid>
      <dc:creator>Matthew_Helm1</dc:creator>
      <dc:date>2014-04-08T23:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19881#M149</link>
      <description>Davor,&lt;BR /&gt;
&lt;BR /&gt;
Per the lawyers:&lt;BR /&gt;
&lt;BR /&gt;
Any scripts that are written and posted on the Hub are provided “AS IS” with no warranty or representation as to its use.  Any use should be carefully considered and be validated by the user. These scripts, regardless of who writes them, assume that the user accepts all of the risk and responsibility, and are not provided pursuant to any authorized services or professional services entitlement or obligation by Extreme Networks, its subsidiaries, agents or licensors.  In no event shall the poster nor Extreme Networks be responsible for the functionality of the script nor are we responsible for any outages or network issues caused by use or integration of the script, including any degradation of functionality of Extreme products or technology. It is strongly recommended that any use of scripts or other technical information posted on this site must be validated before use in any production network by the user of the script.&lt;BR /&gt;
&lt;BR /&gt;
With that said:&lt;BR /&gt;
&lt;BR /&gt;
disable clip&lt;BR /&gt;
set var cli.out 0&lt;BR /&gt;
show port no&lt;BR /&gt;
set var s $TCL(split ${cli.out} "\n")&lt;BR /&gt;
set var i 4&lt;BR /&gt;
set var e $TCL(lsearch $s *D-Disabled*)&lt;BR /&gt;
set var e ($e - 1)&lt;BR /&gt;
while ($i &amp;lt; $e) do&lt;BR /&gt;
   set var l $TCL(lindex $s $i)&lt;BR /&gt;
   set var p $TCL(lindex $l 0)&lt;BR /&gt;
   set var cli.out 0&lt;BR /&gt;
   show edp port $p&lt;BR /&gt;
   set var se $TCL(split ${cli.out} "\n")&lt;BR /&gt;
   set var le $TCL(llength $se)&lt;BR /&gt;
   if ($le &amp;lt; 7) then&lt;BR /&gt;
      disable edp port $p&lt;BR /&gt;
   endif&lt;BR /&gt;
   set var cli.out 0&lt;BR /&gt;
   show port $p info detail&lt;BR /&gt;
   set var sp $TCL(split ${cli.out} "\n")&lt;BR /&gt;
   set var l $TCL(lsearch $sp *Trunking:*)&lt;BR /&gt;
   set var ln $TCL(lindex $sp $l)&lt;BR /&gt;
   set var t $TCL(regexp {Master} $ln)&lt;BR /&gt;
   if ($t == 1) then&lt;BR /&gt;
      config trusted-port $p trust-for dhcp-server&lt;BR /&gt;
   else&lt;BR /&gt;
      set var t $TCL(regexp {Cfg} $l)&lt;BR /&gt;
      if ($t != 1) then&lt;BR /&gt;
         set var iv $TCL(lsearch $sp *VLAN\ cfg:*)&lt;BR /&gt;
         set var iv ($iv + 1)&lt;BR /&gt;
         set var ev $TCL(lsearch $sp *STP\ cfg:*)&lt;BR /&gt;
         set var ev ($ev - 1)&lt;BR /&gt;
         while ($iv &amp;lt;$ev) do&lt;BR /&gt;
            set var l $TCL(lindex $sp $iv)&lt;BR /&gt;
            set var v $TCL(lindex $l 1)&lt;BR /&gt;
            set var v $TCL(string map {, ""} $v)&lt;BR /&gt;
            enable ip-security dhcp-snooping vlan $v port $p violation-action drop-packet block-mac permane&lt;BR /&gt;
            set var iv ($iv + 2)&lt;BR /&gt;
         endwhile&lt;BR /&gt;
      endif&lt;BR /&gt;
   endif&lt;BR /&gt;
   set var i ($i + 1)&lt;BR /&gt;
endwhile&lt;BR /&gt;
delete var cli.out&lt;BR /&gt;
delete var s&lt;BR /&gt;
delete var i&lt;BR /&gt;
delete var e&lt;BR /&gt;
delete var l&lt;BR /&gt;
delete var p&lt;BR /&gt;
delete var se&lt;BR /&gt;
delete var le&lt;BR /&gt;
delete var sp&lt;BR /&gt;
delete var ln&lt;BR /&gt;
delete var t&lt;BR /&gt;
delete var iv&lt;BR /&gt;
delete var ev&lt;BR /&gt;
delete var v&lt;BR /&gt;
disable clip&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Apr 2014 04:13:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19881#M149</guid>
      <dc:creator>Matthew_Helm1</dc:creator>
      <dc:date>2014-04-09T04:13:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19882#M150</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for script you posted. I have tested it and found it has issues. Currently working on fixing your script and adding few more lines.&lt;BR /&gt;
&lt;BR /&gt;
You did not added something like:&lt;BR /&gt;
enable ip-security dhcp-snooping vlan xxx  port xx violation-action none&lt;BR /&gt;
, for trunk ports.&lt;BR /&gt;
&lt;BR /&gt;
Will get back to you when solve issues i'm having.&lt;BR /&gt;
&lt;BR /&gt;
I can post my semi-working script,  based on Mr. Padilla's ELRPON script. &lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
Davor</description>
      <pubDate>Mon, 14 Apr 2014 19:05:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19882#M150</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-14T19:05:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19883#M151</link>
      <description>Davon,&lt;BR /&gt;
&lt;BR /&gt;
I forgot that that was necessary on the trunk/DHCP server ports.&lt;BR /&gt;
&lt;BR /&gt;
You should simply have to add the following after the "config trusted-port $p trust-for dhcp-server" line:&lt;BR /&gt;
&lt;BR /&gt;
      set var iv $TCL(lsearch $sp *VLAN\ cfg:*)&lt;BR /&gt;
      set var iv ($iv + 1)&lt;BR /&gt;
      set var ev $TCL(lsearch $sp *STP\ cfg:*)&lt;BR /&gt;
      set var ev ($ev - 1)&lt;BR /&gt;
      while ($iv &amp;lt; $ev) do&lt;BR /&gt;
         set var l $TCL(lindex $sp $iv)&lt;BR /&gt;
         set var v $TCL(lindex $l 1)&lt;BR /&gt;
         set var v $TCL(string map {, ""} $v)&lt;BR /&gt;
         enable ip-security dhcp-snooping vlan $v port $p violation-action none&lt;BR /&gt;
         set var iv ($iv + 2)&lt;BR /&gt;
      endwhile&lt;BR /&gt;
&lt;BR /&gt;
I haven't tested it, but it should work. Let me know if there are problems with it.&lt;BR /&gt;
&lt;BR /&gt;
Are there other issues with the script?&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Apr 2014 19:05:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19883#M151</guid>
      <dc:creator>Matthew_Helm1</dc:creator>
      <dc:date>2014-04-14T19:05:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19884#M152</link>
      <description>Per the lawyers:&lt;BR /&gt;
&lt;BR /&gt;
Any scripts that are written and posted on the Hub are provided “AS IS” with no warranty or representation as to its use.  Any use should be carefully considered and be validated by the user. These scripts, regardless of who writes them, assume that the user accepts all of the risk and responsibility, and are not provided pursuant to any authorized services or professional services entitlement or obligation by Extreme Networks, its subsidiaries, agents or licensors.  In no event shall the poster nor Extreme Networks be responsible for the functionality of the script nor are we responsible for any outages or network issues caused by use or integration of the script, including any degradation of functionality of Extreme products or technology. It is strongly recommended that any use of scripts or other technical information posted on this site must be validated before use in any production network by the user of the script.&lt;BR /&gt;
&lt;BR /&gt;
With that said:&lt;BR /&gt;
#@MetaDataStart#@DetailDescriptionStart&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#@DetailDescriptionEnd&lt;BR /&gt;
enable cli scripting&lt;BR /&gt;
disable cli-config-logging&lt;BR /&gt;
disable clipaging&lt;BR /&gt;
create log entry "**********Starting CLI Script**********"&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#@ScriptDescription "Short Script Description"&lt;BR /&gt;
#&lt;B&gt;@VariableFieldLabel&lt;/B&gt; "When this script encounters errors, do you wish to abort or ignore (abort or ignore)"&lt;BR /&gt;
set var ynCliModeAbortEnabled abort&lt;BR /&gt;
#&lt;B&gt;@SeparatorLine&lt;/B&gt;&lt;BR /&gt;
# Begin custom variable definitations&lt;BR /&gt;
# set var addOrDelete $CLI.ARGV1&lt;BR /&gt;
  set var addOrDelete 1&lt;BR /&gt;
# End of custom variable definitations&lt;BR /&gt;
#@MetaDataEnd&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
#  CONFIGURATION DETAIL&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# ERROR HANDLING&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
if (!$match($ynCliModeAbortEnabled,ignore)) then&lt;BR /&gt;
 create log entry "CLI mode set for Ignore on error"&lt;BR /&gt;
 configure cli mode scripting ignore-error&lt;BR /&gt;
else&lt;BR /&gt;
 create log entry "CLI mode set for abort on error"&lt;BR /&gt;
 configure cli mode scripting abort-on-error&lt;BR /&gt;
endif&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# Start of CLI Script (Enter the custom script code below)&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
set var CLI.OUT " "&lt;BR /&gt;
show edp ports all&lt;BR /&gt;
set var inputA $TCL(list ${CLI.OUT})&lt;BR /&gt;
set var listA $TCL(split $inputA "\n")&lt;BR /&gt;
set var countA $TCL(llength $listA)&lt;BR /&gt;
set var icountBack ($countA - 0)&lt;BR /&gt;
set var icount 0&lt;BR /&gt;
# &lt;BR /&gt;
#&lt;BR /&gt;
while ($icount &amp;lt; $icountBack) do&lt;BR /&gt;
 set var findIt $TCL(lindex $listA $icount)&lt;BR /&gt;
 set var findTrunkPorts $TCL(regexp {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)} $findIt)&lt;BR /&gt;
 set var findEnd $TCL(regexp {configure\sqosprofile} $findIt)&lt;BR /&gt;
# &lt;BR /&gt;
if ($findTrunkPorts == 1) then&lt;BR /&gt;
  set var vlanNameOnly $TCL(regexp -inline {(?![0-9:]+\s+)([A-Za-z0-9._+-]+\s+)([0-9:]+\s+)([0-9:]+\s+)([0-9]+\s+)([0-9]+\s+)} $findIt)&lt;BR /&gt;
  set var value0 $TCL(lindex $vlanNameOnly 0)&lt;BR /&gt;
  set var value1 $TCL(lindex $vlanNameOnly 1)&lt;BR /&gt;
  set var value3 $TCL(lindex $vlanNameOnly 3)&lt;BR /&gt;
  if ($addOrDelete == 1) then&lt;BR /&gt;
    configure ports $(value0) display-string Trunk_$(value1)_$(value3)&lt;BR /&gt;
  endif&lt;BR /&gt;
  if ($addOrDelete == 0) then&lt;BR /&gt;
    create log entry "NO TURUNK PORTS"&lt;BR /&gt;
  endif&lt;BR /&gt;
endif&lt;BR /&gt;
#&lt;BR /&gt;
if ($findEnd == 1) then&lt;BR /&gt;
  set var icount ($icountBack)&lt;BR /&gt;
endif&lt;BR /&gt;
  set var icount ($icount + 1)&lt;BR /&gt;
endwhile&lt;BR /&gt;
#&lt;BR /&gt;
if ($VAREXISTS(CLI.OUT)) then &lt;BR /&gt;
 delete var CLI.OUT&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(inputA)) then &lt;BR /&gt;
 delete var inputA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(listA)) then &lt;BR /&gt;
 delete var listA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(countA)) then &lt;BR /&gt;
 delete var countA&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(icount)) then &lt;BR /&gt;
 delete var icount&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findEnd)) then &lt;BR /&gt;
 delete var findEnd&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findIt)) then &lt;BR /&gt;
 delete var findIt&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(icountBack)) then &lt;BR /&gt;
 delete var icountBack&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value0)) then &lt;BR /&gt;
 delete var value0&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value1)) then &lt;BR /&gt;
 delete var value1&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(value3)) then &lt;BR /&gt;
 delete var value3&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(vlanNameOnly)) then &lt;BR /&gt;
 delete var vlanNameOnly&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(findTrunkPorts)) then &lt;BR /&gt;
 delete var findTrunkPorts&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(printCommand)) then &lt;BR /&gt;
 delete var printCommand&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(addOrDelete)) then &lt;BR /&gt;
 delete var addOrDelete&lt;BR /&gt;
endif&lt;BR /&gt;
if ($VAREXISTS(ynCliModeAbortEnabled)) then &lt;BR /&gt;
 delete var ynCliModeAbortEnabled&lt;BR /&gt;
endif&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
# End of CLI Script&lt;BR /&gt;
###############################################################################&lt;BR /&gt;
create log entry "**********Finshed running CLI Script**********"&lt;BR /&gt;
enable clipaging&lt;BR /&gt;
disable cli-config-logging&lt;BR /&gt;
disable cli scripting&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Apr 2014 19:09:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19884#M152</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-14T19:09:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19885#M153</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I have tested script but it does not work. &lt;BR /&gt;
&lt;BR /&gt;
I nested piece of scrip in right position?&lt;BR /&gt;
&lt;BR /&gt;
***************&lt;BR /&gt;
&lt;BR /&gt;
disable clipset var cli.out 0&lt;BR /&gt;
show port no&lt;BR /&gt;
set var s $TCL(split ${cli.out} "\n")&lt;BR /&gt;
set var i 4&lt;BR /&gt;
set var e $TCL(lsearch $s *D-Disabled*)&lt;BR /&gt;
set var e ($e - 1)&lt;BR /&gt;
while ($i &amp;lt; $e) do&lt;BR /&gt;
   set var l $TCL(lindex $s $i)&lt;BR /&gt;
   set var p $TCL(lindex $l 0)&lt;BR /&gt;
   set var cli.out 0&lt;BR /&gt;
   show edp port $p&lt;BR /&gt;
   set var se $TCL(split ${cli.out} "\n")&lt;BR /&gt;
   set var le $TCL(llength $se)&lt;BR /&gt;
   if ($le &amp;lt; 7) then&lt;BR /&gt;
      disable edp port $p&lt;BR /&gt;
   endif&lt;BR /&gt;
   set var cli.out 0&lt;BR /&gt;
   show port $p info detail&lt;BR /&gt;
   set var sp $TCL(split ${cli.out} "\n")&lt;BR /&gt;
   set var l $TCL(lsearch $sp *Trunking:*)&lt;BR /&gt;
   set var ln $TCL(lindex $sp $l)&lt;BR /&gt;
   set var t $TCL(regexp {Master} $ln)&lt;BR /&gt;
   if ($t == 1) then&lt;BR /&gt;
      config trusted-port $p trust-for dhcp-server&lt;BR /&gt;
   set var iv $TCL(lsearch $sp *VLAN\ cfg:*)&lt;BR /&gt;
      set var iv ($iv + 1)&lt;BR /&gt;
      set var ev $TCL(lsearch $sp *STP\ cfg:*)&lt;BR /&gt;
      set var ev ($ev - 1)&lt;BR /&gt;
      while ($iv &amp;lt; $ev) do&lt;BR /&gt;
         set var l $TCL(lindex $sp $iv)&lt;BR /&gt;
         set var v $TCL(lindex $l 1)&lt;BR /&gt;
         set var v $TCL(string map {, ""} $v)&lt;BR /&gt;
         enable ip-security dhcp-snooping vlan $v port $p violation-action none&lt;BR /&gt;
         set var iv ($iv + 2)&lt;BR /&gt;
      endwhile&lt;BR /&gt;
   else&lt;BR /&gt;
      set var t $TCL(regexp {Cfg} $l)&lt;BR /&gt;
      if ($t != 1) then&lt;BR /&gt;
         set var iv $TCL(lsearch $sp *VLAN\ cfg:*)&lt;BR /&gt;
         set var iv ($iv + 1)&lt;BR /&gt;
         set var ev $TCL(lsearch $sp *STP\ cfg:*)&lt;BR /&gt;
         set var ev ($ev - 1)&lt;BR /&gt;
         while ($iv &amp;lt;$ev) do&lt;BR /&gt;
            set var l $TCL(lindex $sp $iv)&lt;BR /&gt;
            set var v $TCL(lindex $l 1)&lt;BR /&gt;
            set var v $TCL(string map {, ""} $v)&lt;BR /&gt;
            enable ip-security dhcp-snooping vlan $v port $p violation-action drop-packet block-mac permane&lt;BR /&gt;
            set var iv ($iv + 2)&lt;BR /&gt;
         endwhile&lt;BR /&gt;
      endif&lt;BR /&gt;
   endif&lt;BR /&gt;
   set var i ($i + 1)&lt;BR /&gt;
endwhile&lt;BR /&gt;
delete var cli.out&lt;BR /&gt;
delete var s&lt;BR /&gt;
delete var i&lt;BR /&gt;
delete var e&lt;BR /&gt;
delete var l&lt;BR /&gt;
delete var p&lt;BR /&gt;
delete var se&lt;BR /&gt;
delete var le&lt;BR /&gt;
delete var sp&lt;BR /&gt;
delete var ln&lt;BR /&gt;
delete var t&lt;BR /&gt;
delete var iv&lt;BR /&gt;
delete var ev&lt;BR /&gt;
delete var v&lt;BR /&gt;
disable clip&lt;BR /&gt;
&lt;BR /&gt;
****************&lt;BR /&gt;
&lt;BR /&gt;
I have on my LINK / TRUNK ports one untag network (Vlan Default) that i use as my control/admin vlan for accesing switches. Script is adding "drop-packet block-mac permane" to that vlan and it should not.&lt;BR /&gt;
Script should detect Trunk ports and all vlan that are defined on that port should have "enable ip-security dhcp-snooping vlaxxx port xx violation-action none". Also on that port i would like to have port description "Trunk-(remote sw name)", so i can use that later on for grouping in RIdgeline"&lt;BR /&gt;
&lt;BR /&gt;
BR&lt;BR /&gt;
Davor&lt;BR /&gt;
&lt;BR /&gt;
PS &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help..&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Apr 2014 14:40:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19885#M153</guid>
      <dc:creator>Davor</dc:creator>
      <dc:date>2014-04-18T14:40:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19886#M154</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've been reading all the posts and I'm still confused.&lt;BR /&gt;
&lt;BR /&gt;
What is the simplest way to basically get the output of the show edp&lt;BR /&gt;
&lt;BR /&gt;
My case is :&lt;BR /&gt;
- Check if there is a switch connected on that port&lt;BR /&gt;
- if there is, execute the if part, otherwise execute the else part.&lt;BR /&gt;
&lt;BR /&gt;
If you can help me quickly, that'd be great&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Thu, 30 Jun 2016 13:27:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19886#M154</guid>
      <dc:creator>Gaspard_W</dc:creator>
      <dc:date>2016-06-30T13:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19887#M155</link>
      <description>This is simply to check if any edp neighbor exists.&lt;BR /&gt;
&lt;BR /&gt;
set var cli.out 0&lt;BR /&gt;
show edp ports all | in "^[0-9]+"&lt;BR /&gt;
set var t $tcl(split ${cli.out} "\n")&lt;BR /&gt;
set var n $tcl(llength $t)&lt;BR /&gt;
&lt;BR /&gt;
if ($n &amp;gt; 1) then&lt;BR /&gt;
   .....&lt;BR /&gt;
else&lt;BR /&gt;
   .....&lt;BR /&gt;
endif&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jun 2016 20:38:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19887#M155</guid>
      <dc:creator>Kevin_Kim</dc:creator>
      <dc:date>2016-06-30T20:38:00Z</dc:date>
    </item>
    <item>
      <title>RE: Using EDP output in scripting</title>
      <link>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19888#M156</link>
      <description>With your script and after some investigation, I did&lt;BR /&gt;
&lt;BR /&gt;
enable cli scripting&lt;BR /&gt;
set var CLI.OUT 0&lt;BR /&gt;
set var PORT 22                                   &lt;I&gt;&lt;U&gt;( that's for testing)&lt;/U&gt;&lt;/I&gt;&lt;BR /&gt;
show edp ports $PORT | i $PORT&lt;BR /&gt;
set var gigi  $TCL(lrange ${CLI.OUT} 7 7)&lt;BR /&gt;
show edp ports $PORT | i $PORT&lt;BR /&gt;
set var gigi2  $TCL(lrange ${CLI.OUT} 0 0)&lt;BR /&gt;
&lt;BR /&gt;
if ($gigi == $PORT || $gigi2 == $PORT) then       &lt;I&gt;(Depends on CLI or netsight application)&lt;/I&gt;&lt;BR /&gt;
create log message "IF statement"&lt;BR /&gt;
Else&lt;BR /&gt;
create log message "ELSE statement"&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jun 2016 20:38:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/using-edp-output-in-scripting/m-p/19888#M156</guid>
      <dc:creator>Gaspard_W</dc:creator>
      <dc:date>2016-06-30T20:38:00Z</dc:date>
    </item>
  </channel>
</rss>

