Good Day
I need to create a template which identified interfaces with certain descriptions.
For this to work I see 2 possible scenarios.
Create a Database Query to get the information. (no db expert so moving on)
Create an interactive template which populates the variables as the script continues.
So the idea is that one could set a variable to output from a device. Thinking about this I found that doing a show run interface | i description to work best for my needs. But this is where it gets tricky. When one sets the variable to the command the actual string is populated into the variable instead of the output expected from the device. Not sure if anybody knows how to do this.
Template below refers to current status, I need to add more if statements etc but taking baby steps to understand the process first.
#foreach ($interfaceName in $interfaceNameList)
#set ($description = 'show run interface f0/1 | i description')
interface f0/1
description $description
#end
Thanks in advance