cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
954
Views
0
Helpful
1
Replies

Cisco Prime Infrastructure - Configuration Templates - detect interfaces

michael Helmbo
Level 1
Level 1

Let’s say we have a scenario where we want to add a command to all access ports in 10 switches. How do I make the configuration template go through every interface in each switch and detect if it’s an access port and then add a command to those ports?

In LMS we used to do something like:

precedence:

Interface [#.*Ethernet.*#]

+ switchport access

command:

#same interface as above#

+ switchport port-security

-------------------------------

In the Configuration Templates the closest thing I found was this:

#set($valueOfChar= "-")

#if($interfaceName.indexOf($valueOfChar)== -1)

interface $interfaceName

#else

interface range $interfaceName

#end

#if($configureInterfacesAs == "access")

switchport mode access

switchport access vlan $vlanId

#else

switchport mode trunk

#end

But that requires that input about the interfaces.

Also does anyone know if there is a website that describes the variables / language used? Or a guide or something that can be downloaded / bought that will explain "everything" we need to know to be able to make "advanced" configuration templates.

In Advance:

Thank you very much to anyone out there who has input/help on this one.

1 Reply 1

michael Helmbo
Level 1
Level 1

To those it might interest. We've learned that "compliance" isn't a feature that available on Prime yet. Seems like other features are more important to Cisco... sadly.

We went back to LMS 4.2.2 for this issue. Alternatively I made a Linux script with expect that does the same thing so that might also be an option for people without LMS.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco