Commands
WarehousePG Enterprise Manager (WEM) includes a powerful CLI tool for initialization, diagnostics, and service management.
wem setup
The wem setup command is the primary utility for initializing and verifying the WarehousePG (WHPG) monitoring environment. It orchestrates the creation of the monitoring database, installs authentication schemas, and deploys the necessary views across the cluster to enable WEM functionality.
Usage
wem setup [options] [global-options]
Options
--check: Performs a silent check. Exits with code 0 if setup is complete, and a non-zero code otherwise.--debug: Enables verbose output, displaying all SQL queries executed during the setup process.--non-interactive: Runs the setup without user prompts, relying on default values or environment variables.--update-views: Refreshes monitoring views across the cluster without re-running the full setup.--verify: Validates the current installation against the expected schema without modifying any data.--wem-admin-password-file: Path to the file containing the admin password (or where an auto-generated one will be saved).
Global options
| Flag | Environment variable | Default | Description |
|---|---|---|---|
--host | WHPG_HOST | localhost | The hostname of the WHPG coordinator. |
--port | WHPG_PORT | 5432 | The port for the WHPG coordinator. |
--user | WHPG_USER | gpadmin | The superuser for the cluster. |
--password | WHPG_PASSWORD | - | The password for the WHPG user. |
--database | WHPG_DATABASE | wem | The target database for monitoring. |
--sslmode | PGSSLMODE | prefer | SSL mode for cluster connection. |
Examples
Start a guided installation with prompts:
wem setup
Check if an installation is complete without making changes:
wem setup --checkPoint setup to a specific host and port:
wem setup --host whpg-coord-01 --port 5433
wem doctor
The wem doctor command runs a comprehensive suite of checks against your environment. It's designed to identify misconfigurations in database connectivity, web settings, and the observability stack (Prometheus, Loki, and Alloy) before or after the service is started.
Usage
wem doctor [options] [global options]
Options
--prometheus-url PROMETHEUS_URL: The URL of the Prometheus server for metrics.--loki-url LOKI_URL: The URL of the Loki server for log aggregation.--alloy-url ALLOY_URL: The URL of the Alloy collector.-h, --help: Display help text for the doctor command.
Global options
| Flag | Environment variable | Default | Description |
|---|---|---|---|
--host | WHPG_HOST | localhost | The hostname of the WHPG coordinator. |
--port | WHPG_PORT | 5432 | The port for the WHPG coordinator. |
--user | WHPG_USER | gpadmin | The superuser for the cluster. |
--password | WHPG_PASSWORD | - | The password for the WHPG user. |
--database | WHPG_DATABASE | wem | The target database for monitoring. |
--sslmode | PGSSLMODE | prefer | SSL mode for cluster connection. |
Examples
Check the core database and web configurations:
wem doctor
Validate connection to the Prometheus metrics server:
wem doctor --prometheus-url http://prometheus.internal:9090
Check every component of the WEM environment in one command:
wem doctor --prometheus-url http://prom:9090 --loki-url http://loki:3100 --alloy-url http://alloy:12345
- On this page
- wem setup
- wem doctor
Could this page be better? Report a problem or suggest an addition!