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.