cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Who Me Too'd this topic

Cisco Prime 2.x: Adding Inventory Tags in CLITemplateDbVariablesQuery.properties

mkoschay123
Level 1
Level 1

Hello,

I’m trying to build a template that configures all interfaces of my switches which are explicit in Operational Mode: static access

I find an inventory DB table which gives me the needed information in my Demo system:

 

ncsDiag DB query:           select * from VLANSWITCHPORTSETTINGS

 

ID           OWNINGENTITYID                         NAME                                  OPERATIONALVLANMODE         DESIREDVLANMODE                ACCESSVLAN     VOICEVLAN

2708706 2693691_192.168.2.200               FastEthernet0/1              10                                                          3                                             99                                null

//snip//

2708713 2693691_192.168.2.200               FastEthernet0/8              2                                                            3                                             99                                null

 

Adding the query with an inventory tag “AccessInt “ in CLITemplateDbVariablesQuery.properties file in /opt/CSCOlumos/conf/ifm/template/inventoryTagsInTemplate

 

AccessInt=select u.NAME from VLANSWITCHPORTSETTINGS u where u.OPERATIONALVLANMODE like '2' and u.owningEntityId =

 

I check with ncsDiag DB query that the correct output is given.

 

ncsDiag DB query: select u.NAME from VLANSWITCHPORTSETTINGS u where u.OPERATIONALVLANMODE like '2' and u.owningEntityId = '2693691_192.168.2.200'

 

Output returned: FastEthernet0/8

 

Then I create the CLI Template with form variables plus the new tagged DB inventory variable:

 

#foreach ($Interface in $AccessInt)

        interface $Interface

               #if(${spd}  == "Auto")

                   speed auto  

               #elseif(${spd}  == "10Mbps")

                   speed 10

               #elseif(${spd}  == "100Mbps")

                    speed 100

                #elseif(${spd}  == "1000Mbps")

                    speed 1000

               #end

               #if(${duplexField}  == "Auto")

                   duplex auto  

               #elseif(${duplexField}  == "Half")

                   duplex half

               #elseif(${duplexField}  == "Full")

                   duplex full

               #end

exit  

 

But the CLI preview complains about missing data: Commands are not generated due to insufficient information. Provide the required information to generate commands for the selected device.

Is there something wrong with this template script or is it not possible to add managed DB variables?

 

Thanks for any help   

Who Me Too'd this topic