Docs · Integrations
The pingding CLI
Wrap any command so its start, exit code and output are reported to PingDing.
Published at launch. Static binaries for Linux (x86_64, arm64), macOS (Apple silicon, Intel) and Windows (x86_64), with checksums.
pingding run wraps a job. It sends /start, runs the command exactly as before (same input, same output, same exit code), then sends the exit code with the end of the output. If PingDing can't be reached, the job still runs and keeps its exit code.
# crontab: the key comes from the environment, never from the command line
PINGDING_PING_KEY=<ping-key>
0 3 * * * pingding run -- /usr/local/bin/backup.sh
Settings
| Setting | What it is |
|---|---|
PINGDING_PING_KEY |
The check's ping key. Required. |
--key-file PATH |
Read the key from a file instead. |
PINGDING_PING_BASE_URL |
Where pings go. Unset means the hosted service. For a self-hosted install, its ping base, such as https://pingding.example.com/ping. |
HTTPS_PROXY, NO_PROXY |
Honoured. |
There's no --key flag on purpose: other users on a machine can read a process's command line. The key is also removed from the command's environment, so a job that prints its environment doesn't print it.
pingding run [--no-log] [--key-file PATH] -- COMMAND [ARGS…]
- Sends
/start, waiting at most 5 seconds. - Runs the command directly (no shell; use
sh -c '…'for one), copying its output through and keeping the last 40 KB. - Sends the exit code with that output. A command killed by a signal is reported as 128 plus the signal, as a shell would.
- Exits with the command's own code.
The finishing ping is retried for up to 60 seconds through a busy or restarting API. --no-log sends no output and leaves the command's terminal alone.
pingding ping
Sends one ping, for scripts that report steps themselves:
pingding ping start
pingding ping --body-file /tmp/job.log 0
pingding ping fail