<?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: Scripting question..... in End of Service Products</title>
    <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22823#M278</link>
    <description>Here's a simple script that will look for the primary IP address in a vlan and store its four octets and mask in variables a, b, c, d and m.&lt;BR /&gt;
&lt;BR /&gt;
In includes a check for vlans without configured IP address, but does not check for non-existent vlans...&lt;BR /&gt;
&lt;BR /&gt;
set var vl $read(Input VLAN name:)&lt;BR /&gt;
set var cli.out 0 &lt;BR /&gt;
show $vl&lt;BR /&gt;
set var ip $tcl(split ${cli.out} "\n")&lt;BR /&gt;
show var ip&lt;BR /&gt;
set var e $tcl(regexp -nocase {Primary IP} $ip)&lt;BR /&gt;
if ($e != 0) then&lt;BR /&gt;
  set var ip $tcl(lindex $ip 6)&lt;BR /&gt;
  set var ip $tcl(split $ip ":")&lt;BR /&gt;
  set var ip $tcl(lindex $ip 1)&lt;BR /&gt;
  set var ip $tcl(string trim $ip)&lt;BR /&gt;
  set var ip $tcl(split $ip "./")&lt;BR /&gt;
  set var a $tcl(lindex $ip 0)&lt;BR /&gt;
  set var b $tcl(lindex $ip 1)&lt;BR /&gt;
  set var c $tcl(lindex $ip 2)&lt;BR /&gt;
  set var d $tcl(lindex $ip 3)&lt;BR /&gt;
  set var m $tcl(lindex $ip 4)&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Apr 2015 05:37:00 GMT</pubDate>
    <dc:creator>dflouret</dc:creator>
    <dc:date>2015-04-21T05:37:00Z</dc:date>
    <item>
      <title>Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22816#M271</link>
      <description>Almost done with a script that is modifying settings on sites for standardization.  It touches about 3000+ devices, one if statement found online parses the script and XOS devices go one way, Extremeware another.  Works great.  Now I need to add some conditional statements that will look at the IP and determine if it ends in a certain octet....&lt;BR /&gt;
&lt;BR /&gt;
So something like &lt;BR /&gt;
&lt;BR /&gt;
If a device IP ends in X.X.X.6 do this&lt;BR /&gt;
&lt;BR /&gt;
blah&lt;BR /&gt;
&lt;BR /&gt;
else this &lt;BR /&gt;
&lt;BR /&gt;
blah&lt;BR /&gt;
&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
Unable to find the resources online to accomplish this.....should be just one line. Any input?&lt;BR /&gt;
&lt;BR /&gt;
ty&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Apr 2015 04:53:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22816#M271</guid>
      <dc:creator>Jimmy2</dc:creator>
      <dc:date>2015-04-20T04:53:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22817#M272</link>
      <description>What language have you chosen? Do you use XOS CLI Scripting or something else?&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Apr 2015 11:01:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22817#M272</guid>
      <dc:creator>eyeV</dc:creator>
      <dc:date>2015-04-20T11:01:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22818#M273</link>
      <description>XOS scripting.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Apr 2015 12:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22818#M273</guid>
      <dc:creator>Jimmy2</dc:creator>
      <dc:date>2015-04-20T12:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22819#M274</link>
      <description>I reckon, you should use regexp TCL function. I'm not very good in TCL actually, but I recommend you to read Using CLI Scripting part in EXOS Concept Guide. There are some useful examples too.</description>
      <pubDate>Mon, 20 Apr 2015 12:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22819#M274</guid>
      <dc:creator>eyeV</dc:creator>
      <dc:date>2015-04-20T12:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22820#M275</link>
      <description>Ok, so I can use regexp  for something like this&lt;BR /&gt;
if deviceip ends in .6 do this&lt;BR /&gt;
else&lt;BR /&gt;
 do this&lt;BR /&gt;
end&lt;BR /&gt;
&lt;BR /&gt;
Problem is I have no idea how to get a regexp to do this.  Having never used regular expressions before....., after researching online for 3 hours ,my head is about to explode.&lt;BR /&gt;
Basically I would like an expression to say &lt;BR /&gt;
dontcare.dontcare.dontcare.mustendin .6</description>
      <pubDate>Mon, 20 Apr 2015 12:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22820#M275</guid>
      <dc:creator>Jimmy2</dc:creator>
      <dc:date>2015-04-20T12:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22821#M276</link>
      <description>RegEx is fun &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Take a look at the IP Address examples for TCL on this page:  &lt;A href="http://wiki.tcl.tk/989" target="_blank" rel="nofollow noreferrer noopener"&gt;http://wiki.tcl.tk/989&lt;/A&gt;&lt;BR /&gt;
Here's a quick and simple one you could use: ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.6$   &lt;BR /&gt;
&lt;BR /&gt;
It doesn't do any checks to make sure your octets are 0-255, but that doesn't seem necessary in your case since it can't be configured out-of-bounds anyway.&lt;BR /&gt;
&lt;BR /&gt;
-Drew</description>
      <pubDate>Mon, 20 Apr 2015 12:16:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22821#M276</guid>
      <dc:creator>Drew_C</dc:creator>
      <dc:date>2015-04-20T12:16:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22822#M277</link>
      <description>Jimmy,&lt;BR /&gt;
&lt;BR /&gt;
An EXOS switch can have multiple IP addresses, which one are you interested in? Mgmt vlan, Default vlan?&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Apr 2015 02:07:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22822#M277</guid>
      <dc:creator>dflouret</dc:creator>
      <dc:date>2015-04-21T02:07:00Z</dc:date>
    </item>
    <item>
      <title>RE: Scripting question.....</title>
      <link>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22823#M278</link>
      <description>Here's a simple script that will look for the primary IP address in a vlan and store its four octets and mask in variables a, b, c, d and m.&lt;BR /&gt;
&lt;BR /&gt;
In includes a check for vlans without configured IP address, but does not check for non-existent vlans...&lt;BR /&gt;
&lt;BR /&gt;
set var vl $read(Input VLAN name:)&lt;BR /&gt;
set var cli.out 0 &lt;BR /&gt;
show $vl&lt;BR /&gt;
set var ip $tcl(split ${cli.out} "\n")&lt;BR /&gt;
show var ip&lt;BR /&gt;
set var e $tcl(regexp -nocase {Primary IP} $ip)&lt;BR /&gt;
if ($e != 0) then&lt;BR /&gt;
  set var ip $tcl(lindex $ip 6)&lt;BR /&gt;
  set var ip $tcl(split $ip ":")&lt;BR /&gt;
  set var ip $tcl(lindex $ip 1)&lt;BR /&gt;
  set var ip $tcl(string trim $ip)&lt;BR /&gt;
  set var ip $tcl(split $ip "./")&lt;BR /&gt;
  set var a $tcl(lindex $ip 0)&lt;BR /&gt;
  set var b $tcl(lindex $ip 1)&lt;BR /&gt;
  set var c $tcl(lindex $ip 2)&lt;BR /&gt;
  set var d $tcl(lindex $ip 3)&lt;BR /&gt;
  set var m $tcl(lindex $ip 4)&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Apr 2015 05:37:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/end-of-service-products/scripting-question/m-p/22823#M278</guid>
      <dc:creator>dflouret</dc:creator>
      <dc:date>2015-04-21T05:37:00Z</dc:date>
    </item>
  </channel>
</rss>

