HowTo Manage your networked devices using Python and Pexpect

This is my first release of ldNetDeviceManager.py. The ldNetManager.py tool gives you the ability to manage your network devices with out having to purchase a product like Cisco’s LMS or go through the planning phase of deploying a product like func. Each of the tools I mentioned before, only have the ability to manage devices in their realm. Func supports Linux devices and Cisco LMS supports only Cisco devices.

This tool has one goal. And that is to update your devices with out deploying any software to your remote devices. All you need is either telnet or ssh access to your devices and Python2.4 or better with Pexpect installed. Once you have those 2 requirements fullfilled, then you are pretty much ready to go.

You will need Python 2.4 or better and Pexpect. ( has not been tested with Python 3+ )

You can get Python from http://python.org and Pexpect ( I’m currently using Pexpect 2.3, which you can get from SourceForge.

Network Device Manager Download
For support. please check the forums, http://www.linuxdynasty.org/forums/LD_Network_Device_Manager .
Here are the release notes..
Revision .21 10/01/2009

  • Can now save output to a file. using the –save option

Revision .20 09/27/2009

  • Support for Cisco Devices and Linux Operating Systems
  • Support for telnet and ssh or both
  • Knows if you passed sudo, su, or enable
  • Can pass either 1 device or multiple devices
  • Can pass 1 command or multiple commands through a text file.
  • Can pass 1 device or multiple devices through a text file.
  • When running show commands on Cisco devices, the script will know to send a ( space bar ) to get more info

Here is an example of running LdNetManager.py against 3 of my servers..
In the examples below, you will notice I am not passing a password and I’m using the root account. The script will know if you have ssh keys installed on the remote servers.

Another example, this example shows that snmpd is set to on ..

Another example. This time logging into Cisco Devices and runnign a show cdp neighbor..

Here is the default output of ldNetDeviceManager.py

This entry was posted in LD Device Manager, Python and tagged , , , , , . Bookmark the permalink.

One Response to HowTo Manage your networked devices using Python and Pexpect

  1. frankcui24 says:

    can you make available the source code for doing this ? thanks

Leave a Reply