Work with the license tracking database

The Tricentis License Usage Tracking database collects your licensing data and updates the information every minute. You can query this data and then create reports, for instance in Microsoft Excel. This functionality is available for Tricentis License Server version 2.0.0 or older.

To run queries, you need to use Elasticsearch. The installation of Elasticsearch version 6.5 is part of the Tricentis License Server installation.

Tricentis offers a prepared query: database-query.ps1, located at C:\Program Files\TRICENTIS\Tricentis License Server\LicenseUsage Statistics\database-queries. The Elasticsearch query in this file retrieves the following data over the entire time period in your database:

  • Timestamp

  • Host name

  • Host ID

  • License package name

  • Feature name

  • Number of licenses used

The more data is in your database, the longer the query takes. If you want to change the query, adapt the query file. For information on how to write Elasticsearch queries, see the Elasticsearch documentation.

Query the database

To query the database, follow the steps below:

  1. Ensure you are logged in to the machine that holds the license server.

  2. Create a .bat file and enter the following Windows PowerShell command:

    powershell.exe -File .\<query file name> -hostname "localhost" -port <databasePort> -outputFilePath "<path to result file>"

    • Replace <query file name> with the name of the query file.

      Note that this only works if you save the .bat file to the same directory that holds the query file. If you save the .bat file to a different directory, use -File "<path to the query file>".

    • Replace <databasePort> with the port you specified in the license server setup.

    • Replace <path to result file> with the desired path to the result file, for instance C:\Temp\OutputFile.json.

When you run the .bat file, Tricentis saves the result file to the specified path. The result is always a JSON file.

You are now ready to import the results into Microsoft Excel and create a report. For an example on how to do so, check the Tricentis Knowledge Base.