09-18-2023 01:35 PM - edited 09-18-2023 02:10 PM
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,
09-19-2023 05:14 AM
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
09-21-2023 12:48 PM
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,
09-22-2023 01:56 PM
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:
Any ideas, please help.
01-22-2024 03:29 AM
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))