Netsight ELRP script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎04-13-2016 02:18 PM
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.
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.
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎04-14-2016 07:46 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎04-14-2016 04:06 AM
#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
# 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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎04-13-2016 08:59 PM
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.
I can write a script that checks current configuration of elrp and changes the interval, if you'd like.