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
Thanks for that, so i assume then the ELRP would need to be removed and then re-enabled with the different interval on each Vlan. As i am no scripting guru i assume that's what the script does.

Matthew_Helm1
Extreme Employee
#This script updates the interval on eljrp-client sessions
# set the variable below
#This only works on EXOS 16.1 forward
set var int 3
disable clip
show elrp
set var CLI.OUT 0
show elrp
set var s $TCL(split ${CLI.OUT} "\n")
set var i $TCL(lsearch $s *----*)
set var i ($i + 1)
set var e $TCL(lsearch $s *Print,*)
set var e ($e - 1)
while ($i < $e) do
set var l $TCL(lindex $s $i)
set var v $TCL(lindex $l 1)
set var p $TCL(lindex $l 2)
set var n $TCL(lindex $l 3)
set var a $TCL(lindex $l 😎
set var d $TCL(lindex $l 9)
set var t $TCL(regexp {\-} $d)
set var t1 $TCL(regexp {L} $a)
set var t2 $TCL(regexp {T} $a)
set var t3 $TCL(regexp {E} $a)
set var t4 $TCL(regexp {I} $a)
set var t5 $TCL(expr $t1 && $t2)
set var lt "log"
set var ie ''
if ($t2) then
set var lt "trap"
endif
if ($t5) then
set var lt "log-and-trap"
endif
if ($t3) then
set var ie "egress"
endif
if ($t4) then
set var ie "ingress"
endif
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)
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
unconfig elrp $v
$recmd
set var i ($i + 1)
endwhile

Matthew_Helm1
Extreme Employee
Changing the interval is a bit more complicated. If you were to try to change the interval of an existing elrp-client configuration, you would get a error message like: "ERROR: An active session already exists for "CLI:Default" !"

I can write a script that checks current configuration of elrp and changes the interval, if you'd like.
GTM-P2G8KFN