06-16-2014 12:02 AM
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
09-03-2014 01:13 PM
FYI...
This issue is now filed in CSCuq66335 PI: Dbvariable for operationalVlanMode needed
09-04-2014 01:35 AM
thank you.
05-24-2016 01:56 AM
Bug still open... but found a working solution for me.
Adding in CLITemplateDbVariablesQuery.properties
Variable for Access Ports (access vlan or access vlan + voice vlan)
AccessInt=select vlan.name from VLANSwitchportSettings vlan where (vlan.operationalVlanMode = '2' or vlan.desiredVlanMode = '2' or vlan.desiredVlanMode = '3') AND vlan.owningEntityId =
Variable for Trunk Ports
TrunkInt=select vlan.name from VLANSwitchportSettings vlan where (vlan.operationalVlanMode = '5' or vlan.desiredVlanMode = '5') AND vlan.owningEntityId =
Tested with Prime 2.2, 3.0 and 3.1
07-17-2015 01:52 AM
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 u.name from com.cisco.xmp.model.managed.standardTechnologies.vlansAndSpanningTree.vlans.VLANSwitchportSettings 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.
09-22-2015 02:46 AM
Hi, mkoschay123,
How did you manage to get all the DB tables (the "ncsDiag" part) from the command line ?
Thanks.
Regards,
Guillaume.
09-21-2017 07:32 AM
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
exit
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: