I am not sure if there is a direct event for sysName, but you can use some logic to retrieve the switch name.
One of the logic is
Execute the command "show switch" and search for "SysName", push the o/p in variable.
Below is the syntax for the same,
enable cli scripting per
set var CLI.OUT 0
show switch
set var input $TCL(split ${CLI.OUT} " ")
set var x $TCL(lsearch -glob $input "*SysName*")
set var x $TCL(lindex $input $x)
set var x $TCL(split $x " ")
set var switchname $TCL(lindex ${x} 10)
I am not sure if there is a direct event for sysName, but you can use some logic to retrieve the switch name.
One of the logic is
Execute the command "show switch" and search for "SysName", push the o/p in variable.
Below is the syntax for the same,
enable cli scripting per
set var CLI.OUT 0
show switch
set var input $TCL(split ${CLI.OUT} " ")
set var x $TCL(lsearch -glob $input "*SysName*")
set var x $TCL(lindex $input $x)
set var x $TCL(split $x " ")
set var switchname $TCL(lindex ${x} 10)
I am not sure if there is a direct event for sysName, but you can use some logic to retrieve the switch name.
One of the logic is
Execute the command "show switch" and search for "SysName", push the o/p in variable.
Below is the syntax for the same,
enable cli scripting per
set var CLI.OUT 0
show switch
set var input $TCL(split ${CLI.OUT} " ")
set var x $TCL(lsearch -glob $input "*SysName*")
set var x $TCL(lindex $input $x)
set var x $TCL(split $x " ")
set var switchname $TCL(lindex ${x} 10)
I am not sure if there is a direct event for sysName, but you can use some logic to retrieve the switch name.
One of the logic is
Execute the command "show switch" and search for "SysName", push the o/p in variable.
Below is the syntax for the same,
enable cli scripting per
set var CLI.OUT 0
show switch
set var input $TCL(split ${CLI.OUT} " ")
set var x $TCL(lsearch -glob $input "*SysName*")
set var x $TCL(lindex $input $x)
set var x $TCL(split $x " ")
set var switchname $TCL(lindex ${x} 10)
Hello,
I need to refresh this thread.
I'm looking for a solution, that changes the port "display-string" & "description string" based on lldp remote information (in this case AP 3825i). Trigger should be a port up event and then the script should be run every 12 or maybe every 24h.
The input for the script can taken from following output/show-command.
show lldp ports neighbors detailed | include "System Name"
my problem:
I came from EOS world and have no skills in XOS scripting or programming.
I understand the main information of the first answer in this thread.
- how can I trigger this by time?
- how can I define a variable in show-command?
I hope you can help me and give me some tips.
Enter your username or e-mail address to receive an e-mail with instructions to reset your password.