Skip to content

CLI flags & environment variables

Northwatch is configured entirely by command-line flags and environment variables — there is no YAML config for the process itself (multi-cluster setups use a JSON config file). Every flag has an equivalent environment variable; flags take precedence over environment variables.

Run ./bin/northwatch --help to see the same list at runtime.

Server flags

FlagEnv varDefaultDescription
--listenNORTHWATCH_LISTEN:8080HTTP listen address.
--ovn-nb-addrNORTHWATCH_OVN_NB_ADDR(required)OVN Northbound address. Comma-separated for Raft failover, e.g. tcp:10.0.0.1:6641,tcp:10.0.0.2:6641.
--ovn-sb-addrNORTHWATCH_OVN_SB_ADDR(required)OVN Southbound address. Comma-separated for Raft failover.
--config-fileNORTHWATCH_CONFIG_FILE(none)Path to a JSON multi-cluster config file. When set, --ovn-nb-addr / --ovn-sb-addr are ignored.
--snapshotNORTHWATCH_SNAPSHOT(none)Serve a snapshot file offline. Takes precedence over --ovn-*-addr and --config-file.
--versionPrint the build version and exit. Release builds report the release tag; other builds report dev.

Exactly one connection source is required: a snapshot, a config file, or both flat NB/SB addresses.

Initial-load tuning

FlagEnv varDefaultDescription
--monitor-batch-delayNORTHWATCH_MONITOR_BATCH_DELAY200msDelay between staged per-table monitor requests on connect (Go duration). 0 loads all tables in one request. Offline --snapshot replay always uses 0.
--monitor-skip-tablesNORTHWATCH_MONITOR_SKIP_TABLES(none)Comma-separated OVN tables to never monitor (e.g. Logical_Flow,MAC_Binding,FDB). Features reading a skipped table see it as empty.

See Tune the initial load and Large deployments.

OpenStack enrichment

Setting --os-auth-url enables OpenStack enrichment for the default cluster.

FlagEnv varDefault
--os-auth-urlOS_AUTH_URL(none)
--os-usernameOS_USERNAME(none)
--os-passwordOS_PASSWORD(none)
--os-project-nameOS_PROJECT_NAME(none)
--os-domain-nameOS_USER_DOMAIN_NAME(none)
--os-region-nameOS_REGION_NAME(none)
--os-cacertOS_CACERT(none)

--os-cacert is a path to a PEM CA bundle used to verify the OpenStack API when it is fronted by a private CA (maps to the clouds.yaml cacert field). The bundle is trusted only by the OpenStack client, not the whole process.

Kubernetes enrichment

FlagEnv varDefaultDescription
--kube-enrichmentNORTHWATCH_KUBE_ENRICHMENTfalseEnable Kubernetes enrichment.
--kubeconfigKUBECONFIG(none)Path to kubeconfig file.
--kube-contextNORTHWATCH_KUBE_CONTEXT(none)Kubeconfig context to use.

Enrichment cache

FlagEnv varDefaultDescription
--enrichment-cache-ttlNORTHWATCH_ENRICHMENT_CACHE_TTL5mEnrichment cache TTL (Go duration).

Chassis inventory

FlagEnv varDefaultDescription
--chassis-stale-thresholdNORTHWATCH_CHASSIS_STALE_THRESHOLD60sHow long an out-of-sync chassis may lag the current nb_cfg generation before the chassis inventory flags it stale (Go duration).

This threshold only affects the stale flag, not alive/down: a chassis is alive whenever it is present and in-sync. nb_cfg_timestamp only advances when a chassis acknowledges a new nb_cfg generation, so on a steady-state cluster it freezes — which is why staleness, not timestamp age, is what this bounds. Raise it to tolerate slower config propagation before a lagging chassis is flagged.

OVS visibility (per-chassis Open_vSwitch)

Opt-in, read-only integration with each chassis's local Open_vSwitch (vswitchd) OVSDB. It is disabled by default and enabled only by pointing --ovs-mgmt-addr-file at a mapping file; the resulting routes are documented under OVS.

FlagEnv varDefaultDescription
--ovs-mgmt-addr-fileNORTHWATCH_OVS_MGMT_ADDR_FILE(none)Path to a JSON file mapping chassis system-id to OVSDB management address. Enables OVS visibility for the default cluster.
--ovs-tls-certNORTHWATCH_OVS_TLS_CERT(none)Client certificate (PEM) for ssl: OVS connections.
--ovs-tls-keyNORTHWATCH_OVS_TLS_KEY(none)Client private key (PEM) for ssl: OVS connections.
--ovs-tls-caNORTHWATCH_OVS_TLS_CA(none)CA bundle (PEM) verifying ssl: OVS servers.

The mapping file is a JSON object, e.g.:

json
{
  "chassis-system-id-1": "ssl:10.0.0.11:6640",
  "chassis-system-id-2": "tcp:10.0.0.12:6640"
}

Each chassis must enable remote OVSDB access (ovs-vsctl set-manager ptcp:6640 or pssl:6640). The TLS flags are required only for ssl: endpoints and are all-or-none — supply all three together or none. They are global flags wired to the default cluster, not part of the multi-cluster JSON config file.

Write operations

FlagEnv varDefaultDescription
--write-enabledNORTHWATCH_WRITE_ENABLEDfalseEnable write operations against OVN NB.
--write-plan-ttlNORTHWATCH_WRITE_PLAN_TTL10mTTL for prepared write plans (Go duration).
--write-rate-limitNORTHWATCH_WRITE_RATE_LIMIT30Maximum write operations per minute (0 = unlimited).

See Enable write operations.

History & snapshots

FlagEnv varDefaultDescription
--history-db-pathNORTHWATCH_HISTORY_DB_PATHnorthwatch-history.dbPath to the SQLite history database.
--snapshot-intervalNORTHWATCH_SNAPSHOT_INTERVAL5mAutomatic snapshot interval (Go duration).
--event-retentionNORTHWATCH_EVENT_RETENTION24hEvent-log retention duration.
--event-max-countNORTHWATCH_EVENT_MAX_COUNT0Maximum number of events to retain (0 = unlimited).

Alerting & WebSocket

FlagEnv varDefaultDescription
--alert-webhook-urlsNORTHWATCH_ALERT_WEBHOOK_URLS(none)Comma-separated webhook URLs for alert notifications.
--ws-allowed-originsNORTHWATCH_WS_ALLOWED_ORIGINS(none)Comma-separated allowed Origin host patterns for WebSocket connections. Empty disables the origin check (suitable behind an operator-controlled reverse proxy).

Logging

FlagEnv varDefaultDescription
--log-levelNORTHWATCH_LOG_LEVELinfoMinimum log level: debug, info, warn or error.
--log-formatNORTHWATCH_LOG_FORMATtextStructured log output format on stderr: text or json.

Logs are emitted as structured, leveled records on stderr. An unrecognized level or format value fails startup.

Boolean and duration formats

  • Booleans read from environment variables accept true/false, 1/0 or yes/no (case-insensitive). A non-empty value that is none of these fails startup rather than silently defaulting.
  • Integers read from environment variables must parse as integers; a malformed value fails startup.
  • Durations use Go's format: 200ms, 5m, 1h, 24h.

The snapshot subcommand

northwatch snapshot captures the live databases to a file for offline replay. It accepts a subset of the server flags:

FlagEnv varDefaultDescription
--ovn-nb-addrNORTHWATCH_OVN_NB_ADDR(required)Northbound address (comma-separated for failover).
--ovn-sb-addrNORTHWATCH_OVN_SB_ADDR(required)Southbound address (comma-separated for failover).
--output, -onorthwatch-snapshot.jsonOutput file path.
--monitor-batch-delayNORTHWATCH_MONITOR_BATCH_DELAY200msSame staged-monitor tuning as the server.
--monitor-skip-tablesNORTHWATCH_MONITOR_SKIP_TABLES(none)Tables to skip during capture.
bash
./bin/northwatch snapshot --ovn-nb-addr tcp:10.0.0.1:6641 \
  --ovn-sb-addr tcp:10.0.0.1:6642 -o prod.snapshot.json

Serve the result with ./bin/northwatch --snapshot prod.snapshot.json.

Examples

bash
# Minimal single cluster
./bin/northwatch --ovn-nb-addr tcp:10.0.0.1:6641 --ovn-sb-addr tcp:10.0.0.1:6642

# Raft endpoints with failover
./bin/northwatch \
  --ovn-nb-addr tcp:10.0.0.1:6641,tcp:10.0.0.2:6641,tcp:10.0.0.3:6641 \
  --ovn-sb-addr tcp:10.0.0.1:6642,tcp:10.0.0.2:6642,tcp:10.0.0.3:6642

# OpenStack enrichment
./bin/northwatch --ovn-nb-addr tcp:10.0.0.1:6641 --ovn-sb-addr tcp:10.0.0.1:6642 \
  --os-auth-url https://keystone.example.com:5000/v3 \
  --os-username northwatch --os-password secret --os-project-name admin

# Multi-cluster with writes enabled
./bin/northwatch --config-file /etc/northwatch/clusters.json --write-enabled