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

FWIW, I just spoke with the XMC (Netsight) manager. This may get incorporated into the eXtreme Management Center (XMC) 8.2 release. So if you do upgrade, it may be the feature you were originally looking for..

Hi Dave:

We are still back on 15.6.3 FW at my place ( 2,000 managed devices and probably about 70% is stacks of 2, 3 or 4 ). A lot of politics are holding me back from upgrading so I can't use the RPC-JSON functions any time soon. I am going to load so recent FW on to a test switch so that I can play with it.

Thanks,

Ed.

Dave_Hammers
Extreme Employee
Take a look at https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/rmtscript

Your switches must be running EXOS 21.1 or later for this to work.
It also requires:
- a python environment on your server
- the requests python package installed on your server

I can only guess that the requests python module on your server is older than 2.4.2

python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> print requests.__version__
2.6.0
>>>

Correct.

My Version is Python 2.7.6

GTM-P2G8KFN