How Picokoi works
Picokoi watches jobs that should run on a schedule: backups, reports, cleanups, syncs. Each time a job finishes, it sends a tiny request (a ping) to its own address. If a ping doesn't arrive in time, Picokoi alerts you.
Your first check
- Create a check: give it a name, say how often the job runs, and how much extra time to allow before alerting.
- Copy the ping line Picokoi shows you and add it at the end of the job.
- Run the job once. The check's page switches from Waiting for first ping to Running by itself.
- Choose where alerts go, then send a test message.
Adding the ping to a job
The ping is one curl call. The options make it quiet, give up after 10 seconds, and retry if the network blips, so the job itself is never held up.
In a crontab, after the job's command:
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 5 --retry-connrefused "https://ping.picokoi.com/pk_…"
At the end of a shell script, reporting failures too:
#!/bin/sh
PING="https://ping.picokoi.com/pk_…"
if ./run-report; then
curl -fsS -m 10 --retry 5 --retry-connrefused "$PING"
else
curl -fsS -m 10 --retry 5 --retry-connrefused "$PING/fail"
fi
As the last step of a GitHub Actions workflow, with the address stored as a secret:
- name: Tell Picokoi
if: success()
run: curl -fsS -m 10 --retry 5 --retry-connrefused "${{ secrets.PICOKOI_PING }}"
Treat the address like a password: anyone who has it can report for that check. If it leaks, open the check and choose New ping address.
What the states mean
- Waiting for first ping
- The check exists but the job hasn't pinged yet. Nothing is alerted until it does.
- Running
- The last ping arrived on time.
- Late
- The expected time has passed but the extra time hasn't run out yet.
- Down
- No ping arrived in time, or the job reported a failure. You're alerted once, and again when it recovers.
- Unknown
- Picokoi itself was briefly unavailable while it expected a ping, so it can't know whether the job ran. Rather than alert you for its own outage, it waits for the job's next run. The outage is listed on the status page.
- Paused
- Pings are recorded but nothing is evaluated or alerted.
Alerts
Picokoi sends alerts to webhook addresses: any service that accepts an HTTPS request. The quickest way to get them on your phone is an ntfy topic; more destinations will follow. Each message is JSON with the check's name, its new state and when it changed.
Messages are signed. To check one, compute an HMAC-SHA256 of timestamp + "." + body with your destination's secret and compare it with the X-Picokoi-Signature header (v1= followed by the hex digest); the timestamp is in X-Picokoi-Timestamp.
Command line and API
Everything on these pages is also available from the picokoi command and the HTTP API under /v1/, authenticated with your access token, which is handy for scripts and coding agents. Run picokoi check help for the commands.