Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
Community Member

Cisco Prime 2.x: Adding Inventory Tags in


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


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


Adding the query with an inventory tag “AccessInt “ in 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


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

                   duplex auto  

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

                   duplex half

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

                   duplex full




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   

Community Member

FYI...This issue is now filed


This issue is now filed in CSCuq66335 PI: Dbvariable for operationalVlanMode needed

Community Member

thank you.

thank you.

Community Member

Bug still open... but found a

Bug still open... but found a working solution for me.

Adding in

Variable for Access Ports (access vlan or access vlan + voice vlan)

AccessInt=select from VLANSwitchportSettings vlan where (vlan.operationalVlanMode = '2' or vlan.desiredVlanMode = '2' or  vlan.desiredVlanMode = '3') AND vlan.owningEntityId =

Variable for Trunk Ports

TrunkInt=select from VLANSwitchportSettings vlan where (vlan.operationalVlanMode = '5' or  vlan.desiredVlanMode = '5') AND vlan.owningEntityId =

Tested with Prime 2.2, 3.0 and 3.1

Community Member

We where having the same

I was having the same problem and found the following solution:

I think the problem here is that the table VLANSwitchportSettings is not mapped and you have to specify the full class name.

In your .properties file add the following entry (case sensitive!):

accessInt=select from u where u.operationalVlanMode like '2' and u.owningEntityId =

This works for us on prime 2.2.0. I did not (yet) verify this with Cisco.




Community Member

Hi, mkoschay123,How did you

Hi, mkoschay123,

How did you manage to get all the DB tables (the "ncsDiag" part) from the command line ?




Community Member

Re: Cisco Prime 2.x: Adding Inventory Tags in

Can we set the "spd" and "duplexField" fields as mandatory and then change the code to


#foreach ($Interface in $AccessInt)

        interface $Interface

                   speed $spd

                    duplex $duplexField


CreatePlease to create content