This section explains how to enroll and install an agent with ConfigWizardCmd, then register SQL Server instances for that agent and start data collection.
This is the multi-page printable view of this section. Click here to print.
Working with Agents
- 1: Enroll an Agent
- 2: Installation Options
- 3: Network Setup
- 4: Agent Components
- 5: Installing the Agent
- 6: Enrolling and Managing Agents with ConfigWizardCmd
1 - Enroll an Agent
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.
2 - 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.
3 - Network Setup
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:#fffOn 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.
4 - Agent Components
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 - Installing the 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.
Warning
If you change the service account later, do not just update it in Services. Use ConfigWizardCmd’sset-service-user command to update service credentials
and ensure required file system permissions and other settings are applied.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.
6 - Enrolling and Managing Agents with ConfigWizardCmd
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
| Command | Description |
|---|---|
enroll | Requests enrollment and installs and starts the approved agent. |
list | Lists agent services installed on this machine. |
start, stop, restart | Controls an installed agent service. |
logs | Prints the tail of an agent log. |
set-service-user | Changes the service account of an installed agent. |
uninstall | Removes an agent service from this machine. |
network-check | Tests DNS, TCP, and TLS connectivity to QMonitor endpoints. |
help | Prints 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
| Option | Description |
|---|---|
--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-browser | Do not open the approval page automatically; open the printed URL manually. |
--container | Enroll 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.