Creating a user-defined database query format


TrueSight Network Automation allows you to define new data import formats based on SQL queries. The DeviceImportFormatMap.xml file contains the definitions of all the import formats that are supported by the system.

This topic provide instructions on defining new device import formats based on SQL queries. Once you define these formats, they appear on the UI, and you can use them like any of the predefined formats.

Do the following:

  1. Copy the DeviceImportFormatMap.xml file from the BCAN_HOME/public/bmc/bca-networks/xml directory to the BCAN_DATA directory.
  2. Open the DeviceImportFormatMap.xml file with a text editor.
  3. Add a new section to the file similar to the following example. Modify the values emphasized in bold.

    <importFormat>
           <id>1000</id>
           <name>My New Database Format</name>
           <shortName>My New DB</shortName>
           <source>jdbc</source>
           <transformerClassName>
               com.bmc.bcan.engine.database.imports.GenericJdbcTransformer
           </transformerClassName>
           <jdbcQuery>
               <query>
                 SELECT EntityName as name,
                     IPAddress as address,
                     EntityOID as deviceType,
                     Description as description
                 FROM mainNodeDetails
                 WHERE EntityOID IS NOT NULL;
               </query>
               <columns>
                 <column>name</column>
                 <column>address</column>
                 <column type="oid">deviceType</column>
                 <column type="dynamicField">description</column>
               </columns>
           </jdbcQuery>
    </importFormat>
    The following table lists each of the tags in the preceding XML snippet.

  4. Save the modifications and restart the Network Automation web server service.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*