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, i will give it a test.

Matthew_Helm1
Extreme Employee
I modified it to work in as a OneView script:

#@MetaDataStart#############################################################################################
# Define your user parameters in this section. For reference, see bundled scripts.
#############################################################################################
#@VariableFieldLabel (description = "Interval (number > 0)")
set var int 1
#@MetaDataEnd
# Enter all CLI commands from here
disable clip
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
unconfig elrp $v
if (!$t) then
set var t $TCL(regexp {\d+} $d)
if ($t) then
configure elrp-client periodic $v ports $p interval $int $lt disable-port $ie duration $d
else
configure elrp-client periodic $v ports $p interval $int $lt disable-port $ie perm
endif
else
configure elrp-client periodic $v ports $p interval $int $lt
endif
set var i ($i + 1)
endwhile

Justsomebodi
New Contributor III
Yes, sorry mean elrp from the vlan's. I am running the script from Oneview so is not actually Netsight (6.3.0.168)

Matthew_Helm1
Extreme Employee
I assume you mean the script ended up removing ELRP from all VLANs. I've been testing it from the CLI. I'll test it from NS when I have a chance.

GTM-P2G8KFN