<?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: how can i create and import a list in a CLI script in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79714#M19884</link>
    <description>hello everybody,&lt;BR /&gt;
&lt;BR /&gt;
I find a solution,&lt;BR /&gt;
&lt;BR /&gt;
1 - 	I create a script mac.xsf  that i put in my server.&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;  set var mylist $TCL(list 00:0c:29:ce:6c:c6 00:0c:29:dd:6d:59 )&lt;BR /&gt;  save var key mylist&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
		Where i list my authorized mac address, and that i export (var key).&lt;BR /&gt;
&lt;BR /&gt;
2 - 	In my primary script in my Switch i add  &lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	tftp get IPmyserver vr "VR-Default" mac.xsf&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
		which allow me to import my authorized mac in my switch&lt;BR /&gt;
&lt;BR /&gt;
3 -  In my primary script in my Switch i also add&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	load script mac.xsf&lt;BR /&gt;	load var key mylist&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
	which allow me to import my authorized mac in my primary script&lt;BR /&gt;
&lt;BR /&gt;
4 - I can finally use my mac address  to put into appropriate vlan according to their mac address&lt;BR /&gt;
	&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	set var control -1&lt;BR /&gt;#Check if the mac address ($myvariable) is part of the list ($list) / if yes #search not egals to -1 $control &lt;BR /&gt;  	set var search $TCL(lsearch -glob $mylist $myvariable)&lt;BR /&gt;#Check if search is not equal to control (control = -1)&lt;BR /&gt;  	if ($match($search, $control)) then&lt;BR /&gt;          configure vlan default del port $EVENT.LOG_PARAM_0&lt;BR /&gt;          configure vlan "myVLAN" add port $EVENT.LOG_PARAM_0&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
	&lt;BR /&gt;
&lt;BR /&gt;
BUT, beacause ther is always a but, if TFTP get do not run/work, that makes my program crash, I would like that the programs always run because the file that tftp import it already in my switch.&lt;BR /&gt;
&lt;BR /&gt;
I hope that you can help my, and that I am understandable,  sorry for my bad english ...</description>
    <pubDate>Wed, 16 Jan 2019 16:43:25 GMT</pubDate>
    <dc:creator>skyvana</dc:creator>
    <dc:date>2019-01-16T16:43:25Z</dc:date>
    <item>
      <title>how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79709#M19879</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
Currently, I am working in a project to  create a Script to detect Vendor Mac Address and put into appropriate vlan according to their mac address.&lt;BR /&gt;
&lt;BR /&gt;
I have a question, is it possible to create a list with some variables (all allowed mac addresses) and then  import these variable  in a CLI script .xsf ?&lt;BR /&gt;
&lt;BR /&gt;
Thank for your help, I hope I am understandable, and sorry for my bad english ...&lt;BR /&gt;
&lt;BR /&gt;
Alex</description>
      <pubDate>Thu, 03 Jan 2019 16:09:32 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79709#M19879</guid>
      <dc:creator>skyvana</dc:creator>
      <dc:date>2019-01-03T16:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79710#M19880</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
does it have to be pure CLI Scripting, or can we add some Python? Using some Python implies to run EXOS 15.6 or above.&lt;BR /&gt;
&lt;BR /&gt;
It would be way simpler to use Python to manipulate lists, while this python script could be used within a CLI Scripting/UPM script.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Stephane</description>
      <pubDate>Thu, 03 Jan 2019 22:41:26 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79710#M19880</guid>
      <dc:creator>Stephane_Grosj1</dc:creator>
      <dc:date>2019-01-03T22:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79711#M19881</link>
      <description>Hi Stephane thank for your answer,&lt;BR /&gt;
&lt;BR /&gt;
How can i run python in CLI Scripting/UPM script ? &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
alex</description>
      <pubDate>Fri, 04 Jan 2019 15:55:58 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79711#M19881</guid>
      <dc:creator>skyvana</dc:creator>
      <dc:date>2019-01-04T15:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79712#M19882</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
you create a python script doing what is needed. If you need some variable from the system (UPM), consider them as parameters.&lt;BR /&gt;
&lt;BR /&gt;
In your UPM script, you simply call the script (run script xxxxx) with the required variables as parameters.&lt;BR /&gt;
&lt;BR /&gt;
for example:&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;X440-8p.6 # create upm profile lldp-detect&lt;BR /&gt;Start typing the profile and end with a . as the first and the only character on a line. Use - edit upm profile  - for block mode capability &lt;BR /&gt;run script lldp-device $EVENT.NAME $EVENT.USER_PORT &lt;BR /&gt;. &lt;BR /&gt;X440-8p.7 # configure upm event device-detect profile lldp-detect ports 1-8 X440-8p.8 # configure upm event device-undetect profile lldp-detect ports 1-8&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 05 Jan 2019 05:40:46 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79712#M19882</guid>
      <dc:creator>Stephane_Grosj1</dc:creator>
      <dc:date>2019-01-05T05:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79713#M19883</link>
      <description>Hi Stephane thank for your answer,&lt;BR /&gt;
&lt;BR /&gt;
I already use a big CLI script .xsf in a UPM script to detect Vendor Mac Address and put into appropriate vlan according to their mac address, my question is, who can i create liste because for the moment i use variable for each mac address, which is not very suitable, so can i use pyhton in that script to create liste, which i browse  for a if condition, or is there another way ?&lt;BR /&gt;
&lt;BR /&gt;
Thank for your help, I hope I am understandable, and sorry for my bad english ...&lt;BR /&gt;
&lt;BR /&gt;
Alex</description>
      <pubDate>Tue, 15 Jan 2019 18:18:18 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79713#M19883</guid>
      <dc:creator>skyvana</dc:creator>
      <dc:date>2019-01-15T18:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79714#M19884</link>
      <description>hello everybody,&lt;BR /&gt;
&lt;BR /&gt;
I find a solution,&lt;BR /&gt;
&lt;BR /&gt;
1 - 	I create a script mac.xsf  that i put in my server.&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;  set var mylist $TCL(list 00:0c:29:ce:6c:c6 00:0c:29:dd:6d:59 )&lt;BR /&gt;  save var key mylist&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
		Where i list my authorized mac address, and that i export (var key).&lt;BR /&gt;
&lt;BR /&gt;
2 - 	In my primary script in my Switch i add  &lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	tftp get IPmyserver vr "VR-Default" mac.xsf&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
		which allow me to import my authorized mac in my switch&lt;BR /&gt;
&lt;BR /&gt;
3 -  In my primary script in my Switch i also add&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	load script mac.xsf&lt;BR /&gt;	load var key mylist&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
	which allow me to import my authorized mac in my primary script&lt;BR /&gt;
&lt;BR /&gt;
4 - I can finally use my mac address  to put into appropriate vlan according to their mac address&lt;BR /&gt;
	&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;	set var control -1&lt;BR /&gt;#Check if the mac address ($myvariable) is part of the list ($list) / if yes #search not egals to -1 $control &lt;BR /&gt;  	set var search $TCL(lsearch -glob $mylist $myvariable)&lt;BR /&gt;#Check if search is not equal to control (control = -1)&lt;BR /&gt;  	if ($match($search, $control)) then&lt;BR /&gt;          configure vlan default del port $EVENT.LOG_PARAM_0&lt;BR /&gt;          configure vlan "myVLAN" add port $EVENT.LOG_PARAM_0&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
	&lt;BR /&gt;
&lt;BR /&gt;
BUT, beacause ther is always a but, if TFTP get do not run/work, that makes my program crash, I would like that the programs always run because the file that tftp import it already in my switch.&lt;BR /&gt;
&lt;BR /&gt;
I hope that you can help my, and that I am understandable,  sorry for my bad english ...</description>
      <pubDate>Wed, 16 Jan 2019 16:43:25 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79714#M19884</guid>
      <dc:creator>skyvana</dc:creator>
      <dc:date>2019-01-16T16:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: how can i create and import a list in a CLI script</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79715#M19885</link>
      <description>I expose my solutions in case of someone has the same problem as me.&lt;BR /&gt;
&lt;BR /&gt;
I find a solutions to my problem, that the ftp crash my script (loopback condition), if the tftp server not responding.&lt;BR /&gt;
&lt;BR /&gt;
I use a script that i run in my principal script,  to check if the tftp server ping, if he ping i run tftp if not he informe me about the error .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;set var check "4 packets received"&lt;BR /&gt;set var CLI.OUT "  "&lt;BR /&gt;ping 192.168.64.1&lt;BR /&gt;&lt;BR /&gt;set var list1 $TCL(split ${CLI.OUT} \n)&lt;BR /&gt;set var list2 $TCL(lindex $(list1) 7)&lt;BR /&gt;set var list3 $TCL(string range $(list2) 23 40)&lt;BR /&gt;&lt;BR /&gt;#test if the switch ping the TFTP server address / if yes launches tftp&lt;BR /&gt;&lt;BR /&gt;if (!$match($check, $list3)) then&lt;BR /&gt;	tftp get 192.168.64.1 vr "VR-Default" mac.xsf&lt;BR /&gt;	create log message "TFTP OK"&lt;BR /&gt;else&lt;BR /&gt;	create log message "WARNING TFTP do not ping"&lt;BR /&gt;endif&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;H2&gt;My question was maybe very focused and inaccurate, I may have done a monologue (a discussion between myself) but thank you as well.&lt;/H2&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:59:45 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-can-i-create-and-import-a-list-in-a-cli-script/m-p/79715#M19885</guid>
      <dc:creator>skyvana</dc:creator>
      <dc:date>2019-01-16T20:59:45Z</dc:date>
    </item>
  </channel>
</rss>

