<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DB variable for retrieving an interface IP in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560857#M1418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;Unfortunately I didn't bother sending an email because the documentation says they only recommend using their provided variables. I looked through the SQL tables in ncsDiag and didn't see anything interesting related to dot1x. Maybe the 'accessvlan' field in the 'vlanswitchportsettings' table gets dynamically updated once ISE has assigned one? Until Cisco publish the EJBQL model schema we'll be in the dark I'm afraid.&lt;/P&gt;&lt;P&gt;See attached screenshot - I'm not sure if that accessvlan is the configured one from 'switchport access vlan' or the dynamically assigned operational vlan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I can't be of much help. I did use the 'I wish this page would' feature for a different CLI template problem I had and Cisco did reply to me to say they've logged a feature request so maybe its worth logging one and seeing what happens!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2016 13:30:14 GMT</pubDate>
    <dc:creator>Dave Lewis</dc:creator>
    <dc:date>2016-12-29T13:30:14Z</dc:date>
    <item>
      <title>DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560850#M1411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to use a DB variable to retrieve the IP address for a specific loopback interface but without much success. I've tried variations on this added to the CLITemplateDbVariablesQuery.properties file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lo11IP=select ip.ipaddress_address from ipaddress ip where ip.name like 'Loopback11' AND ip.owningEntityId =&lt;/P&gt;&lt;P&gt;Loopback11IP=select STR(u.ipaddress_address) from ipaddress u where u.name like 'Loopback11' AND u.owningEntityId =&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But whenever I try to use these in a CLI template the preview just shows $variable_name instead of the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above commands work fine using dbquery in ncsdiag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, on a side note - when you add a new definition into &lt;SPAN style="font-size: 13.3333px;"&gt;CLITemplateDbVariablesQuery.properties should they work immediately or do I have to re-sync the target devices or schedule an archive or even restart Prime?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2016 16:14:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560850#M1411</guid>
      <dc:creator>Dave Lewis</dc:creator>
      <dc:date>2016-12-12T16:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560851#M1412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave, yes, you'll need to restart in order for pretty much any change in the conf folder to take effect.&amp;nbsp; Most configurations are read in during startup and not read from again until the next restart.&amp;nbsp; If the values look incorrect, then that's where doing a sync to refresh the inventory in Prime would come in handy (note that we're working on the ability to trigger a sync via the API for 3.2) but I would also recommend checking that the query you wrote is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, be sure that in your template you've defined the variable as a DB type variable with a default value of your new property (in your case, Lo11IP or Loopback11IP).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the &lt;A href="http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/3-1/user/guide/pi_ug/config-temp.html#32696"&gt;PI user guide's section on this&lt;/A&gt; for more details.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2016 18:06:01 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560851#M1412</guid>
      <dc:creator>Spencer Zier</dc:creator>
      <dc:date>2016-12-12T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560852#M1413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Spencer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've managed to create other DB lookup variables which work so I'm okay with the general concept and how to use them within templates but wasn't aware PI needed a restart for changes to take effect (couldn't find that in the documentation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this particular task I just can't get the information I need whatever I try but I wonder if its to do with the seeming disparity between the tables displayed in ncsDiag and the tables used by the lookups?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, in ncsDiag the following query works exactly as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"select u.ipaddress_address from ipaddress u where u.name like 'Loopback11' and u.owningEntityId = &lt;EM&gt;blah&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but isn't working as a DB variable - perhaps the ipaddress table isn't exposed in the same way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ask because the db variables appear to use different tables (DB views?) that aren't visible in ncsDiag - InterfaceProtocolEndpoint , EthernetProtocolEndpoint and EthernetProtocolEndpointExtended aren't visible in DB query and ManagedNetworkElement seems to have different column structure (productSeries and managementAddress for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps one of the above views contains the IP address I'm trying to extract but I haven't found any documentation on the schema or any way to interrogate the DB at this level?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another use case I'm struggling with at the moment is extracting the BGP AS number from a device, the bgpVrfSettings table is empty and I haven't found it in any of the other tables so far which leaves me with downloading the latest running config for a device and parsing that which isn't very elegant or fast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any logging of DB variable usage or any debug operations that could pinpoint the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help with these two use cases would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 11:18:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560852#M1413</guid>
      <dc:creator>Dave Lewis</dc:creator>
      <dc:date>2016-12-14T11:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560853#M1414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think I've found the answer to the question about logs - in ifm_template.log I found entries similar to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[2016-12-14 14:38:08,953] [http-nio-443-exec-15] [service] [ERROR] - IFM_TEMPLATE_EXCEPTION: [com.cisco.xmp.persistence.common.util.DMMCRUDException:,message=errorId=20,componentName=CRUD executeQuery Failed! errorId=20,componentName=CRUD executeQuery Failed! &lt;STRONG&gt;ipaddress is not mapped&lt;/STRONG&gt; [select u.ipaddress_address from ipaddress u where u.name like 'Loopback11' AND u.owningEntityId = '187661132_x.x.x.x']]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I guess I was along the right lines with the ipaddress table not being available to the db variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe if I knew the fully qualified path to the table it would work? Something like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;select u.ipaddress_address from &lt;/SPAN&gt;com.cisco.xmp.model.foundation.connectivity.ipAddress &lt;SPAN style="font-size: 13.3333px;"&gt;u where ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;select u.ipaddress_address from com.cisco.ifm.model.connectivity.ethernet.ipAddress u where ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 15:37:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560853#M1414</guid>
      <dc:creator>Dave Lewis</dc:creator>
      <dc:date>2016-12-14T15:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560854#M1415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, it's not actually SQL queries defined in that file (which is what the dbQuery page linked to from ncsDiag runs).&amp;nbsp; Instead, they're EJB queries that query objects from our model.&amp;nbsp; I don't think we have a place in the UI where the entirety of the model is exposed.&amp;nbsp; I don't think we have an ncsDiag/dbQuery like page to run EJB queries either &lt;IMG src="https://community.cisco.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can try reaching out to &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:ask-prime-infrastructure@cisco.com"&gt;ask-prime-infrastructure@cisco.com&lt;/A&gt;&lt;SPAN&gt; to get support from the config template team, but I'm not sure if you'll get support there, based on what the docs say ("&lt;/SPAN&gt;&lt;SPAN style="color: #525252; font-family: arial, helvetica, 'Helvetica Neue', HelveticaNeue, 'Lucida Grande', sans-serif; font-size: 14px; text-indent: -35px;"&gt;only advanced developers should attempt this. We recommend you use the variables defined in the [f]ile only&lt;/SPAN&gt;") they might decline to help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2016 17:03:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560854#M1415</guid>
      <dc:creator>Spencer Zier</dc:creator>
      <dc:date>2016-12-14T17:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560855#M1416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Spencer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a shame because I think that's where the real power of Prime CLI templates lies (within the DB variables), to provide a sort of poor-man's NSO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A quick work around would be to provide an API call that allows you to run an SQL query and retrieve the results. That'd be awesome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 16:57:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560855#M1416</guid>
      <dc:creator>Dave Lewis</dc:creator>
      <dc:date>2016-12-15T16:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560856#M1417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And did you get some answer on the question to the mail-alias?&lt;/P&gt;&lt;P&gt;I have a problem which is quite the same: I want to look for the access-vlan on a switchport and allow to deploy some conifglets on only specific port in access-vlan 10-20. I know the information is in the DB (can be shown on Monitor / Managed Elements / Network Devices / Device Groups / All Devices / SWITCH under Configuration&amp;gt; Security&amp;gt; TrustSec&amp;gt; Wired 802_1x &amp;gt;, but I not know how to access them since I have no clue what object to look for (it is not VlanId=select STR(u.vlanId) from VLANInterface u where u.owningEntityId = since this is only the management VLAN ID...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2016 13:57:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560856#M1417</guid>
      <dc:creator>mstraessle</dc:creator>
      <dc:date>2016-12-27T13:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: DB variable for retrieving an interface IP</title>
      <link>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560857#M1418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;Unfortunately I didn't bother sending an email because the documentation says they only recommend using their provided variables. I looked through the SQL tables in ncsDiag and didn't see anything interesting related to dot1x. Maybe the 'accessvlan' field in the 'vlanswitchportsettings' table gets dynamically updated once ISE has assigned one? Until Cisco publish the EJBQL model schema we'll be in the dark I'm afraid.&lt;/P&gt;&lt;P&gt;See attached screenshot - I'm not sure if that accessvlan is the configured one from 'switchport access vlan' or the dynamically assigned operational vlan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I can't be of much help. I did use the 'I wish this page would' feature for a different CLI template problem I had and Cisco did reply to me to say they've logged a feature request so maybe its worth logging one and seeing what happens!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2016 13:30:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/db-variable-for-retrieving-an-interface-ip/m-p/3560857#M1418</guid>
      <dc:creator>Dave Lewis</dc:creator>
      <dc:date>2016-12-29T13:30:14Z</dc:date>
    </item>
  </channel>
</rss>

