Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Where can I download python libraries / module

Hi,

May I ask where I can download the Cisco python libraries and API's required to run scripts on an external server rather than on the Nexus 7K itself?

Regards,

Aleks

7 REPLIES
Hall of Fame Super Blue

Re: Where can I download python libraries / module

Aleks

The offical python site has all the downloads -

http://www.python.org/

 

Jon

New Member

Re: Where can I download python libraries / module

Hi,

Thanks I have checked previously however cannot find the actual cisco.py module(s), I can only find third party extensions built for ssh/cisco cli commands...

Does this mean I need to download the OnePK suite to access the proper cisco modules to import?

Regards,

Aleks

Hall of Fame Super Blue

Where can I download python libraries / module

Aleks

See what you mean now.

Haven't come across OnePK so can't say for sure whether it will be in there unless you know different.

So as i understand it the module you are after is built into NX-OS.

Just for my reference would you get the same functionality if you ran it on a server within your own scripts ie.do you lose any functionality by not running it direct on the actual device.

Sorry i can't be more help.

Jon

Where can I download python libraries / module

I have no experience with Nexus outside of managing it once for a friend of mine when he ran into an issue, so I don't claim to be an expert in the OS That being said, Jon is correct that it seems like you have that functionality in the OS already, but if you're wanting to run scripts from a server, have you looked at the telnetlib and sshlib for python? You can still configure commands using these modules as if you were sitting at the terminal.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***
New Member

Where can I download python libraries / module

Thanks for the replies, what I am trying to do is somewhat different. Python scripts can be run from the switch directly, however the other option is to compile the scripts from a central location and using API's run them on the nexus7k's remotely as it would not be practical to run seperate scripts on say 20+ 7000 switches all the time.

So the actual script still runs on the switch however complied remotely, from what i found this needs to be done via Cisco OnePK which has the relevant API's and python libraries which can be imported into python eg; import cisco.py (within the code)...

I attended a Cisco python scripting for Nexus7k recently and this was demonstrated however I assumed locating the relevant modules would be easy so did not bother to ask anyway the Cisco devnet looks to be unaccessable at the moment so will wait until Monday to have a go.

Also the sshlib and telnetlib are good however just run commands remotely, with the built in modules we can create trigger events for thresholds such as "run sh ip route | inc 00:00" when the cpu spikes due to BGP / ARP which will give us the routes that are flapping at that point in time without anyone needing to monitor the switch manually for this.

Thanks again, I will update this post when I get it working.

Hall of Fame Super Blue

Re: Where can I download python libraries / module

Aleks

So the actual script still runs on the switch however complied remotely, from what i found this needs to be done via Cisco OnePK which has the relevant API's and python libraries which can be imported into python eg; import cisco.py (within the code)..

.

thanks for clarifying that. I was thinking that if you ran them remotely on a server you would actually lose access to some of the APIs built into NX-OS but from the sounds of it you don't.

Jon

Re: Where can I download python libraries / module

Is this it?

Onepk

https://developer.cisco.com/web/onePK

Sent from Cisco Technical Support iPhone App

HTH, John *** Please rate all useful posts ***
757
Views
5
Helpful
7
Replies
CreatePlease to create content