diff --git a/src/pages/get-started/cli.mdx b/src/pages/get-started/cli.mdx index 4628fe77..e0e28cbc 100644 --- a/src/pages/get-started/cli.mdx +++ b/src/pages/get-started/cli.mdx @@ -427,6 +427,26 @@ Peers count: 2/3 Connected The peer with IP `100.119.85.4` wasn't returned because it was not connected +#### Health checks + +Use `netbird status --check` to run a health probe from a script or container orchestrator. These probes do not display the normal status report. A successful probe produces no output and exits with code `0`; a failed probe exits with code `1`. + +- `live`: succeeds when the daemon responds to the status request. +- `ready`: succeeds when the daemon status is `Idle`, `Connecting`, or `Connected`. Authentication-required states (`NeedsLogin`, `LoginFailed`, and `SessionExpired`) and unexpected states fail the check. +- `startup`: succeeds when management and signal are connected and, if any NetBird relays are configured, at least one relay is available. + +For example, the following loop makes each probe result visible: + +```shell +for check in live ready startup; do + if netbird status --check "$check"; then + echo "$check: PASS" + else + echo "$check: FAIL ($?)" + fi +done +``` + ### ssh Command to connect via SSH to a remote peer in your NetBird network. The `ssh` command has several subcommands for different operations.