cancel
Showing results for 
Search instead for 
Did you mean: 

Netsight ELRP script

Netsight ELRP script

Justsomebodi
New Contributor III
Hi All

I need to change the settings of ELRP interval. I have found this script which i am sure can be used in Netsight.

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

enable clipaging

set var sv "#ELRP POLL COMPLETED#"

show var sv



But am unsure as to how much of it i need. All I need to do is conf elrp-client periodic vlan ($variable) ports all interval 20

The above sript does way more, so i assume i can delete parts of it. Does anyone know which ones?

Also would i need to add excluded ports to the script even though it has already been defined.

17 REPLIES 17

Justsomebodi
New Contributor III
XOS 16.1.1.4

Matthew_Helm1
Extreme Employee
What version of EXOS are you running?

Justsomebodi
New Contributor III
Hi

Tested the script and it failed with the below error

*** Error at line - 59 ***
invalid command name "config elrp-client periodic ports All interval 5 log disable-port ingress 300"

Line 59 is
set var recmd $TCL(concat "config elrp-client periodic" $v "ports" $p "interval" $int $lt)

I am so confused. Doesn't seem to like the ingress 300 bit.

if (!$t) then
set var recmd $TCL(concat $recmd "disable-port" $ie)
set var t $TCL(regexp {\d+} $d)
if ($t) then
set var d $TCL(concat "duration" $d)

So i did

set var recmd $TCL(concat "config elrp-client periodic" $v "ports" $p "interval" $int $lt)
if (!$t) then
set var recmd $TCL(concat $recmd "disable-port" $ie "duration")
set var t $TCL(regexp {\d+} $d)
if ($t) then
set var d $TCL(concat "duration" $d)
endif
set var recmd $TCL(concat $recmd $d)
endif

But still get the error.

invalid command name "config elrp-client periodic Extreme1 ports All interval 3 log disable-port ingress duration 300"

The command works in the cli.

Justsomebodi
New Contributor III
Thanks for the explanation.

Matthew_Helm1
Extreme Employee
Yes. It takes the int variable in at the top and makes that the interval for all ELRP VLAN instances. It assumes you are not running any one-shot instances of ELRP on a VLAN. It only works on 16.1 forward because the ports are shown in the output without spaces in that release of EXOS fwd, else it could get really messed up.
GTM-P2G8KFN