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,

 

4 REPLIES 4

Antonio_Opromol
Contributor II

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.

 

first,
please don't mix different topics under the same thread. 

second,
XIQ-SE Workflow & Python scripting using Python 2.7!
You syntax error tells you that the Python 2.7 interpreter don't understand your instruction, because is a instruction from Python 3.x.
Please use following syntax

test1 = "Hello"
test2 = "World"
print("%s %s!" % (test1,test2))

GTM-P2G8KFN