NAME

kuma-push - update an Uptime Kuma push monitor

VERSION

Version 0.002

SYNOPSIS

kuma-push [--url url] [--down] [--msg text] [--ping ms] [--timeout sec]
kuma-push [--url url] [--msg text] [--timeout sec] -- command [args ...]

DESCRIPTION

The kuma-push utility sends a heartbeat to an Uptime Kuma push monitor. It uses WebService::UptimeKuma::Push.

In the first form, a single up heartbeat, or a down heartbeat with --down, is sent.

In the second form, the command is run and its runtime is sent as ping. If the command exits with 0, an up heartbeat is sent. Otherwise a down heartbeat is sent with the reason as message. The command is run directly, not through a shell.

OPTIONS

--down

Send a down heartbeat instead of an up heartbeat. Cannot be used with a command.

--msg text

The message shown in Uptime Kuma. With a command, the message is only used if the command succeeds.

--ping ms

The response time, in milliseconds, shown in Uptime Kuma. Cannot be used with a command.

--timeout sec

The timeout, in seconds, for the HTTP request. Defaults to 10.

--url url

The push URL of the monitor, as shown by the Uptime Kuma web interface. Defaults to the KUMA_PUSH_URL environment variable.

EXIT STATUS

Without a command, the kuma-push utility exits 0 on success, 1 if the heartbeat cannot be sent, and 2 if invalid arguments are given.

With a command, kuma-push exits with the exit status of the command, 127 if the command cannot be run, 128 plus the signal number if the command was killed by a signal, and 2 if invalid arguments are given. A failure to send the heartbeat is reported on standard error but does not change the exit status.

On Windows, Perl cannot distinguish a command that cannot be run from a command that exits with 255. In that case kuma-push exits with 255.

EXAMPLES

Example 1 Send an up heartbeat

kuma-push --url 'https://kuma.example.net:3001/api/push/MSCHnx6nVs' --msg 'all good'

Example 2 Monitor a backup from cron

KUMA_PUSH_URL=https://kuma.example.net:3001/api/push/MSCHnx6nVs
0 3 * * * kuma-push --msg 'backup done' -- rsync -a /data/ backup:/data/

ENVIRONMENT

KUMA_PUSH_URL

The push URL, if --url is not given. Using the environment variable prevents the push token from showing up in the process list.

SEE ALSO

WebService::UptimeKuma::Push

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at https://github.com/skirmess/WebService-UptimeKuma-Push/issues. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

https://github.com/skirmess/WebService-UptimeKuma-Push

git clone https://github.com/skirmess/WebService-UptimeKuma-Push.git

AUTHOR

Sven Kirmess <sven.kirmess@kzone.ch>