EXOS: execute command several times and prompt output to CLI

  • 1
  • 1
  • Question
  • Updated 8 months ago
  • Answered
In EOS (S-Series) i use sometimes these to execute a custom command several times and look at the output:

loop 10 1 -r
sh flowlimit stats tg.4.4;tg.1.4;tg.5.4
(loop the following command for 10 times with a delay of 1 sec and refresh cursor at home position)


I am looking for a similar command or mechanism in current EXOS.
(I know for counters this is build in output mechanism in EXOS. I need it for custom commands beyond counters ...)

Regards,
Matthias
Photo of M.Nees

M.Nees, Embassador

  • 9,640 Points 5k badge 2x thumb

Posted 8 months ago

  • 1
  • 1
Photo of OscarK

OscarK, ESE

  • 7,912 Points 5k badge 2x thumb
Photo of Drew C.

Drew C., Community Manager

  • 40,026 Points 20k badge 2x thumb
There's also the GitHub downloader, which has to be installed just the same. Once it's on the switch, it will make it easier to get other scripts.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/git_download

You can also use the download list function to add a few scripts next time you upgrade.
https://documentation.extremenetworks.com/exos_22.4/exos_21_1/software_upgrade_and_boot_options/c_do...

The functionality of watch.py is one that we'd like to get added as a permanent command in EXOS, so your feedback is helpful.
Photo of Ludovico Stevens

Ludovico Stevens, Employee

  • 410 Points 250 badge 2x thumb
If deployment of the Python script to all the switches is an obstacle, then you could consider using JSON-RPC from some management station; this would allow you to push the script to any switch, which then gets executed on the switch and you then harvest the result in JSON format. You can even do this from XMC.
See https://github.com/extremenetworks/EXOS_Apps/tree/master/JSONRPC

Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 13,414 Points 10k badge 2x thumb
Following Ludo comment (which requires EXOS 21.1+), you could also consider Extreme Management Center (XMC) to do the job, if you have it. Since 8.0.4 it supports Python scripting, so you could have your script on XMC and run it from there.

I see a potential to automate all of that with coming XMC 8.1.
Photo of M.Nees

M.Nees, Embassador

  • 9,464 Points 5k badge 2x thumb
Hi Drew,

thanks for your advice with download url and *.lst file! It works fine and i am able to distribute very fast useful python scripts to my switches.

I use XMC for providing this couple of files:

SW-TEST.28 # download url http://netsight/Clients/scripts.lst vr VR-Default
Downloading http://10.1.1.200/Clients/scripts.lst
Downloading http://10.1.1.200/Clients/flowtrack.py
Downloading http://10.1.1.200/Clients/mlag_config_check.py
Downloading http://10.1.1.200/Clients/conf_diff.py
Downloading http://10.1.1.200/Clients/watch.py
SW-TEST.28 #
Thanks
Photo of Drew C.

Drew C., Community Manager

  • 40,026 Points 20k badge 2x thumb
Glad that worked for you, Matthias!