9. Quickstart - Reporting Setup WAPT Enterprise feature WAPT Enterprise feature

Indication

This page is a quickstart tutorial to get started with the WAPT Reporting module. For complete and detailed documentation (database structure, external PostgreSQL connection, Grafana dashboards, etc.), refer to the Utiliser la fonctions de requête dans WAPT page.

Note

Reporting is a feature of WAPT Enterprise. Please ensure you have the correct licence before starting this tutorial.

9.1. Overview

The WAPT Reporting module lets you write your own SQL queries against your fleet’s database, and display the results directly within the WAPT Console.

No one knows better than you what information you need. Reporting allows you to, for example:

  • List the machines on which a given piece of software is installed (even if it was not deployed through WAPT);

  • Identify hosts that haven’t been seen for a while;

  • Obtain statistics about your fleet (breakdown by OS, by machine type, etc.);

  • Create dynamic filters in the Inventory tab, based on the results of your queries.

Note

The WAPT PostgreSQL database is accessed in read-only mode from the Reporting module: your queries can therefore never modify, delete, or insert data. You can test freely without any risk of damaging your fleet.

9.2. How to import and create queries

9.2.1. Import an existing query

To begin with, we’re going to create a file in .json format, which we’ll call: inactive_hosts_8d.json.

contenu du fichier inactive_hosts_8d.json
[
    {
        "id": 17,
        "name": "Inactive hosts 8d",
        "query": "SELECT\n    uuid,\n    computer_name,\n    last_seen_on\nFROM hosts\nWHERE TO_TIMESTAMP(last_seen_on, 'YYYY-MM-DD') < CURRENT_TIMESTAMP - INTERVAL '8 days'\nORDER BY last_seen_on;",
        "settings": {
            "columns": [
                {
                    "text": "uuid",
                    "width": 250,
                    "visible": true,
                    "position": 0,
                    "propertyname": "uuid",
                    "chartsettings": ""
                },
                {
                    "text": "computer_name",
                    "width": 200,
                    "visible": true,
                    "position": 1,
                    "propertyname": "computer_name",
                    "chartsettings": ""
                },
                {
                    "text": "last_seen_on",
                    "width": 150,
                    "visible": true,
                    "position": 2,
                    "propertyname": "last_seen_on",
                    "chartsettings": ""
                }
            ],
            "sortcolumn": 2,
            "sortdirection": 1
        }
    }
]

Once you have created it, return to the WAPT console.

Go to Reporting tab (1)Import queries… (2)From a file (3), then select the file.

Menu option import from file

Select the inactive_hosts_8d.json (1) file from the directory where it was created, by clicking on Open (2).

Select query file

Import the query by selecting it (1) and then clicking on import selected queries (2):

Menu option import selected queries from file

Click to the new tab call: Inactive hosts since 8 days. (1) and save it (2).

Menu option save query

Enter a query name (1) and click OK (2).

Menu option input query name

Once the query is created, it appears in the left panel (1). To rerun a query, simply click the Execute button. (2) You have now tested importing queries via URL or file.

Menu option input query name

9.2.2. Créer sa première requête

To begin, go to Reporting tab (1)New query (2). A new tab opens called**New query** (3).

Create new query

We’re going to enter the following content into this new query:

SELECT
    computer_name,
    os_name,
    uuid,
    os_version
FROM hosts
WHERE os_name LIKE 'Windows 11%%'

The purpose of this query is to list all machines in the fleet that are running Windows 11.

Then, save the query (1), give it a name (2), and click OK (3).

save new query

Once the query is created, it appears in the left panel (1). To rerun a query, simply click the Execute button. (2)

Menu option input query name

9.3. Using the results

9.3.1. Result in the query window

The result is displayed directly in the query window. You can:

  • export it to a spreadsheet (Export to spreadsheet button, generates a .csv file);

  • duplicate it, share it, or export it to a file to hand off to a colleague.

9.3.2. Creating a filter in the Inventory tab

You can turn a query into a dynamic filter in the Inventory tab, to directly display the machines matching it.

  1. Make sure your query returns a column identifying each machine (typically host_id or uuid). (1)

  2. In the query result, right-click that column, then click Choose as Host UUID. (2)

  3. Save the query. (3)

create filter query
  1. Go to the Inventory tab (1), check More options (2) in the panel, then select your query in the filter SQL query field. (3).

display filtrer query

You now have a dynamic list of machines, based on the result of your query.

9.4. Going further

This page only covers getting started with Reporting. The complete documentation (Utiliser la fonctions de requête dans WAPT ) covers, among other things:

  • setting up Grafana dashboards connected to the WAPT database, for a visual overview of your fleet;

  • normalizing software names, to group under a single name software that appears differently depending on its version or architecture, making your version-tracking queries more reliable;

  • More query examples (machines by chassis type, most installed software, machines not seen for a long time, etc.).