cancel
Showing results for 
Search instead for 
Did you mean: 

scripting on xos switchen

scripting on xos switchen

dr_watson
New Contributor
Hi, i have a problem.
I want to configure the elrp client on all my extreme xos switche.( more then 1000 )
with al lot off dificulti vlan names.
I don´t want log in seperatly in every switch to do it on the cli.
Can i do this configuration wih a script?

12 REPLIES 12

Yes, it works good.
But who can me explain what this Scripr do?
I know it is very difficulty for me to understand this.
I want to write a script which configure me the elrp protocoll on the switch. witch multiple vlans.
iI our networks we have ovver 1100 Extreme router or switche and i must
configue elrp to remove a loop in my network.

Good to hear. Thanks.

dr_watson
New Contributor
Good Morning,

thank you for your help in scripting under xos software
How i download a file to my swiches is not the problem, wie do it often with Netsight or
with my own tftp server.
i don't know ho i download the phyton files from the homepage

https://github.com/extremenetworks/



Matthew_Helm1
Extreme Employee
So, the best way to xfer files is probably TFTP. Here is an example for a config file but the principle is the same for .xsf and .py files.

Once you have the .xsf or .py file on your switch, you would issue the command "load script {scriptname}" where the script file name is given without the suffix.

That said, you could also simply vi a file and type i for insert and then copy and paste the script contents into your terminal session. Then wq! to write to the file and quit the vi editor.

Also here is some code that when run in a script does an ELRP one-shot on every VLAN, every port and reports loops. You could probably modify it to do what you want.

#usage: load script elrp_oneshot
# USE THIS SCRIPT AT YOUR OWN RISK
#
disable cli prompting
disable clipaging
enable elrp-client
set var sv "#ELRP POLL STARTED#"
show var sv
set var cli.out 0
show vlan
set var sv $TCL(split ${cli.out} "\n")
set var e $TCL(lsearch $sv *(B)*)
set var i 5
set var e ($e - 1)
while ($i < $e) do
set var cli.out 0
set var v $TCL(lindex $sv $i)
set var vn $TCL(lindex $v 0)
set var z $TCL(regexp {Mgmt} $vn)
if ($z == 0) then
conf elrp-client one-shot $vn port all print
set var p $TCL(split ${cli.out} "\n")
set var p1 $TCL(lsearch $p *NO*)
if ($p1 == -1) then
set var p1 $TCL(lindex $p 2)
set var p2 $TCL(lindex $p1 9)
set var p1 $TCL(lrange $p1 0 6)
set var p1 $TCL(concat $p1 $p2)
set var p2 $TCL(lindex $p 3)
set var p2 $TCL(lrange $p2 5 7)
set var p $TCL(concat $p1 $p2)
show var p
else
set var p1 $TCL(lindex $p 2)
set var p2 $TCL(lindex $p1 10)
set var p1 $TCL(lrange $p1 0 7)
set var p1 $TCL(concat $p1 $p2)
show var p1
endif
endif
set var i ($i + 1)
endwhile
disable elrp-client
set var sv "#ELRP POLL COMPLETED#"
show var sv
enable clipaging
enable cli prompting
GTM-P2G8KFN