HTTP push (http_push)
For jobs, scripts and agents that report in instead of being polled: a nightly backup, a cron job, a script on a host Probeward cannot reach. The sender posts its result to the sensor's own URL, and that report is the sensor's result, for everything that follows: limits, the failure count, incidents, suppression, history and graphs.
A push sensor is never polled, so there is no Scan now for it and it needs no credential. Its channels are whatever the sender reports: every value becomes a channel with a stable key.
Setting one up
- Add a sensor of kind HTTP push to a device (the device's address is not used; any device, such as a "Jobs" device, will do).
- Set the sensor's interval to how often the sender is expected to report. This is the ordinary interval setting, inherited like any other.
- Probeward shows the push URL once, with example commands. Copy it into the job. The URL contains the sensor's ingest token: treat it like a password.
- If the URL is lost or leaked, rotate the token on the sensor's page. The old URL stops working at once.
Through the API: create the sensor with POST /api/v1/sensors ("kind": "http_push"), then POST /api/v1/sensors/{id}/push-token returns {"token": "pwp_...", "url": "https://.../api/v1/push/pwp_..."}; the same call rotates it. Both are audited (sensor.push_token_issue, sensor.push_token_rotate), without the token.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
grace_secs | 60 | How long after the expected interval a report may still arrive, 0 to 86400. |
stale_is_failure | false | Count every silent interval as a failed poll, so that the failure count can open an incident. |
Sending a report
POST /api/v1/push/{token} with a small JSON body, or GET with query parameters. No session, no cookie, no CSRF header. Bodies are limited to 16 KiB, a report to 50 values, a value name to 64 characters.
curl -fsS -X POST -H 'Content-Type: application/json' \
-d '{"status":"ok","message":"backup finished","values":{"duration_s":42.5,"size_mb":1280}}' \
"$PUSH_URL"# The simplest cron job: a GET. Every parameter except status and message is a number.
curl -fsS -G "$PUSH_URL" --data-urlencode status=ok --data-urlencode message='backup finished' \
--data-urlencode duration_s=42.5$body = @{ status = 'ok'; message = 'backup finished'; values = @{ duration_s = 42.5 } } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri $PushUrl -ContentType 'application/json' -Body $bodyProbeward's own format
| Member | Meaning |
|---|---|
status | ok (default), warning or down. up, warn, error, fail and failed are accepted as synonyms. |
message | Text shown with the sensor, up to 1000 characters. |
values | An object of names and values. A name is letters, digits, _, . and -, starting with a letter or digit. The name is the channel's key and is case-sensitive. A value is a number, or an object {"value": 42.5, "name": "Duration", "unit": "seconds"} when the channel should be shown with a name and a unit (name and unit are optional; value is required). |
Every member is optional: {} is a report that says "ok". Unknown members are refused, so a typo is an error rather than a value that silently goes missing.
The incumbent's custom sensor result format
Existing scripts can post unchanged. The body is an object with a single member, whatever it is called, that holds the result:
{ "anything": { "result": [ { "channel": "Rows exported", "value": 42 },
{ "channel": "Duration", "value": "3.5" } ],
"text": "nightly export done", "error": 0 } }result: channels withchannel(a name) andvalue(a number, or a string holding one).textbecomes the message.- A non-zero
errormakes the report down. A channel with"warning": 1makes it warning. - The channel name becomes the key: lowercased, every run of other characters replaced by one
_(Rows exportedbecomesrows_exported). Two names that give the same key are refused. channelis also the channel's name, andunit(orcustomunitwith the unitCustom) is its unit, read as described below. Limits, decimals, charts and every other member are ignored. Limits are set in Probeward, per channel.
Names and units
A channel's key is its identity. A report that sends a bare number leaves the channel listed by its key with no unit. A sender that wants a name and a unit sends them with the value (Probeward's own format) or uses the incumbent's format, which always carries the channel name and may carry a unit. Probeward keeps the latest name and unit it received for each key, per sensor, and shows them in the channel table, the graphs, the value summary in the tree and the limits editor; a later report may change them without touching the stored history, which stays under the key.
The text comes from the sender, so it is untrusted: names are cut to 80 characters, units to 16, control characters are removed, and both are shown as plain text. A unit Probeward formats is shown the way the interface shows it (s, ms, B, %, °C, #; seconds, milliseconds, bytes, percent and celsius are read as those); any other unit is shown as written. The query form of GET carries no names or units. A sensor remembers the names of up to 100 channels, the most recently reported.
Answers
| Status | Meaning |
|---|---|
200 {"accepted": true} | The report was taken. |
| 400 | The body is not valid; fields names each problem and never repeats what was sent. |
| 404 | No such token. The same answer, body included, as for any unknown path: a mistyped, rotated or invented token cannot be told apart. |
| 409 | The sensor is disabled. |
| 413 | Body over 16 KiB. |
| 429 | More than a burst of 30 reports and then one a second per token, or more than 20 unknown tokens from one address (it then waits, doubling up to 15 minutes). Retry-After says how long. |
| 503 | The monitoring runtime is not running. Try again. |
The token is compared by its SHA-256 in constant time, is never logged (request logs show /api/v1/push/<token>), and appears in no response, audit record, event or export. If you put a reverse proxy in front, check that it does not log request URLs: the reference Caddyfile does not, but a proxy with access logging switched on would record the secret.
What a report does
- On time. The report is stored like a poll result: a sample with its values, evaluated against the limits of each channel. Limits on pushed channels work as on polled ones; set them on the sensor page once the channel has appeared (Settings of a channel, by key).
- Failure. A report with
down, an error limit breached, or a failed result counts as a failing poll. The failure count (default 2) of consecutive failing reports opens an incident; one good report closes it. - Late. If no report arrives within the interval plus
grace_secs, the sensor becomes Unknown (stale), with the time of the last result. Nobody is paged. The next report makes it fresh again. - Silent. With
stale_is_failure, each silent interval is a failed poll, recorded in the history. After the failure count of them (the second one comes one interval, not a full window, after the first), an incident opens. A report ends it. - Paused. A report that arrives while the sensor is paused is kept as history only and changes nothing: silence during a pause counts for nothing either. When the pause ends the sensor waits for a report and the sender gets a full interval plus grace.
- Dependencies. A failing report is suppressed, with a timeline entry, while the device's master check or another dependency of the sensor is failing, like any sensor's failure. A push sensor cannot itself be a master check or a dependency, because there is nothing to poll to confirm its state.
- Restart. After a restart of Probeward the sender gets a full interval plus grace before silence counts.
Under a remote probe
Push reports go to the core, not to a probe, and the engine in the core evaluates them, so a push sensor works wherever it sits in the tree as long as the sender can reach the core. Today a push sensor under a probe that is not reporting records its reports as history only, like during a pause; the remote-probe work needs to decide whether such a sensor should ignore its probe's connection (it should, for senders that talk to the core directly) or whether a probe on a remote network should relay reports with their original timestamps (then they would come in as buffered samples). Neither is built yet.
Failures
A push sensor has no failure of its own: its failures are those the sender reports and the silence the parameters turn into one.