cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1060
Views
0
Helpful
2
Replies

Settin variable based on 'show' output

binarycow
Level 1
Level 1

I am using Prime Infrastructure 3.1. I would like to create a template that will affect all ports with only a specific setting. For example, I have "ip verify source tracking" on some interfaces, "ip verify source" on others, and neither on others. I am trying to standardize on "ip verify source" - but ONLY IF it's turned on.

I already have code that will modify each interface based on a condition.... Here's what I'd like to do.

#foreach($interfaceName in $interfaceNameList)
#set ($is_verify_source_tracking = !!!OUTPUT OF 'show run int $interfaceName | inc ip verify source'!!!)
#if($is_verify_source_tracking == "ip verify source tracking")
interface $interfaceName
ip verify source
#end
#end

What I can't figure out, is how to set the variable to the output of that show command. Any ideas?

2 Replies 2

iportuga
Cisco Employee
Cisco Employee

Hi,

 

Unfortunately, the CLI Template feature can't use any CLI command output for variable assignment. However, you could use compliance audit policy rules to match the desired command output and then take a config change action (fix job):

 

How To Perform a Compliance Audit

Yeah.... I had kinda figured that after doing more research (especially seeing the fact that the template seems to compute what to send to each device *before* it attempts to send).

 

Unfortunately, we can't use the 'compliance' feature as of yet - the server admins have elected to install the 'Standard' OVA due to hard drive space requirements.  We're waiting on either more hard drive space, or supposedly, in Prime 3.2, the 'Standard' OVA will include compliance features.