My VRF Search Tool is proving to be quite useful on the job and I was looking for a way to automate some of the functionality of the tool so that it can be extended for use in other applications. As it stands now, the index of VRF Names is only updated once a day by the first person to run the tool each day. Since the tool is being used in a 24/7 environment, engineers working late may be working with old information.
Therefore, I’ve sought to automate the buildIndex() function of the VRF Search Tool and created BuildVRFIndex.py. Just like the VRF Search Tool, BuildVRFIndex builds a CSV file of the VRF Name, Remote Peer IP and Local Peer IP of each VPN tunnel — but it lacks the functionality to search the index.
Unlike my other Python applications, this is the first time I’ve ventured into the use of a configuration file. The configuration file will allow the user to pre-set the path and name of the files the application needs to run. You can also set the username and password that will be used to log in to each of the routers. NOTE: The password must be base64-encoded. You can use a website like http://www.base64encode.org/ to translate your password into a base64-encoded string.
Just as I’ve done with the last few applications — I’ve found that creating a Visio flowchart helps me map out the functionality of the application and in what order operations should execute. I’m uncertain how many revisions this flowchart has gone through. 🙂
See the GitHub Repository for this project to learn more.