Header X-Agent-Token: <agent_token>, the per-server token of the monitored server the job belongs to
Content type
application/json
Body
At most 4 KiB
The token decides which server a job belongs to. A job that runs somewhere
else uses the token of the server it relates to. On a server with the agent,
the token is CV_AGENT_TOKEN in /etc/cloudviewer-agent/agent.env.
16. Reports for jobs that already exist are always accepted
Requests per token
2 a minute, bursts of up to 16
Many cron jobs that start on the hour fit into the burst, and one request
can carry up to 16 jobs. A job stays as long as its server; there is no way
yet to remove a single job.
Seconds, or a number with m, h or d: 26h is 93600. Sent as max_age_seconds. Leave it out for failure alerts only
--token-file <path>
Read the token from this file, which holds only the token. For a server without the agent, or a user who cannot read agent.env
--
Ends the flags. Everything after it is the command
The wrapper is part of the agent package, at /usr/bin/cloudviewer-report.
It runs the command first, then sends its exit code and duration in whole
seconds, and exits with the command’s exit code.
Token: --token-file, else CV_AGENT_TOKEN from the environment, else
/etc/cloudviewer-agent/agent.env. Ordinary users cannot read that file,
so a job that does not run as root needs --token-file.
API URL: CV_AGENT_FACADE_URL, else https://api.vaicoa.com. When
the token comes from agent.env, the URL in that file.
Without a token it prints “job ran, not reported” and exits with the
command’s exit code.
On 429 or 503 it retries once, after Retry-After (at most 60 seconds, 5
if the header is missing). Any other failure prints the HTTP status; the
exit code stays the command’s. Each request times out after 15 seconds.
A missing --job, a missing command or a bad --max-age is a usage error:
exit code 2, and the command does not run.