This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Core Tasks

Step-by-step guides for common QMonitor tasks

This section provides step-by-step instructions for setting up and using QMonitor.

You will learn how to:

  • Install and configure an Agent
  • Register SQL Server instances
  • Monitor instance health and performance
  • Set up alerts and manage issues
  • Use dashboards to analyze data

Follow these guides to get the most out of QMonitor.

1 - Sign Up

Register your email address in QMonitor

Go to the login page at https://portal.qmonitor.app and click Register.

Create Account form Create Account form with email and password fields, human verification, and the Create Account button

Create your account

  1. Enter your email address.
  2. Choose a password of at least 20 characters and enter it again in Confirm Password. A password manager is recommended to generate and store your password.
  3. Complete the Verify you are human Cloudflare check.
  4. Select Create Account to submit the form.

If the human verification fails, complete the check again before resubmitting.

Confirm your email

After registration, QMonitor sends a confirmation email to the address you entered. Open the email and follow its link to verify your address. Allow a few minutes for delivery and check your spam folder if it does not arrive.

If you still cannot find the message, request another confirmation email from the Resend email confirmation page. After verifying your email, sign in to QMonitor with your credentials.

2 - Log In

Enter your credentials to access QMonitor

Follow these steps to log in to QMonitor:

QMonitor login page Login form with email and password fields, Remember me, and account links

  1. Enter your email address and password.
  2. Optionally check Remember me to stay signed in after closing your browser.
  3. Select Log in.

Use Sign up if you do not have an account, or Resend email confirmation if you need another verification email.

Two-Factor Authentication (2FA)

If you have enabled 2FA for your account:

  • You will see a prompt to enter a code
  • Open your authenticator app
  • Enter the code shown in the app

You can enable or disable 2FA on the Account page.

Forgot Your Password?

If you forgot your password:

  1. Click Forgot password? on the login page
  2. Check your email for a password reset link
  3. Follow the link to create a new password

We strongly suggest the use of a password manager.

3 - Set up an Organization

Create an Organization to start collecting data from your instances

When you log in to QMonitor for the first time you are met with a welcome page that will ask you if you want to create a new organization or join an existing one. In order to monitor and maintain SQL Server instances you will need to be part of an organization.

Create a new organization

When you create a new organization, you will be simply asked to provide a name for it. The name that you enter will be “sanitized” by QMonitor, in order to remove any special characters in the name that might make it hard to work with. The name that you entered will still be used as it is as the display name of you organization, but the internal name of the organization will be the sanitized one. QMonitor will also generate a code called “Organization Key”, that you will have to provide during the setup of a new agent. Please note down carefully both the organization name and the Organization key, as you will need them later. For this purpose, the use of a password manager is highly recommended. Before you proceed, you will have to confirm that your codes are successfully stored in a safe location, by clicking the corresponding checkbox on the form.

Another important piece of information required to create your organization is the location of the data: you can choose one of the available regions (EU and US for the time being, more coming in the near future). Please choose the region that matches your needs, not only in terms of latency and bandwidth, but also in terms of regulatory constraints. While we do not store any sensitive data, your company might be subject to specific policies that prescribe to store all the data inside the boundaries of a particular region. Please check with your CISO to make sure that you choose the correct option. There is currently no option to move your organization from one region to another.

When you are ready, click the “Create new organization” button. Creating an organization requires around 20 seconds: please wait until the process completes. You will be met with a welcome message and a quick help dialog window that provides information on how to register your instances and start monitoring them.

4 - Join an Existing Organization

Get an invite to an organization and use it to gain access

When you log in to QMonitor for the first time, you see a welcome page. This page asks if you want to create a new organization or join an existing one. You must be part of an organization to monitor and manage SQL Server instances.

Join an Organization

To join an existing organization, you need an invitation from the organization owner.

For Organization Owners: How to Invite New Users

  1. Go to the Members page in the organization settings
  2. Enter the email addresses of the users you want to invite
  3. Send the invitations

Important: New users must register for QMonitor before they can join your organization. They should:

  • Create a QMonitor account first
  • Then accept your invitation to join the organization

This is how your coworkers gain access to the organizations you create.

5 - Working with Agents

What are agents and what you can do with them

This section explains how to enroll and install an agent with ConfigWizardCmd, then register SQL Server instances for that agent and start data collection.

5.1 - Enroll an Agent

Enroll an agent with ConfigWizardCmd to start collecting metrics

An agent is the service that collects metrics from SQL Server instances and uploads them to QMonitor. An agent can collect metrics from multiple instances that it can reach, so organizations often use one agent per data center or network.

Enroll and install

Run ConfigWizardCmd.exe enroll on the machine that will host the agent. The command starts an enrollment request and opens the QMonitor portal. Sign in, select your organization, enter the agent name, and approve the request. Approval creates the agent in the organization; the CLI then receives its credentials and installs and starts the service. You do not need to create the agent separately in the portal first.

On a machine with no QMonitor agent installed, launching ConfigWizardCmd without arguments starts the same enrollment flow. See Enrolling and Managing Agents with ConfigWizardCmd for options and Linux instructions.

After enrollment completes, open the Instances page and register a SQL Server instance, assigning it to the agent created during enrollment. See Register a SQL Server instance.

On the Instances page, the agent’s status indicates whether it is running. Select the status to see details such as its host, service account, and software version. Agent management actions are also available from that page.

5.2 - Installation Options

Understand the different possible installation options

You do not need to install the agent on each instance that you want to monitor: it is not recommended to install an agent on the same machine of a monitored instance. On the other hand, while a dedicated machine specifically for the QMonitor agent is ideal, it is not a requirement. The agent itself is not a resource-intensive application and does not require vast amounts of CPU, RAM or disk.

The QMonitor agent runs on Windows and Linux and can also be run as a container: you are free to choose the installation target that fits your needs.

5.3 - Network Setup

Configure your network to allow traffic from the QMonitor agent

Before you install an agent, please review the network requirements and make sure that your setup fulfills them.

SQL Server Network setup

The QMonitor agent needs to connect to your SQL Server instances, so make sure that the machine that hosts the server has the appropriate network access to the TCP/IP ports the instance is listening on. This is usually port 1433 for default instances, but the default port can be changed and assigned statically or dynamically. Please check your instance network configuration to identify which ports to open on your servers.

Internet Network setup

The agent needs to contact 3 different cloud hosts:

gateway.qmonitor.app

The agent needs to upload all the metrics it collects to our servers in the cloud: please make sure that the machine where the agent runs can connect to the SSL port (443) on gateway.qmonitor.app. Please make sure that you configure your firewall to allow the connection to the host name rather than the IP address, as we use multiple servers in our gateway and your agent might be assigned to different IP addresses at different times of the day.

static.qmonitor.app

The agent periodically checks for updates by querying our servers for the latest available version of the software. When a new version is detected, your agent will have to download and install it from our software distribution network. In order to allow this process to complete successfully, please make sure that you configure your network to allow connections to the host static.qmonitor.app, again on port 443. The same advice stands for this host as well: please use the host name rather than the IP address when configuring your network, as we use a CDN network that might serve the contents from various source IP addresses.

api.qmonitor.app

The QMonitor agent also needs to contact the QMonitor APIs at api.qmonitor.app over port 443 to retrieve its configuration and perform API calls. Make sure that outbound HTTPS connections to this host are allowed.

The following diagram summarizes the network traffic between the agent and the various hosts it needs to connect to:

graph LR 
    SQL1["SQL Server Instance<br/>Port 1433 or custom"] 
    SQL2["SQL Server Instance<br/>Port 1433 or custom"] 
    Agent["QMonitor Agent<br/>(Your Network)"] 

    Gateway["gateway.qmonitor.app<br/>Port 443 (HTTPS)"] 
    Static["static.qmonitor.app<br/>Port 443 (HTTPS)"]
    API["api.qmonitor.app<br/>Port 443 (HTTPS)"]

    SQL1 -->|"Collect Metrics"| Agent
    SQL2 -->|"Collect Metrics"| Agent
    Agent -->|"Upload Metrics"| Gateway
    Agent <-->|"Download Updates"| Static
    Agent -->|"API Requests"| API

    style Agent fill:#4a90e2,stroke:#2e5c8a,stroke-width:2px,color:#fff
    style SQL1 fill:#5cb85c,stroke:#449d44,stroke-width:2px,color:#fff
    style SQL2 fill:#5cb85c,stroke:#449d44,stroke-width:2px,color:#fff
    style Gateway fill:#f0ad4e,stroke:#ec971f,stroke-width:2px,color:#fff
    style Static fill:#f0ad4e,stroke:#ec971f,stroke-width:2px,color:#fff
    style API fill:#f0ad4e,stroke:#ec971f,stroke-width:2px,color:#fff

On windows, you can test whether your agent machine is configured correctly by running this powershell script:

'gateway.qmonitor.app', 'static.qmonitor.app', 'api.qmonitor.app' | 
    Test-NetConnection -Port 443 | 
    Select ComputerName, TcpTestSucceeded

What you want to see is the following result:

ComputerName            TcpTestSucceeded
------------            ----------------
gateway.qmonitor.app                True
static.qmonitor.app                 True
api.qmonitor.app                    True

On Linux you can test using bash:

timeout 1 bash -c '</dev/tcp/gateway.qmonitor.app/443 && echo Port is open || echo Port is closed' || echo Connection timeout
timeout 1 bash -c '</dev/tcp/static.qmonitor.app/443 && echo Port is open || echo Port is closed' || echo Connection timeout
timeout 1 bash -c '</dev/tcp/api.qmonitor.app/443 && echo Port is open || echo Port is closed' || echo Connection timeout

The output should be “Port is open” for all three hosts.

If you see a different output, please investigate any connectivity issues with your network team.

5.4 - Agent Components

Agent components and log files

The QMonitor agent is comprised of multiple components, each writing to its own log file.

  • QMonitor agent - this is the main component and the entry point of the background service. It takes care of connecting to the QMonitor servers, retrieve the configuration and start the data collection accordingly. The executable is called Quantumdatis.QMonitor.Agent.exe and it is the one invoked by the windows service.

This component is located inside the QMonitor.Agent folder under the installation folder of QMonitor (usually c:\program files\QMonitor\QMonitor.Agent). The logs are located in the logs subfolder and may contain useful information to troubleshoot your agent setup. The logfiles follow the naming pattern <organization>_<agent>-log-<timestamp>.txt

  • Telegraf - this is the data collection agent, which connects to the SQL Server instances and runs the data collection queries. It also caches the metrics locally and uploads them regularly to our gateway in the cloud.

This component is located directly in the QMonitor installation folder and the executable is called telegraf.exe. The logs are found under the logs folder and follow the naming pattern telegraf_<organization>_<agent>.log

  • XeSmartTarget - This is a component that takes care of streaming the events from the monitored instances to our gateway in the cloud. The executable (xesmarttarget.exe) is found in the main installation path of QMonitor and its logs are found in the corresponding logs subfolder, with the naming pattern xesmarttarget_<organization>_<agent>.log

  • Autoupdater - This component ensures that your QMonitor agent stays always up to date. It runs in the background to query our servers for newer versions of the software and it downloads and runs the setup in case a new version is found. Two executables are involved: autoupdater.exe and updaterkickstarter.exe, both found in the main installation folder of QMonitor. The logs can be found in the logs directory.

5.5 - Installing the Agent

Installation steps for the QMonitor Agent

To start the QMonitor agent installation, download the setup kit for your operating system (Windows or Linux), copy it to the target machine, and run it. Running the agent in a container uses the same portal-approved enrollment but stores its credentials in a volume instead of installing a host service. See “Running the QMonitor agent in a container”. The installation copies files to the chosen installation directory and requires no user input except for that directory. Additional configuration is required to authenticate the agent to your organization and to run it as a background service.

Enrolling and installing the agent

Use ConfigWizardCmd on Windows or Linux to enroll and install an agent. Run ConfigWizardCmd.exe enroll on Windows or ConfigWizardCmd enroll on Linux. The CLI starts an enrollment request and opens the QMonitor portal; sign in, select the organization, enter an agent name, and approve the request. Approval creates the agent record. ConfigWizardCmd then receives its credentials, installs the service, and starts it. No separate ConfigWizard GUI or pre-created agent is required.

If the machine has no QMonitor agent installed, launching ConfigWizardCmd without arguments also starts enrollment. See Enrolling and Managing Agents with ConfigWizardCmd for options and details.

When the command completes, the agent appears on the Instances page. You can then register SQL Server instances and assign them to that agent.

Additional considerations

The service account is used to authenticate to SQL Server instances when using Integrated Security (Windows authentication). On Windows, ConfigWizardCmd uses a per-agent virtual account by default (NT SERVICE\qmonitoragent_<org>_<agent>). On Linux, it uses the service user selected during package installation, or a dedicated per-agent user. You can specify a different account during enrollment with --service-user; see the ConfigWizardCmd reference.

Integrated Security avoids storing SQL Server passwords. Windows virtual service accounts authenticate to remote SQL Servers using the computer account.

When ConfigWizardCmd completes setup, the agent starts and reports its state to QMonitor. It begins collecting data after SQL Server instances are registered and assigned to it. On the Instances page click the green/red icon next to an agent to view its state, service account, and agent version.

Setting up the agent on Linux

Enroll and configure the agent using ConfigWizardCmd. See Enrolling and Managing Agents with ConfigWizardCmd for options and examples.

On Linux, the agent cannot impersonate Windows users, so Integrated Security is not available. Entra (Managed Identity) authentication may be available if the Linux VM or container supports a managed identity.

Running the QMonitor agent in a container

On its first start, the container runs ConfigWizardCmd enrollment and prints an approval URL in its logs. Open the URL, sign in to QMonitor, select the organization, enter an agent name, and approve the request. Mount a persistent volume at /credentials so the enrolled agent’s credentials survive container restarts.

Keep the container image updated through your normal deployment process.

Example compose.yaml:

services:
  qmonitor-agent:
    image: qmonitor/agent:latest
    volumes:
      - qmonitor-agent-credentials:/credentials
    restart: unless-stopped

volumes:
  qmonitor-agent-credentials:

Start the container and follow its logs to get the approval URL:

docker compose up -d
docker compose logs -f qmonitor-agent

After enrollment succeeds, the first container exits; the restart policy starts it again with the saved credentials, and it then runs the agent.

5.6 - Enrolling and Managing Agents with ConfigWizardCmd

Enroll and manage QMonitor agents from the command line on Windows and Linux

ConfigWizardCmd enrolls and manages QMonitor agents on Windows and Linux. During enrollment, you approve the agent in the QMonitor portal; ConfigWizardCmd then receives its credentials and installs and starts its service.

Commands

CommandDescription
enrollRequests enrollment and installs and starts the approved agent.
listLists agent services installed on this machine.
start, stop, restartControls an installed agent service.
logsPrints the tail of an agent log.
set-service-userChanges the service account of an installed agent.
uninstallRemoves an agent service from this machine.
network-checkTests DNS, TCP, and TLS connectivity to QMonitor endpoints.
helpPrints the built-in help text.

Use ConfigWizardCmd.exe on Windows and ConfigWizardCmd on Linux. General syntax:

ConfigWizardCmd enroll [options]

On a machine with no existing QMonitor agent, launching ConfigWizardCmd without arguments starts enrollment automatically. Use the explicit enroll command when you want to start it directly.

Enrolling and installing an agent

Start enrollment:

ConfigWizardCmd.exe enroll

The CLI checks network connectivity, requests an enrollment code, and opens the approval page in your browser. Sign in to QMonitor, select the organization, enter the agent name, and approve the request. Keep the CLI running while it waits for approval. Approval creates the agent in your organization and issues credentials; ConfigWizardCmd receives them, installs the agent service, and starts it.

You do not need to create the agent separately in the portal before enrollment. Once the agent appears on the Instances page, register a SQL Server instance and assign it to this agent; see Register a SQL Server Instance.

Enrollment options

OptionDescription
--server <url>QMonitor API base URL; defaults to the configured value.
--service-user <account>Service account to use. Windows defaults to a per-agent virtual account; Linux uses the package-configured or per-agent service user.
--no-browserDo not open the approval page automatically; open the printed URL manually.
--containerEnroll a containerized agent and write credentials to /credentials without installing a host service.

For example, to enroll and specify a Windows service account:

ConfigWizardCmd.exe enroll --service-user "DOMAIN\svc_qmon"

ConfigWizardCmd prompts for a password when the selected Windows service account requires one. For a headless Linux machine, use --no-browser and open the printed enrollment URL in a browser on another machine.

Enrolling an existing agent with the same organization and agent name is a re-enrollment: it replaces the previous connection credentials. Use it when intentionally re-registering or moving an agent.

Listing installed agents

List the agent services installed on this machine:

ConfigWizardCmd.exe list

Starting, stopping, and restarting agents

Specify the organization and agent name for service-control commands:

ConfigWizardCmd.exe start --org MyOrg --agent Monitoring01
ConfigWizardCmd.exe stop --org MyOrg --agent Monitoring01
ConfigWizardCmd.exe restart --org MyOrg --agent Monitoring01

These commands interact with the operating-system service manager.

Reading agent logs

Read the last 100 lines of an agent log:

ConfigWizardCmd.exe logs --org MyOrg --agent Monitoring01 --tail 100

The --tail option is optional and defaults to 50 lines.

Changing the service account

Use set-service-user to change the account used by an installed agent:

ConfigWizardCmd.exe set-service-user --org MyOrg --agent Monitoring01 --service-user "DOMAIN\svc_qmon"

ConfigWizardCmd prompts for a password when the selected account requires one. The service is stopped, reconfigured, and restarted. This does not re-enroll the agent.

Uninstalling an agent

Remove an agent service from this machine:

ConfigWizardCmd.exe uninstall --org MyOrg --agent Monitoring01

Uninstalling the service does not delete the agent record from your QMonitor organization.

Checking network connectivity

Check connectivity to QMonitor endpoints:

ConfigWizardCmd.exe network-check

The check tests DNS resolution, TCP connectivity on port 443, and the TLS handshake. Use it to troubleshoot firewalls, proxies, and outbound network restrictions.

6 - Register a SQL Server Instance

Add a SQL Server Instance to QMonitor

First run ConfigWizardCmd.exe enroll and approve the request in the QMonitor portal. Approval creates the agent in your organization, and ConfigWizardCmd installs and starts its service. Once the agent appears on the Instances page, register the SQL Server instance and assign it to that agent.

Click the “New Instance” button at the top. You will be taken to a page where you can enter the details for your instance.

Connection String

The most important information is the connection string that the agent uses to contact and query your SQL Server instance. Click the edit button next to the connection string to open a dialog that helps you enter all required information. If you already have a complete connection string, you can paste it in the dialog.

  • Instance name: The name of the SQL Server instance. For default instances, this is the server name where SQL Server is running. For named instances, use the format server\instance. The host name you enter must be resolvable by DNS on the machine where the agent runs. Make sure name resolution works correctly. Use fully qualified domain names (FQDN) if required by your network setup.
  • Port: (Optional) Enter the port number if your SQL Server instance is not running on port 1433 and the instance name cannot be resolved to a TCP port by the SQL Server Browser service. You can leave this field blank most of the time.
  • Authentication: QMonitor supports three authentication methods:
    • SQL Server Authentication: Uses the username and password you enter in the form. Your credentials are part of the connection string and stored encrypted in our database.
    • Active Directory - Integrated (Windows Authentication): The easiest and safest option. The agent contacts the SQL Server instance using the Windows service account it runs under. No passwords need to be entered or stored.
    • Active Directory - Managed Identity: Uses an Azure Managed Identity to connect to SQL Server instances. This is also a safe option for running the QMonitor agent on an Azure VM or in an Azure Container App with a User-Assigned Managed Identity. See the documentation for Azure VMs and Azure Container Apps to learn about configuring a Managed Identity for your services.
  • Additional connection parameters: Enter any connection string properties that cannot be entered in a specific field. The connection string format must comply with the .NET connection string format (property=value). For a complete list of properties and values, see the .NET documentation.
    If you have an existing connection string to paste, enter it here. It will be parsed and all properties will be automatically placed in the corresponding text fields.

When your connection string is ready, click the Verify button on the right. A dialog window will appear with the validation results.

Many aspects are checked at this stage:

  • Can Connect: Can the agent connect to the instance? If not, the error message is displayed in this window.
  • XE Session: QMonitor uses Extended Events to capture meaningful events from the server, such as deadlocks, blocking events, and errors. The agent creates and updates its own Extended Events session, called qmonitor: this is the only change the agent makes on the instance, and it requires ALTER ANY EVENT SESSION (ALTER ANY DATABASE EVENT SESSION on Azure SQL Database), granted by the setup script. Without it the agent keeps the existing session but cannot update it. On Amazon RDS for SQL Server the agent manages the session as well (run the setup script as the master user); RDS Express edition does not support Extended Events. See the “Set up your SQL Server instance” section for more information.
  • Is Sysadmin: QMonitor can work without sysadmin role membership. However, sysadmin permissions ensure that the agent has access to all the DMVs it will query. It also ensures that the agent and its components, such as the Extended Events session, stay up to date. Sysadmin is not required to run jobs: jobs, autofixes and remediations are executed by the QMonitor Operator when the agent has one.
    If you use a login without sysadmin permissions, you are responsible for granting all required permissions. QMonitor provides a setup script for this purpose. See the “Set up your SQL Server Instance” section for a detailed breakdown of the script and how to use it to prepare your instance for monitoring.
  • Permissions: In this section, you can check whether the QMonitor agent has access to all required DMVs and system tables for monitoring.
    • Sysschedules: Read access required to monitor SQL Server Agent jobs
    • Sysjobschedules: Read access required to monitor SQL Server Agent jobs
    • Syscategories: Read access required to monitor SQL Server Agent jobs
    • Sysjobs: Read access required to monitor SQL Server Agent jobs
    • Sysalerts: Read access required to monitor SQL Server Agent jobs
    • SysmailConfiguration: Read access required to monitor SQL Server Agent jobs
    • Syssessions: Read access required to monitor SQL Server Agent jobs
    • Sysjobactivity: Read access required to monitor SQL Server Agent jobs
    • Sysjobhistory: Read access required to monitor SQL Server Agent jobs
    • AgentDatetime: Read access required to monitor SQL Server Agent jobs
    • CalculateAvailableSpace: This is a scalar function created by QMonitor in the master database to calculate available space on database files. This shows as Ok if the function exists and the agent has permissions to invoke it.
    • ConnectAnyDatabase: This server-level permission allows the QMonitor agent to connect to all user databases in the instance to query database-specific DMVs. This permission does not grant access to user tables inside databases.
    • ViewServerState: This server-level permission allows QMonitor to query many DMVs to inspect the instance state.
    • ViewAnyDefinition: This server-level permission controls access to object definitions in all databases. Does not grant permissions to read data in user databases.
    • AlterAnyEventSession: Lets the agent create and update its qmonitor Extended Events session (AlterAnyDatabaseEventSession on Azure SQL Database). Missing shows a warning, not an error: monitoring keeps working with the existing session.

Other instance information

  • Name: This field is read-only. It contains the name that the instance returns when you query the @@SERVERNAME property. You cannot change this name or use a network alias like a CNAME record in your DNS. However, you can use an alias in the connection string.
  • Sysadmin warning: When the QMonitor agent connects using a sysadmin login, a warning suggests using a less privileged login. It does not block monitoring or jobs.
  • Engine Edition: This field is also read-only. It contains the engine edition, as returned by SERVERPROPERTY('EngineEdition').
  • Edition: Read-only. Contains the edition of this SQL Server instance, as returned by SERVERPROPERTY('Edition'). See the page for SERVERPROPERTY for more information.
  • Description: Enter a description of your SQL Server instance in this field. Use a meaningful description that helps you search the list of instances and document what the instance is used for.
  • Tags: You can add tags to your instance to organize and categorize it. Add as many tags as you want by clicking the “New Tag” button and typing the text for the tag. Remove existing tags by clicking the “X” button on the tag itself. Tags help document your instance and can change how Issues are created on the instance, overriding default behavior for specific tags. See the Issues section to learn how tags work.
  • Group: Instances can be added to one group, which can be part of another group. Access the groups page from the Instances page to create a tree of groups to categorize your instances.
  • Agent: Select the agent created during enrollment from the drop-down list. Changing the agent after adding the instance requires a new validation process. During validation, the agent will verify it can contact the instance and query the required monitoring DMVs.
  • Enabled: When this box is checked, QMonitor will monitor the instance. When unchecked, no metrics will be collected.
  • Obfuscate SQL Text: Check this box if you want the text of all SQL commands processed to remove all constants that may contain sensitive data. For example, an application might run commands like this:
    INSERT INTO Customers (id, name) VALUES (1,'Quantumdatis')
    
    This SQL text could reveal that Quantumdatis is your customer. By obfuscating the SQL text, the command is captured like this:
    INSERT INTO Customers (id, name) VALUES (1,'<value>') 
    

Considerations for Always On availability groups

When you register a SQL Server instance in QMonitor, make sure you are not adding an Always On listener. QMonitor will not allow you to add a listener. You must add the instance where the AG is defined instead. To check the state of the AG with the HA dashboard, we strongly recommend adding all the nodes in the AG setup.

7 - Custom Dashboards

Build your own Grafana dashboards on top of QMonitor’s Metrics API.

Custom Dashboards let you create your own Grafana dashboards and charts, using the metrics QMonitor already collects for your organization. They live only in your organization, read only your organization’s data and are only visible to your users.

Creating a custom dashboard

  1. In the QMonitor side menu, open Custom Dashboards → Manage Dashboards.
  2. Type a name and click New dashboard. The dashboard opens in edit mode.
  3. Add a panel. The data source is already set to Metrics and cannot be changed: every custom dashboard reads from this single, read-only source.
  4. In the panel query, keep the Infinity query type and set the URL to / followed by a measurement name (see below).

Manage Dashboards lists your custom dashboards and lets you:

  • Export one as a JSON file;
  • Delete one;
  • Import a JSON file exported from QMonitor as a new dashboard, for example to reuse a dashboard of another organization: export it there, switch organization, import it here.

An import fails if a dashboard with the same name already exists.

To see what you can query, open Custom Dashboards → Metrics catalog: it lists every measurement with its fields and tags, the monitored instances, and a preview of the data.

How the Metrics API works

You never write a raw database query. You pick a measurement (one of the standard ones below, or one of your organization’s own Custom Queries) and pass structured parameters. QMonitor builds a safe, read-only query against your organization’s data.

The data source already points at the API, so in a panel the URL is just / and the measurement name:

/custom_db_size

Use Grafana’s time macros so the panel follows the dashboard time picker:

/sqlserver_cpu?timeFrom=${__from}&timeTo=${__to}&aggregation=mean

Query parameters

ParameterDescription
timeFrom, timeToTime range: epoch milliseconds or ISO-8601. With ${__from} and ${__to} Grafana passes the dashboard time range and handles the time zone for you. Dates written by hand are read as UTC unless they carry an offset. from / to also work. Without them the last hour is returned; a value that cannot be read, or a timeFrom after timeTo, returns an error.
aggregationAggregation applied to every field: mean (default), max, min, sum, last, first, count, median. Only one per request: to get, say, mean and max, add two queries to the panel.
intervalAggregation bucket, in seconds. Optional; by default it follows the time range (1 h: 1 min, 24 h: 5 min, 3 days: 10 min, 7 days: 30 min, longer: 1 h). It is never below the measurement’s interval shown in the catalog, nor below 60 seconds.
fieldsComma-separated list of fields to return. Optional; defaults to all fields of the measurement.
tagsComma-separated list of tags to group by. Optional; defaults to all tags of the measurement, so every instance gets its own series.
filter.<tag>Keep only some tag values, e.g. filter.sql_instance=SRV01:MSSQL. Several values are comma-separated (filter.sql_instance=SRV01:MSSQL,SRV02:MSSQL) and match any of them; repeat the parameter for more tags. An empty value is ignored.

You can write the parameters directly in the URL, as in the examples below, or add them one by one in the Infinity query under Headers, Request params → URL Query Param. Always pass timeFrom=${__from}&timeTo=${__to}, otherwise the panel shows only the last hour.

Examples

CPU trend of every instance: one line per instance, one point every few minutes depending on the time range.

/sqlserver_cpu?timeFrom=${__from}&timeTo=${__to}&fields=sqlserver_process_cpu&tags=sql_instance

Rows come back one per instance and time bucket. To get one line per instance in a Time series panel, add the Partition by values transformation on sql_instance.

Instances chosen from a dashboard variable: create a variable named instance of type Query on the Metrics data source with URL /instances (single or multi-select, “All” included), then filter on it. Use the :csv format so a multi-select passes all selected values.

/sqlserver_cpu?timeFrom=${__from}&timeTo=${__to}&fields=sqlserver_process_cpu&filter.sql_instance=${instance:csv}

Azure SQL elastic pools: the values of any tag can feed a variable with URL /<measurement>/tags/<tag>, for example /sqlazure_resource_stats/tags/elastic_pool_name for a pool variable, then:

/sqlazure_resource_stats?timeFrom=${__from}&timeTo=${__to}&fields=avg_cpu_percent&tags=database_name&filter.elastic_pool_name=${pool:csv}

Current value for a Stat or Gauge panel: last returns the latest value of each bucket; set the panel calculation to Last *.

/sqlserver_server_properties?timeFrom=${__from}&timeTo=${__to}&fields=uptime,db_online&tags=sql_instance&aggregation=last

Peaks instead of averages: with mean short spikes disappear on long ranges; max keeps them. Here every bucket is 5 minutes long.

/sqlserver_cpu?timeFrom=${__from}&timeTo=${__to}&fields=sqlserver_process_cpu&filter.sql_instance=${instance:csv}&aggregation=max&interval=300

One performance counter: sqlserver_performance contains hundreds of counters, so narrow it with filters, otherwise the query returns too many series.

/sqlserver_performance?timeFrom=${__from}&timeTo=${__to}&fields=value&tags=sql_instance&filter.sql_instance=${instance:csv}&filter.object=SQLServer:Buffer Manager&filter.counter=Page life expectancy&aggregation=last

Wait statistics of one category, split by wait type:

/sqlserver_waitstats?timeFrom=${__from}&timeTo=${__to}&fields=wait_time_ms&filter.sql_instance=${instance}&filter.wait_category=CPU&tags=wait_type&aggregation=max

One of your Custom Queries: same parameters, with the fields and tags you declared. Here the size of each database of an instance:

/custom_db_usage?timeFrom=${__from}&timeTo=${__to}&fields=data_mb,log_mb&tags=database_name&filter.sql_instance=${instance}&aggregation=last

ISO dates: useful when the time range comes from another source. Use UTC (Z): a + in an offset such as +02:00 must be written as %2B in the URL.

/sqlserver_cpu?timeFrom=2026-10-01T00:00:00Z&timeTo=2026-10-02T00:00:00Z&fields=sqlserver_process_cpu&tags=sql_instance

If a request is not valid the panel shows the reason, for example an unknown field or tag, an unreadable date, a time range longer than 30 days, or too many series.

Endpoints

URLReturns
/<measurement>The data of a measurement, with the parameters above.
/catalogEvery measurement available to your organization, with fields and tags.
/instancesThe enabled instances of your organization (sql_instance), for dashboard variables.
/<measurement>/tags/<tag>The values of one tag of a measurement, for dashboard variables.

All of them return a JSON array (Infinity “table” format).

A measurement query returns one object per time bucket, per series: the tags you grouped by, organization, a time field (ISO-8601, UTC) and each requested field already aggregated. If a Time series panel reports that the data has no time field, add the Convert field type transformation and set time to Time.

[
  { "sql_instance": "SRV01:MSSQL", "organization": "acme", "time": "2026-10-20T10:00:00Z", "sqlserver_process_cpu": 2.3 },
  { "sql_instance": "SRV01:MSSQL", "organization": "acme", "time": "2026-10-20T10:01:00Z", "sqlserver_process_cpu": 2.1 }
]

Which tag columns appear depends on tags (by default, all of the measurement’s tags); which value columns appear depends on fields (by default, all of the measurement’s fields).

The catalog returns one object per available measurement:

[
  {
    "source": "standard",
    "measurement": "sqlserver_cpu",
    "description": "SQL Server vs other-process CPU usage (%).",
    "interval": "60s",
    "fields": ["sqlserver_process_cpu", "other_process_cpu"],
    "tags": ["sql_instance", "host"]
  }
]

source is standard for native measurements or custom for your organization’s own Custom Queries; interval is how often the measurement is collected: buckets are never smaller than this, nor than 60 seconds.

/instances and /<measurement>/tags/<tag> return one object per value, named after the tag:

[
  { "sql_instance": "SRV01:MSSQL" },
  { "sql_instance": "SRV02:MSSQL" }
]

Standard measurements

These native QMonitor measurements are available to every organization. In a panel, type / and the measurement name as the URL.

MeasurementDescriptionFieldsTags
sqlserver_cpuSQL Server vs other-process CPU usage (%).sqlserver_process_cpu, other_process_cpusql_instance, host
sqlserver_waitstatsWait statistics by wait type.wait_time_ms, waiting_tasks_count, max_wait_time_mssql_instance, wait_type, wait_category
sqlserver_database_ioPer-file I/O: reads, writes, bytes and latency.reads, writes, read_bytes, write_bytes, read_latency_ms, write_latency_mssql_instance, database_name, logical_filename, file_type
sqlserver_volume_spaceDisk volume space (bytes).total_space_bytes, available_space_bytes, used_space_bytessql_instance, volume_mount_point
sqlserver_performanceRaw performance counters (filter by the counter/instance tags).valuesql_instance, object, counter, instance
sqlserver_memory_clerksMemory usage by memory clerk type (KB).size_kbsql_instance, clerk_type
sqlserver_server_propertiesInstance properties: uptime, cpu count, memory, database counts.uptime, cpu_count, server_memory, db_online, db_offlinesql_instance, host
sqlazure_resource_statsAzure SQL resource usage (%).avg_cpu_percent, avg_data_io_percent, avg_log_write_percent, dtu_consumption_percentsql_instance, database_name, elastic_pool_name

Your organization’s own Custom Queries appear in the catalog alongside these, with the measurement, fields and tags you defined for them.

Limits

To keep the shared platform healthy, each query is capped: the time range cannot exceed 30 days, each query must complete within 3 seconds, data is always aggregated into buckets of at least 60 seconds, and a single query returns at most 10,000 points per series and at most 50 series. When a range would exceed 10,000 points the bucket is widened automatically, so the data comes back aggregated instead of cut. More than 50 series returns an error: narrow it with filter.<tag> or group by fewer tags.

Custom Queries for dashboards

A Custom Query appears in the catalog as soon as it is enabled; it starts producing data once it is assigned to an agent, after one collection interval. A few rules keep it working:

  • Return numbers as integer or float: wrap decimals in CAST(... AS float), otherwise they are stored as text.
  • Never change the type of an existing column: rows with a different type are discarded. To change it, give the column a new name.
  • Name the instance like the standard measurements: REPLACE(@@SERVERNAME, CHAR(92), ':') AS sql_instance.
  • On Azure SQL Database objects such as sys.master_files are not available: run that part only on other editions with IF SERVERPROPERTY('EngineEdition') <> 5 EXEC('...').

8 - Set up your SQL Server instance

Steps required to prepare the inatance for monitoring

QMonitor agents are monitoring your instances by running queries against multiple DMVs and system tables at regular intervals. Before you can add an instance to QMonitor, you will need to set up the instance in order to grant the required permissions and create additional objects such as the Extended Events session “QMonitor”.

The read access to those DMVs is granted either through sysadmin role membership or through grants on the individual objects.

QMonitor does not strictly require sysadmin role membership to collect the bare minimum information to populate the dashboards with performance metrics: if you decide not to grant sysadmin role membership to the QMonitor agent login, you can still monitor your instances by granting permissions on the individual DMVs and system tables. Additional permissions may be required to perform daily checks or to execute QMonitor jobs.

QMonitor offers a setup script that you can download from the Instances page: you can load the script in Management Studio to review the actions it performs and provide the parameters to set up the instance correctly.

At the very top of the script, you can provide the values for three required variables:

  • @LoginName: name of the login used by the QMonitor agent to connect to the SQL Server instance. This can be a Windows login, a SQL Server login or an Azure Managed Identity, depending on your setup. If the login is not present, it will be created.
  • @Password: please enter here the value of the password to use to authenticate SQL Server logins. If you leave this variable empty, it will be interpreted as indicating a Windows login or a Managed Identity. If you want to use an existing SQL Server login, you can enter any value for this variable and it will be ignored.
  • @Sysadmin: set this variable to ‘Y’ in order to grant sysadmin server role membership to the login indicated in the @LoginName variable. This is the easiest option, which requires the least maintenance on your side. If you want to avoid granting sysadmin role membership, set this variable to ‘N’ and the remainder of the script will take care of granting all the permissions required to collect performance metrics.

Once you provided values for all the three variables you can execute the script and review the results. If any error is returned from SQL Server, please review it, correct the cause and execute once again.

When the script executes successfully, the instance is ready to be added to QMonitor and the verification dialog will display all the checks as “Ok”. The check for sysadmin privileges may still display as “Ko” if you decided not to grant sysadmin role membership: you will still be able to proceed with the registration of the instance.

9 - QMonitor Hub

Use QMonitor data from AI assistants, Excel, PowerShell and your own tools, without handling credentials.

The QMonitor Hub is a small program you run on your own Windows or Linux computer. You approve it once from QMonitor, then local tools can read the monitoring data of all your organizations through it:

  • AI assistants such as Claude or GitHub Copilot CLI, through the Model Context Protocol (MCP);
  • Excel / Power Query, PowerShell and your own applications, through a local HTTP address.

The hub stores its own access key safely on your computer and renews it automatically, so none of these tools ever needs a QMonitor password or key. Through it they see the same data as the QMonitor dashboards, and while it runs the hub checks your issues every 10 minutes, so your AI assistant can review the new ones and propose fixes.

%%{init: {'theme':'base','flowchart':{'padding':28},'themeVariables':{'primaryTextColor':'#0F172A','lineColor':'#64748B','edgeLabelBackground':'#FFFFFF','clusterBkg':'#F8FAFC','clusterBorder':'#CBD5E1'}}}%%
flowchart LR
    subgraph PC["💻 Your PC"]
        AI["🤖 AI assistant<br/>Claude · Copilot CLI"]:::client
        XL["📊 Excel · PowerShell<br/>your applications"]:::client
        HUB["🧩 QMonitor Hub"]:::hub
        KEY[("🔑 Protected<br/>key store")]:::secret
    end
    QM["☁️ QMonitor<br/>api.qmonitor.app"]:::svc

    AI -- "MCP" --> HUB
    XL -- "http://localhost:5310" --> HUB
    HUB <--> KEY
    HUB == "HTTPS" ==> QM

    classDef client fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E
    classDef hub fill:#EDE9FE,stroke:#7C3AED,stroke-width:2px,color:#2E1065
    classDef secret fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F
    classDef edge fill:#FFE4E6,stroke:#E11D48,stroke-width:2px,color:#881337
    classDef svc fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D
    classDef data fill:#E2E8F0,stroke:#475569,stroke-width:2px,color:#1E293B
    classDef portal fill:#FCE7F3,stroke:#DB2777,stroke-width:2px,color:#831843
    style PC fill:#F0F9FF,stroke:#0284C7,stroke-width:2px,color:#0C4A6E

Requirements

  • Windows 10/11 or Windows Server 2016+, 64-bit, or Linux 64-bit (Ubuntu 22.04+, Debian 12+ or similar).
  • Access to https://api.qmonitor.app (HTTPS, port 443).
  • A QMonitor user, who approves the hub with their own account.

One hub, all your organizations

A hub belongs to the QMonitor user who approves it, not to an organization. It reads the organizations that user belongs to, checked at every request: when you join a new organization the hub sees it at once, when you leave one it stops seeing it. Issues and instance status come from all your organizations, each row with its organization; metrics, instances and a single issue belong to one organization: tools ask for organization when you have more than one (list_organizations lists them).

Install and enroll

  1. Download the installer from QMonitor: Settings → Manage my Hub, then install the hub:

    • Windows: run QMonitorHub-<version>.exe as the user that will use the hub. It includes .NET 10 and installs it only if missing (Windows asks for administrator rights once, for .NET only); the hub itself is installed for your user, in %LOCALAPPDATA%\Programs\QMonitor Hub, and added to that user’s PATH, so QMonitorHub works from any command prompt opened after the installation.

    • Linux (Debian/Ubuntu):

      sudo apt install ./qmonitorhub_<version>_amd64.deb
      

      On RHEL, Rocky, Alma or Fedora use the .rpm:

      sudo dnf install ./qmonitorhub_<version>_x86_64.rpm
      

      The command is qmonitorhub.

  2. Open a command prompt or terminal as the user that will use the hub and run:

    QMonitorHub enroll
    
  3. Your browser opens the Enroll QMonitor Hub page (log in if asked). On a Linux server without a browser, open the address the hub prints on another computer. Check the user, computer and organizations shown and click Approve Hub.

  4. Back in the command prompt the hub confirms it is enrolled. Done: you never need to approve it again.

Check it at any time with:

QMonitorHub status

Each user on each computer is a separate hub, with its own key.

Commands

CommandWhat it does
QMonitorHub enrollConnects the hub to your QMonitor account (once)
QMonitorHub statusEnrollment, organizations, key expiry, connection to QMonitor, new issues waiting for review, version, folders
QMonitorHub mcp --stdioMCP server for AI assistants: the assistant starts it (below)
QMonitorHub serve --httpLocal HTTP API for Excel, PowerShell and applications (below)
QMonitorHub logsLast lines of the log (--tail 200 for more, --open to open the folder) (below)
QMonitorHub updateInstalls the latest version (below)
QMonitorHub versionInstalled version
QMonitorHub helpAll commands, options and examples

Use it from an AI assistant (MCP)

The assistant starts the hub by itself. Register it once (on Linux use /usr/bin/qmonitorhub as the command):

Claude Code

claude mcp add qmonitor -- "%LOCALAPPDATA%\Programs\QMonitor Hub\QMonitorHub.exe" mcp --stdio

Claude Desktop (claude_desktop_config.json) and other MCP clients:

{
  "mcpServers": {
    "qmonitor": {
      "command": "C:\\Users\\<you>\\AppData\\Local\\Programs\\QMonitor Hub\\QMonitorHub.exe",
      "args": ["mcp", "--stdio"]
    }
  }
}

P.S. You might need to launch claude mcp add --scope user qmonitor -- QMonitorHub mcp --stdio to effectively register it

GitHub Copilot CLI (~/.copilot/mcp-config.json):

{
  "mcpServers": {
    "qmonitor": {
      "type": "stdio",
      "command": "C:\\Users\\<you>\\AppData\\Local\\Programs\\QMonitor Hub\\QMonitorHub.exe",
      "args": ["mcp", "--stdio"],
      "tools": ["*"]
    }
  }
}

P.S. For GitHub Copilot, we recommend launching the /mcp add command and following the guided procedure.

Then just ask, for example: “Which QMonitor issues are open on SRV01?”, “Show the CPU of SRV01 in the last 24 hours” or “Is the CPU of SRV01 today higher than yesterday?”. The hub also gives the assistant a short method for investigating SQL Server problems, and marks which tools change something.

ToolWhat it does
list_organizationsOrganizations the hub reads; the other tools take organization when there is more than one
list_metricsAll the data behind the QMonitor dashboards: performance metrics, SQL Server events (errors, blocking, deadlocks, timeouts), running queries and query statistics, Agent jobs, backups, Always On, Azure, long-term history; with fields, tags and the unit of the fields where it is known
list_instancesMonitored SQL Server instances
get_metricData of a metric: time series (up to 30 days, 400 for the long-term history) or, for events, queries and jobs, the latest rows, filtered on any field (equal, different, contains, greater/less than), page by page or counted per interval. Together with the data it says which interval and aggregation were used and whether more rows are available
compare_metricA metric in a period compared with another period of the same length (by default the one just before): current value, baseline, change and change in %
list_instance_statusMonitored instances with their status (Online, Offline…), edition and version
list_issue_statsOpen issues by rule and severity, and the daily trend
list_open_issuesOpen issues of all your organizations, newest first, each with its organization
get_issueDetails of an issue and of the rule that raised it
get_issue_contextHistory of the same issue in the last 30 days and the rule documentation
list_active_alertsMonitoring rules currently enabled, with thresholds
list_new_issuesIssues opened since the last check, waiting for review (below)
acknowledge_issuesRemoves reviewed issues from that list (it does not close them in QMonitor)
list_databasesDatabase inventory (portal Inventory page)
close_issue, reopen_issueCloses an issue with a note, or reopens it
exclude_issueExcludes the rule of an issue for an instance, database, object, tag or server group, optionally closing the matching issues
list_exclusions, remove_exclusionLists the exclusions and removes one

Change issues from the assistant

close_issue, reopen_issue, exclude_issue and remove_exclusion are disabled by default. An organization owner enables them per user in Settings → Organization → Members, column Hub can edit issues. Demo users cannot use them. The changes are recorded with that user.

Use it from Excel, PowerShell or your applications (HTTP)

Start the local API and leave the window open:

QMonitorHub serve --http

It answers only on this computer, at http://localhost:5310 (change the port with --Hub:HttpPort=5320).

AddressReturns
/statusHub name, your user, the organizations it reads and key expiry
/metrics/catalogMetrics you can read, with fields and tags
/metrics/instancesMonitored SQL Server instances
/metrics/<measurement>Data of a metric: same parameters as Custom Dashboards (timeFrom, timeTo, fields, tags, aggregation, interval, filter.<tag>), plus limit for events, queries and jobs (latest rows, max 500)
/metrics/<measurement>/tags/<tag>Values of a tag

With more than one organization the /metrics/... addresses need organization=<name> (names in /status), for example /metrics/instances?organization=acme. | /issues/by-predicate, /issues/by-tag | Open issues by rule or by tag (optional instance) | | /issues/daily-trend | Issues opened/closed per day (optional from, to, instance) | | /instances/status | Monitored instances with their status, edition and version | | /issues/new | Issues opened since the last check, waiting for review |

All of them return JSON.

PowerShell

Invoke-RestMethod "http://localhost:5310/metrics/sqlserver_cpu?timeFrom=2026-10-20T00:00:00Z&timeTo=2026-10-21T00:00:00Z&fields=sqlserver_process_cpu&tags=sql_instance"

Excel (Power Query): Data → Get Data → From Other Sources → Blank Query, then Advanced Editor:

let
    Source = Json.Document(Web.Contents("http://localhost:5310/metrics/sqlserver_cpu?timeFrom=2026-10-20T00:00:00Z&timeTo=2026-10-21T00:00:00Z&fields=sqlserver_process_cpu&tags=sql_instance")),
    Table = Table.FromRecords(Source)
in
    Table

Choose Anonymous when Excel asks how to connect: the hub handles access to QMonitor.

Your own application (any language with an HTTP client). Plain GET requests to http://localhost:5310, no credentials: don’t send an Origin header (requests that look like they come from a web page are refused). Example in Python, standard library only:

import json
import urllib.parse
import urllib.request

HUB = "http://localhost:5310"

def get(path, **params):
    url = HUB + path + ("?" + urllib.parse.urlencode(params) if params else "")
    with urllib.request.urlopen(url, timeout=60) as response:
        return json.load(response)

print(get("/status"))
for issue in get("/issues/by-predicate"):
    print(issue)
cpu = get("/metrics/sqlserver_cpu", timeFrom="2026-10-20T00:00:00Z", timeTo="2026-10-21T00:00:00Z",
          fields="sqlserver_process_cpu", tags="sql_instance")
print(len(cpu), "rows")

Errors come back with an HTTP status, and a JSON {"error": "..."} body when there is a message: 400 invalid parameters, 403 request refused (not local or from a web page), 429 too many requests (more than 120 per minute), 503 hub not enrolled.

New issues and AI-assisted fixes

While mcp --stdio or serve --http runs, the hub checks your open QMonitor issues every 10 minutes and keeps the list of the new ones (opened after it started watching) on your computer. Your AI assistant reads them with list_new_issues, investigates each one with the other tools (issue details and history, metrics, events, queries, jobs) and, when the cause is clear, proposes a fix to you: T-SQL or steps, risks, how to verify it. Nothing is executed by the hub or by QMonitor: you decide whether to apply it. Reviewed issues are removed from the list with acknowledge_issues.

For example, ask: “Check the new QMonitor issues and tell me which ones you can fix and how.”. Whether the assistant does it only when you ask or on a schedule depends on the assistant you use.

The interval can be changed in your settings file (%LOCALAPPDATA%\QMonitorHub\appsettings.json on Windows, ~/.local/share/QMonitorHub/appsettings.json on Linux; create it if it doesn’t exist, updates never change it):

{
  "Hub": {
    "IssuePollMinutes": 10
  }
}

QMonitorHub status shows how many new issues are waiting.

Updates

The hub updates itself every hour: on Windows with a scheduled task of your user created by the installer, on Linux with a system timer installed by the package. It downloads the new version, verifies it and installs it silently. AI assistants and windows already using the hub keep the previous version until they are restarted. To update right away:

QMonitorHub update

(on Linux it asks for your sudo password). QMonitorHub version shows the installed version.

Security

  • The key is stored for your user only: in the Windows Credential Manager on Windows, in an encrypted file readable only by your user (~/.config/qmonitorhub) on Linux. It never appears in settings files, command lines or logs, and the hub never gives it to the tools that call it.
  • The key is renewed automatically every week. If the hub stays off for more than about two weeks, run QMonitorHub enroll again.
  • The local HTTP address accepts connections only from this computer and refuses requests coming from web pages.
  • The local HTTP address has no password: any program running on this computer can read QMonitor data through it while serve is running. Run it only on computers you trust and stop it when you don’t need it.
  • QMonitor records the requests as coming from the hub (user@computer), not from a specific application.
  • Through the hub, the tools you connect see the same data as your QMonitor dashboards, including the text of the queries, logins and error messages captured on your SQL Servers. An AI assistant sends what it reads to its provider.
  • The local address does not ask for Windows authentication. Even if it did, Windows authentication identifies the Windows account, not the program that is calling: it would not protect against other programs running as the same user.

Manage and revoke hubs

In QMonitor open Settings → Manage my Hub to see your hubs, the organizations they read and when they were last used. Revoke blocks a hub immediately; to use it again, enroll it again.

Troubleshooting

The hub writes a log of every request it receives and every call it makes to QMonitor (never the key). The logs are not in the program folder, which is replaced by updates, but in the hub’s data folder:

WindowsLinux
Program and default settings (replaced by updates)%LOCALAPPDATA%\Programs\QMonitor Hub/opt/qmonitorhub
Your settings appsettings.json (kept)%LOCALAPPDATA%\QMonitorHub~/.local/share/QMonitorHub
Logs (one file per day, kept 14 days)%LOCALAPPDATA%\QMonitorHub\logs~/.local/share/QMonitorHub/logs

To read them:

QMonitorHub logs              # last 50 lines of the latest log
QMonitorHub logs --tail 200   # last 200 lines
QMonitorHub logs --open       # opens the log folder

QMonitorHub status also shows the folder. While serve --http runs, the same lines appear in its window. For more detail set "LogLevel": "Debug" in the Hub section of your settings file.

MessageWhat to do
The hub is not enrolled: run QMonitorHub enroll.Enroll the hub (first use, or the key was removed from Windows).
The hub key was revoked or expired more than a week agoThe hub was revoked or stayed off too long: run QMonitorHub enroll.
QMonitor is not reachableCheck the connection to https://api.qmonitor.app (proxy, firewall).
HTTP 403 from localhost:5310Call it from a program on the same computer, not from a web page.
HTTP 400 with an error messageA parameter is not valid: see the message and the Custom Dashboards parameters.

10 - Manage Instances

Steps required to prepare the instance for monitoring

The Instances page allows you to list, create, edit and delete registered SQL Server instances.

At the top you have buttons to perform several actions:

  • New Agent: Opens a dialog to create an agent entry. For the standard setup flow, enroll and install the agent with ConfigWizardCmd; this creates the agent entry automatically. See Enroll an Agent
  • New Instance: Takes you to the page to register a new SQL Server instance. For a detailed description of the registration process, see Register a SQL Server instance
  • Groups: Takes you to a page where you can create, edit, and delete groups. Groups and subgroups help you categorize your SQL Server instances, display them together in the list, and control settings and exceptions for issues.
    Groups are available to all agents (not specific to a single agent).
  • Queries: Takes you to the page to view, create, edit, and delete custom queries. You can assign queries to one or more agents. The QMonitor agent runs your custom queries and uploads the data to the measurement you define in the query. You can then view the data in the Custom Metrics dashboard as a table, or chart it in your own Custom Dashboards.
  • Export / Import Excel: Use the upload and download buttons to download a list of the instances you have registered in QMonitor. This is useful for sharing with colleagues or using as input for projects.
    The upload button lets you register multiple SQL Server instances at once using an Excel file. This is helpful when you have many instances and don’t want to register them one by one. The import file should use the same columns as the export file. We recommend using the exported Excel file as a template.
  • Download Client: Takes you to the downloads page where you can download the QMonitor client for your platform.
  • Setup Script: Downloads a script that sets up your instances for monitoring. The script creates logins, extended event sessions, and all objects required by QMonitor. It also grants all required permissions. For a complete description of the setup script, see Set up your SQL Server instance
  • Help: Displays a quick guide to enroll an agent, configure instances, and start monitoring.

At the top of the list is a search bar. Use it to filter the instances shown on the page. Enter any keyword to display servers with a matching name, description, tag, or other text field. You can also enter a version number, such as “2022”, to show only servers with that version.

The list of instances is grouped by agent and by groups/subgroups:

Agent Default
├─ Group A
│ ├─ Subgroup X
│ │ ├─ Instance 1
│ ├─ Instance 2
│ ├─ Instance 3
│ ├─ Instance 4
├─ Group B
│ ├─ Subgroup Y
│ │ ├─ Instance 5
│ │ ├─ Instance 6
│ ├─ Instance 7
│ ├─ Instance 8
Agent Custom
├─ Instance 9
├─ Instance 10

Next to each Agent name, you have the following controls:

  • Status icon: Shows the status of the agent (ok, not running, or not installed). Click the status icon or label to open a dialog with more information.
  • Edit button: Opens a dialog to enter a new name for the agent. Not allowed for agents that have already been installed.
  • Queries: Opens a dialog to assign custom queries to an agent. Queries are defined in the Queries page and assigned to individual agents using this dialog.
  • Delete: Deletes the agent. Be careful: Deleting an agent does not delete the service on the machine where it is installed, does not uninstall the agent, and does not remove any files. You must perform these tasks manually. Also, deleting an agent is not reversible, and data collection at the client will stop immediately.

Nested inside the agents, you may have instances directly, or groups and subgroups that contain instances.

The instance name is a hyperlink to the Instance Overview dashboard. Next to the name, you have:

  • A copy button to quickly copy the name to the clipboard
  • The version tag
  • Any tags you added to the instance

If the instance is an Azure SQL Database, Azure SQL Database Pool, or Azure SQL Managed Instance, a blue tag will appear.

On the right side of the list, you have the following controls:

  • Status icon: Shows the status of the instance (ok, ready, or not ready). Click the status icon or label to open a dialog with more information.
  • Edit button: Opens the edit instance page where you can edit all instance details: connection string, tags, description, and more.
  • Delete: Deletes the instance. Once deleted, the instance stops collecting data. However, existing data remains visible on dashboards until it expires from retention.

11 - QMonitor Operator

Install and approve the QMonitor Operator, the service that runs jobs on your instances.

The QMonitor Operator is the service that runs the QMonitor jobs of an agent, on Windows, Linux and Docker. It is installed next to the agent and always runs with its own account.

The agent only monitors: an agent without an operator runs no jobs.

Install on Windows and Linux

On Linux run the commands with sudo and without .exe.

CommandWhat it does
ConfigWizardCmd.exe enrollInstalls the agent and the operator
ConfigWizardCmd.exe enroll --operator-user "DOMAIN\svc"Runs the operator with a dedicated account (Linux: a local user, not root)
ConfigWizardCmd.exe install-operator --org MyOrg --agent DefaultAdds or repairs the operator of an existing agent
ConfigWizardCmd.exe install-operator --allAdds the operator of every agent that has none
ConfigWizardCmd.exe set-service-user --org MyOrg --agent Default --service-user "DOMAIN\svc" --operatorChanges the operator’s account (it must be approved again)
ConfigWizardCmd.exe uninstall --org MyOrg --agent DefaultRemoves the agent and its operator

One approval covers the agent and its operator. install-operator shows its own approval link.

Update an existing installation

The QMonitor update installs the operator next to every agent that has none, on Windows and Linux. To let it run jobs:

  1. On the agent machine run ConfigWizardCmd.exe list: the operators marked TO APPROVE show their approval link.
  2. Open the link and approve the operator.
  3. Enable its permissions.

Jobs and autofixes do not run until these steps are done: the Instances and Jobs pages show a warning.

If an operator is missing after the update, run ConfigWizardCmd.exe install-operator --all. On Docker add the operator container as described in Install on Docker.

Permissions

An operator runs nothing until an administrator enables it: in the Instances list, click the status of its agent, then the gear next to Operator, and choose what it may run.

  • Custom jobs: query jobs and OS command jobs created from the Jobs page.
  • Autofix: one entry for each available autofix.

With Windows authentication grant the operator account the permissions your jobs need on the instances. On Linux the operator connects with the connection string of each instance.

Install on Docker

The operator runs in its own container, with its own volume and the credentials volume of its agent mounted read-only. Enroll the agent container first.

  1. Enroll the operator: open the link printed by the container and approve it. The container then exits.
docker run -it --rm \
  -v operator-credentials-1:/credentials \
  -v agent-credentials-1:/agent-credentials:ro \
  qmonitor/operator:latest
  1. Start it:
docker run -d --name qmonitor-operator --restart unless-stopped \
  -v operator-credentials-1:/credentials \
  -v agent-credentials-1:/agent-credentials:ro \
  qmonitor/operator:latest

agent-credentials-1 is the volume mounted on /credentials by the agent container. Use one operator volume per agent.

  1. Enable its permissions.

Commands

CommandWhat it does
ConfigWizardCmd.exe listLists the agents with the state of their operator and the pending approval links
ConfigWizardCmd.exe logs --org MyOrg --agent Default --operator --tail 100Prints the end of the operator log
ConfigWizardCmd.exe start --org MyOrg --agent Default --operator (also stop, restart)Controls the operator service

In the Instances list, the status of an agent shows whether its operator is online and its account.

12 - Queries

Collect your own SQL Server metrics with Custom Queries.

A Custom Query is a SQL query that the QMonitor agent runs on your instances at a fixed interval. The result is stored as a measurement and can be shown in the Custom Metrics dashboard or in your own Custom Dashboards.

Creating a query

Open Instances → Queries and click New query:

FieldDescription
DescriptionA short description, shown in the metrics catalog.
EnabledDisabled queries are not run and are not available in dashboards.
IntervalHow often the agent runs the query.
QueryThe SQL query. It must return one row per series.
MeasurementThe name of the measurement. Letters, numbers, _, . and -.
Tag Columns IncludeComma-separated columns used as tags (the values you filter and group by), e.g. sql_instance,database_name.
Field Columns IncludeComma-separated columns used as values, e.g. data_mb,log_mb.
Time ColumnOptional column with the sample time; empty uses the collection time.

Column names may contain only letters, numbers and _, and the query cannot contain '''.

Running a query

A query runs only on the agents it is assigned to: on the Instances page, open the Queries dialog of an agent and select it. The agent picks up the change within a minute and runs the query on all its instances; the first data arrives after one interval.

Writing a good query

  • Return numbers as integer or float: wrap decimals in CAST(... AS float), otherwise they are stored as text.
  • Never change the type of an existing column: rows with a different type are discarded. To change it, give the column a new name.
  • Name the instance like the standard measurements: REPLACE(@@SERVERNAME, CHAR(92), ':') AS sql_instance.
  • On Azure SQL Database objects such as sys.master_files are not available and fail even behind an IF: run that part only on other editions with IF SERVERPROPERTY('EngineEdition') <> 5 EXEC('...').
  • Keep it light: each query must finish within 8 seconds.

Example: size and I/O of each user database.

IF SERVERPROPERTY('EngineEdition') <> 5
EXEC('
SELECT
    REPLACE(@@SERVERNAME, CHAR(92), '':'') AS sql_instance,
    DB_NAME(f.database_id) AS database_name,
    CAST(SUM(CASE WHEN f.type = 0 THEN f.size ELSE 0 END) AS float) * 8 / 1024 AS data_mb,
    CAST(SUM(CASE WHEN f.type = 1 THEN f.size ELSE 0 END) AS float) * 8 / 1024 AS log_mb,
    SUM(s.num_of_reads) AS reads,
    SUM(s.num_of_writes) AS writes
FROM sys.master_files f
JOIN sys.dm_io_virtual_file_stats(NULL, NULL) s ON s.database_id = f.database_id AND s.file_id = f.file_id
WHERE f.database_id > 4
GROUP BY f.database_id')

with Tag Columns sql_instance,database_name and Field Columns data_mb,log_mb,reads,writes.