Skip to main content

sng monitor

Beta

Being rolled out. The interface described here is the one of the next release: it may still change, and may not be enabled on your tenant yet.

The sng monitor commands are being rolled out in the CLI, and monitoring is being deployed.

The sng monitor group is a shortcut for managing the Monitor manifests of the desired state: create writes and applies the manifest, list and delete are equivalent to sng kind list Monitor and sng kind delete Monitor NAME. Notification channels and status pages have no dedicated command: generate them with sng template gen NotificationChannel|StatusPage, then sng apply.

The global flags (--config, --json, -v, --version) are described in the CLI index. All commands require a tenant session (sng tenant use NAME), as for sng apply.

IAM actions:

CommandIAM actionRoute
listdeploy:listGET /v1/resources/Monitor
createdeploy:writePOST /v1/apply
deletedeploy:deleteDELETE /v1/resources/Monitor/{name}

sng monitor list​

sng monitor list

Lists the Monitor manifests of the current tenant. Does not show the state of the monitors: see the status page.

FlagTypeDefaultDescription
(no flags of its own)
sng monitor list
NAME KEY UPDATED
api acme/…/Monitor/api.yml 2026-10-07T10:02:11Z
db acme/…/Monitor/db.yml 2026-10-07T10:03:48Z

Without monitors: no Monitor.

--json output: {"kind": "Monitor", "items": [{"name": "api", "key": "…", "updated_at": "…"}]}.

sng monitor create​

sng monitor create NAME (--http URL | --tcp HOST:PORT | --dns SERVER --query NAME)
[--interval D] [--timeout D] [--threshold N] [--expect CODES]
[--contains TEXT] [--channel NAME]... [--display-name TEXT] [--dry-run]

Writes a Monitor manifest and applies it. Exactly one target:

  • --http URL: HTTP(S) check; --expect 200,204 (default: any 2xx), --contains TEXT. An https:// URL adds tls: {}: alerts before the certificate expires (14 and 3 days).
  • --tcp HOST:PORT: TCP connection check.
  • --dns SERVER --query NAME: DNS query (type A) sent to SERVER.

Only public targets are accepted: the platform refuses private addresses and internal names. Running the command again on an existing name replaces the manifest.

ArgumentDescription
NAMEmonitor name: lowercase, digits, and -, at most 63 characters
FlagTypeDefaultDescription
--httpstringhttp(s):// URL to check; credentials in the URL are refused
--tcpstringHOST:PORT to connect to
--dnsstringDNS server queried (with --query)
--querystringname resolved by the DNS check
--intervalstring5m30s, 1m, 2m, 5m, or 10m; the minimum depends on the tier (5 min on 3XS)
--timeoutstring10sduration of a check, from 1s to 30s, lower than --interval
--thresholdint3consecutive failures before an outage (1 to 5)
--expectlist of integersaccepted HTTP codes (200,204); requires --http
--containsstringtext the HTTP body must contain (at most 256 characters); requires --http
--channelstring, repeatableNotificationChannel notified on outage and recovery (at most 10)
--display-namestringNAMEpublic label on status pages (at most 63 characters)
--dry-runboolfalseshows the manifest without applying it
sng monitor create api --http https://api.example.com/health --expect 200 --channel ops
sng monitor create db --tcp db.example.com:5432 --interval 10m
sng monitor create resolver --dns ns1.example.com --query example.com --dry-run
monitor "api" declared in tenant acme: …

--dry-run:

apiVersion: monitoring.stackngo.io/v1alpha1
kind: Monitor
metadata:
name: resolver
spec:
type: DNS
target: ns1.example.com
interval: 5m
timeout: 10s
failureThreshold: 3
dns:
queryName: example.com

--json output: {"uploads": [{"key": "acme/…/Monitor/api.yml", "kind": "Monitor", "name": "api", …}]}.

For options missing from the command (HTTP method, headers, bodyMustNotContain, ipFamily, DNS query type, tcp.tls, TLS thresholds, paused), write the manifest: sng monitor create … --dry-run > api.yml, edit it, then sng apply api.yml.

Errors:

MessageCause
exactly one of --http, --tcp or --dns is requiredno target, or several
monitor name "…": lowercase letters, digits and '-' (63 max.)invalid name
--interval "…": one of 30s, 1m, 2m, 5m, 10minterval not in the list
--timeout "…": between 1s and 30stimeout out of bounds or malformed
--timeout 30s must be below --interval 30stimeout ≥ interval
--threshold must be between 1 and 5threshold out of bounds
--expect and --contains need --httpHTTP options without --http
--expect "…": HTTP status code expectednon-numeric code or outside 100–599
--http "…": http(s)://host/path expectedmalformed URL
--http: credentials in the URL are refusedhttps://user:pass@…
--tcp "…": HOST:PORT expectedmissing port or outside 1–65535
--dns needs --query NAME, --query needs --dnsincomplete DNS options
--channel "…": NotificationChannel name expectedinvalid channel name
--channel: 10 channels maxmore than 10 distinct channels

sng monitor delete​

sng monitor delete NAME [--yes]

Deletes the Monitor NAME manifest from the desired state; the monitor is no longer probed. A status page that still lists it is then rejected: update it.

ArgumentDescription
NAMEmonitor name
FlagTypeDefaultDescription
-y, --yesboolfalseconfirms without a prompt; required outside an interactive terminal
sng monitor delete api
sng monitor delete test-alerte --yes
⚠ Suppression définitive du Monitor "api".
Tapez « oui » pour confirmer : oui
deleted: acme/…/Monitor/api.yml

--json output: the response of the deletion API (key, …).

Errors: confirmation requise : relancez avec --yes ou depuis un terminal interactif, opération annulée.

See also​