Skip to main content

Using Expect and TCL scripts to gather device configurations

From time to time I have to gather device configurations for storing them remotely or parsing using different scripts. Expect and TCL scripts are very handy as you can automate these configuration backups using just a short simple script. TCL and Expect are quite powerful, so you can do much more with these, this is just a little example on how useful these really are.

First you have to install TCL and Expect. Below you can see how to install these on CentOS 6.6 using Yum, which is really straightforward.

Read More

Junos and Python – Junos PyEZ – Part 1

Feel like automating some configurations, monitoring and troubleshooting on Junos? Step in Python and Junos PyEZ framework (https://techwiki.juniper.net/Projects/Junos_PyEZ). Junos PyEZ is a framework for Python which allows “quite easy” approach for performing automation and configuration tasks on Junos-platform devices. It is also easy to understand for non-programmers so you really don’t have to have deep Python understanding for basic tasks. On protocol level it uses Netconf over SSH for connecting to the device.

The requirements are Python 2.7 and Junos PyEZ framework. I have my test platform running on CentOS 6.6. CentOS 6.6 comes by default with Python 2.6 so it needs updating or new Python 2.7 version installed on the side. You can check the quick guide I wrote for installing Python 2.7 on CentOS 6.6 here: http://www.networkers.fi/blog/installing-python-2-7-on-centos-6-x/

Read More