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

FlagEnvironment variableDefaultDescription
--hostWHPG_HOSTlocalhostThe hostname of the WHPG coordinator.
--portWHPG_PORT5432The port for the WHPG coordinator.
--userWHPG_USERgpadminThe superuser for the cluster.
--passwordWHPG_PASSWORD-The password for the WHPG user.
--databaseWHPG_DATABASEwemThe target database for monitoring.
--sslmodePGSSLMODEpreferSSL mode for cluster connection.

Examples

  • Start a guided installation with prompts:

    wem setup
  • Check if an installation is complete without making changes:

    wem setup --check
  • Point 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

FlagEnvironment variableDefaultDescription
--hostWHPG_HOSTlocalhostThe hostname of the WHPG coordinator.
--portWHPG_PORT5432The port for the WHPG coordinator.
--userWHPG_USERgpadminThe superuser for the cluster.
--passwordWHPG_PASSWORD-The password for the WHPG user.
--databaseWHPG_DATABASEwemThe target database for monitoring.
--sslmodePGSSLMODEpreferSSL 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 active PXF_BASE without making changes. Exits with code 0 if up to date, 1 if a change is needed, or 2 on error.
  • --strict: Exits non-zero if PXF_BASE can't be detected.
  • --remove: Removes the PXF service configuration.
  • --pxf-base PATH: Explicitly sets the PXF_BASE path 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 default gpadmin.

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]

Could this page be better? Report a problem or suggest an addition!