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 identifies misconfigurations in database connectivity, web settings, service identity, PXF integration, and the observability stack (Prometheus, Loki, and Alertmanager) before or after the service is started.
Check categories include: database connectivity, web server configuration, effective OS user, PXF binary detection, PXF_HOME, and PXF_BASE.
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, web, and service identity 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
wem configure-pxf-sandbox
The wem configure-pxf-sandbox command detects the active PXF_BASE directory and configures the WEM service to allow write access to it. Run this command after installing PXF on a host that already has WEM, or after relocating PXF_BASE with pxf cluster prepare -b.
Usage
wem configure-pxf-sandbox [options]
Options
--check: Reports whether the WEM service configuration is up to date for the activePXF_BASEwithout making changes. Exits with code0if up to date,1if a change is needed, or2on error.--strict: Exits non-zero ifPXF_BASEcan't be detected.--remove: Removes the PXF service configuration.--pxf-base PATH: Explicitly sets thePXF_BASEpath to use instead of auto-detecting it.
WEM resolves PXF_BASE in this order: the --pxf-base flag, then WHPG_PXF_BASE in wem.conf, then WHPG_PXF_BIN in wem.conf, then the shell environment, then a search of common PXF install paths.
Example
sudo wem configure-pxf-sandbox sudo systemctl restart wem
wem configure-user
The wem configure-user command switches the OS user that the WEM service runs as. It configures the service to start as the specified user, transfers ownership of /etc/wem/wem.conf and /var/log/wem, provisions the user's gpAdminLogs directory, and updates WHPG_OS_USER in wem.conf.
Usage
wem configure-user <username> [options]
Options
--remove: Reverts the service user to the defaultgpadmin.
Example
sudo wem configure-user whpg_admin sudo systemctl restart wem
wem serve
The wem serve command starts the WEM web server. Use systemctl start wem to start WEM in normal operation. Use wem serve directly only when running WEM outside of systemd, such as in a container environment.
Usage
wem serve [global options]