cancel
Showing results for 
Search instead for 
Did you mean: 

Create a workflow that runs a script to a port based on port displayname

Create a workflow that runs a script to a port based on port displayname

Chad5
Contributor

Hi,

Wondering if anyone has a script that can run on EXOS switches to look for a certain name configured on a port (display port name), and then when found, it will run on that port some cli commands.

For example, if I have a port 1:40, with name "WAN". the script will save 1:40 in a variable for that switch, and then run:

configure port 1:40 ....etc

And repeat for other switches...

If I can get the script commands to connect to an IP, run CLI commands and get the CLI command output where I can process.. then I can prob do the rest. Just not sure how to connect, run commands, then close.

Thanks,

 

3 REPLIES 3

Antonio_Opromol
Contributor

Hi,

I suggest to you to have a look of the system workflow already present in Site Engine, or on GitHub in the Extreme Networks's channel and there are a lot of examples that can help you on this development.

Regards

Thanks. Yeah, did that and with some help from chatGPT I was able to do a basic code to do it. I was hoping for some documents that discussed the XMC specific commands and libraries. But will use the examples for now.

Thanks,

Hi Coders, Help please 🙂

Trying to run this function that checks through an API call if the mac address is a CISCO MAC, but I keep getting errors in XMC:

SyntaxError: ('no viable alternative at input \'"{base_url}/{mac_address}"\'', ('<string>', 35, 33, ' response = requests.get(f"{base_url}/{mac_address}", headers=headers) # Escape double quotes with a backslash\n'))

Here is code, I kept line numbers to see problem:

Chad5_0-1695416193920.png

Any ideas, please help.

 

GTM-P2G8KFN