cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4831
Views
5
Helpful
7
Replies

Where can I download python libraries / module

apetkovs
Level 1
Level 1

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 7

Jon Marshall
Hall of Fame
Hall of Fame

Aleks

The offical python site has all the downloads -

http://www.python.org/

 

Jon

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

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

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 ***

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.

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

John Blakley
VIP Alumni
VIP Alumni

Is this it?

Onepk

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

Sent from Cisco Technical Support iPhone App

HTH, John *** Please rate all useful posts ***
Review Cisco Networking products for a $25 gift card