CLI reference
norcube monitor monitors create
Create a monitor; its first check runs right away
Not verified yet
Creates an enabled monitor of one type:
http requests --url and expects --expect (default 2xx) within --timeout;
for https URLs it also watches the certificate and the domain's
registration unless --no-cert-watch / --no-domain-watch
keyword an HTTP monitor that also looks for --keyword in the body
(--keyword-mode absent: alerts when it appears)
ssl checks the certificate of --host:--port and alerts --alert-days
before it expires
domain checks the registration of --domain and alerts --alert-days
before it expiresSettings not given start from the dashboard's defaults. For anything the flags don't cover, pass the API's JSON body with --from-file (see "nrc api monitor POST /monitors"). Secret header values come from a file or standard input only (--secret-headers-file), never from arguments. The first check runs at once and is billed like a scheduled one.
Usage
norcube monitor monitors create <name> [flags]Examples
norcube monitor monitors create "Shop" --type http --url https://shop.example.com/health
norcube monitor monitors create "Login page" --type keyword --url https://example.com/login --keyword "Sign in"
norcube monitor monitors create "API cert" --type ssl --host api.example.com --alert-days 30,7
norcube monitor monitors create "example.com" --type domain --domain example.com --interval 24h
printf 'Authorization: Bearer %s\n' "$TOKEN" | norcube monitor monitors create "Admin API" --type http --url https://example.com/admin/health --secret-headers-file -
norcube monitor monitors create --from-file monitor.jsonFlags
| Flag | Default | Description |
|---|---|---|
--alert-days | SSL and domain: alert this many days before expiry, up to 5 values (default 30,14,7) | |
--body-content-type | HTTP: Content-Type of --body-file | |
--body-file | HTTP: send the request body read from this file (- for standard input) | |
--cert-expiry-days | HTTP: also watch the certificate, alerting this many days before it expires (https URLs; default on with 30,14,7) | |
--description | A note on what the monitor is for | |
--domain | Domain: the registered domain, e.g. example.com (not www.example.com) | |
--domain-expiry-days | HTTP: also watch the domain's registration, alerting this many days before it expires (default on with 30,14,7 for host names) | |
--expect | HTTP: accepted status codes or ranges, e.g. 2xx, 301, 400-404 (repeat or comma-separate; default 2xx) | |
--from-file | Read the request body as JSON from this file (- for standard input), in the API's shape; no other setting flags then | |
--header | HTTP: a request header "Name: value" (repeatable; replaces the plain headers on update) | |
--host | SSL: host whose certificate to check | |
--insecure | HTTP: don't verify the TLS certificate (it is still reported) | |
--interval | 0s | How often to check, e.g. 30s, 5m, 1h (default 1m for HTTP, 1h for SSL, 12h for domains; your organization's limit sets the minimum) |
--keyword | HTTP: text to look for in the response body (the first 256 KiB) | |
--keyword-case-sensitive | HTTP: match the keyword's case | |
--keyword-mode | HTTP: whether the keyword must be present (default) or absent | |
--max-redirects | HTTP: redirects to follow at most (default 5) | |
--method | HTTP: request method (default GET) | |
--no-cert-watch | HTTP: don't watch the certificate | |
--no-domain-watch | HTTP: don't watch the domain's registration | |
--no-follow-redirects | HTTP: judge the first response instead of following redirects | |
--port | SSL: port (default 443) | |
--secret-headers-file | HTTP: read secret headers ("Name: value" per line) from this file (- for standard input); stored encrypted, never shown again | |
--server-name | SSL: SNI name to send, when it differs from --host | |
--slow | 0s | HTTP: warn when a response takes longer than this |
--timeout | 0s | HTTP: give up on a request after this long, 1s to 30s (default 10s) |
--type | Monitor type: http, keyword, ssl or domain | |
--url | HTTP: the URL to request |
Every command also takes the global flags: --profile, --org, -o, --query, --debug and more.
See also
norcube monitor monitors: Create, inspect and manage monitors and their check history