cancel
Showing results for 
Search instead for 
Did you mean: 

Python Scripts Executing from Netsight - Clarification Needed

Python Scripts Executing from Netsight - Clarification Needed

Ed_McGuigan1
New Contributor III
I got my python book and started learning python at the beginning of the week.

I want to write a script that can be executed from Netsight ( EMC 8.04 ). What I actually want to do is locate ports on switches to which PoE powered wireless access points are connected and cycle the PoE power in order to reboot hung access points.

There is no documentation that I can find specific to Python scripts as opposed to TCL scripts on Netsight and my assumption was that I would just write a script that was suitable to be loaded directly onto a switch and that the Netsight interface would take care of uploading the script and executing it.

I noticed that there didn't seem to be any information about adding the same kind of metadata for the definition of script arguments.

I have a script that I can manually upload onto a switch and execute but if I try to execute it from Netsight by selecting the Run option and picking a switch to run it on, it fails with a complaint that the exsh module couldn't be found.

I have realized that a python script in Netsight is not uploaded to the switch but rather executed on the server. I guess that would be workable but there is no documented method for providing arguments to the scripts.

Is this a feature that hasn't been completed yet?
I am trying to work out a method of being able to upload and execute a python script on a switch such that it can be leveraged from Netsight, or understand how others are leveraging python on XOS and getting scripts out onto devices on as needed basis.

Do I need to use a generic python server script to push out my XOS python scripts, run them at the switch and then delete them?
20 REPLIES 20

On your server, you ran:
# python rmtscript.py -i -u When the script prompted with:
run script \ [args]:You entered
sample.py Then you get an error.

Do I have it right so far?

Can you tell me which version of python you are using on your server?

I followed the instruction -> https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/rmtscript

If i call "sample.py -a -b def", then I get the error from above

Could you provide a little more information about what you are doing?

CLI doesn't process scripts, so I'm a bit confused by the mention of CLI with the python call request().

Hi Dave,

What is the cause for CLI returning "request() got an unexpected keyword argument 'json'"

Dave_Hammers
Extreme Employee
EXOS does have the ability to pass script from a server and run them without actually transferring the script file to the switch first.

EMC currently does not support this but it can be done independent of EMC.

If you are interested, I can put an example together.

GTM-P2G8KFN