2 Replies Latest reply on Sep 11, 2019 11:23 AM by Lisa Keeler

    Integration points to query centralized Database

    Hitesh Jha
      Share This:

      Hello All,

      Could you please help me to understand the process in order to create the integration points.

      As per the document Integration points and queries are created automatically when a pattern that defines them is uploaded.

      which pattern we need to activate or else we have to create the custom pattern ?

       

      As of now I don't see any connection or create tab under the Manage>Integrations.

        • 1. Re: Integration points to query centralized Database
          Brian Morris

          What are you wanting to accomplish? Why do you need an integration point?

          • 2. Re: Integration points to query centralized Database
            Lisa Keeler

            Go to the Manage->Knowledge page, and click "Creating Patterns".

             

            Download this template:

             

             

            Then, edit it accordingly, filling in the $$abc$$ symbols.

            And, later, you will want to revise the logic of the pattern.

             

            Then upload your pattern.  After a successful upload, you will magically have an Integration appear under Manage-Integrations.

            The name of the integration point comes from what you put on the line in bold below.

             

            Here is the top of the sample pattern I had created from that template:

             

            tpl 1.14 module AssetInfoFromSQLTemplate;

             

            definitions AssetDatabaseDetails 1.0

              """Queries"""

             

              // The type of things to be defined in this block. Specifying

              // "sql_integration" means we access a single, centralised database that

              // is located on a host whose connection details are given under the

              // Discovery > Integration Points page. (Note that the template that

              // performs further discovery using a SQL database whose connection details

              // are given in the pattern uses "sql_discovery" instead).

              type := sql_integration;

             

              // The name of the Integration Point

              name := "lisa_integration_point";

             

              // Add one "define" block for each query you use.

              define getLocationOfHost

                """Return details of the location for the given hostname"""

                // The SQL query. The pattern example below assumes that this takes a

                // hostname parameter and returns name and address columns. The precise

                // query depends on the structure of the asset database, but an example is:

                //

                //   select name, address from hosts, locations where

                //   hosts.id_location = locations.id and hostname = %hostname%;

                query := "my fake sql statement";

             

                // The list of parameters required by the SQL query

                parameters := hostname;

              end define;

            end definitions;

             

            pattern HostLocation 1.0

              """

              When a Host is discovered, query the asset database for information on its

              location.

              """

              // Required overview section. Some tags must be defined.

              overview

                tags Lisa;

              end overview;

              // We trigger whenever a Host is created for the first time, or

              // confirmed on a subsequent discovery run, and we know its name.

              triggers

                on host := Host created, confirmed where hostname exists;

              end triggers;

              body

                // Perform the query on the database, passing in the hostname parameter.

                // If your query requires other parameters, you must specify them here.

                // Use connection := "..." to specify the name of connection to use.

                location_rows := AssetDatabaseDetails.getLocationOfHost(

                  hostname := host.hostname,

                  connection := "my_connection_name"

                );

             

             

             

            2 of 2 people found this helpful