# Uptime Kuma

Map Uptime Kuma monitors and notifications to kogut.toml.

There is no Uptime Kuma importer. Recreate your monitors in
[`kogut.toml`](https://docs.kogut.dev/reference/configuration/) or in the panel, using the mappings below.

## Move the configuration

1. Add a `[[service]]` per group and a `[[check]]` or `[[heartbeat]]` per monitor, as in
   the table below. Put tokens, passwords, and webhook URLs in `${NAME}` placeholders set
   in kogut's environment; see [Secrets](https://docs.kogut.dev/reference/configuration/#secrets).
2. Run `kogut config check kogut.toml`, then save it as `kogut.toml` in kogut's data
   directory, or at the path in
   [`KOGUT_CONFIG`](https://docs.kogut.dev/reference/environment-variables/). A running server reloads the
   file and reports errors in the panel and log.
3. For each push monitor, set `ping_token` on its heartbeat to the token at the end of
   the monitor's push URL, then change only the host in each job's URL to kogut's.
   `/api/push/<token>?status=up&msg=OK&ping=` keeps working; kogut ignores `msg` and
   `ping`. See [Keep an existing push URL](https://docs.kogut.dev/monitoring/heartbeats/#keep-an-existing-push-url).
   Without `ping_token`, [copy a new ping URL](https://docs.kogut.dev/monitoring/heartbeats/#copy-the-ping-url)
   and update the job.

## Map monitors

| Uptime Kuma | kogut |
|---|---|
| HTTP(s) | HTTP check with method and supported status assertion |
| Keyword | `body_contains`, or `body_not_contains` for inverted keywords |
| JSON query | `json` and typed `equals` for supported paths |
| TCP port, ping, DNS | Matching check type |
| Push | Heartbeat with `ping_token` set to the same push token, with retry time as `grace` |
| Group | Service |

kogut's DNS check tests that the name resolves through `/etc/resolv.conf`; a specific
record type or resolver does not carry over. Custom HTTP `headers` do, with secrets as
`${NAME}`. Request bodies, sign-in settings, and skipped TLS verification do not.

Docker container monitors need no check: [the agent](https://docs.kogut.dev/agent/installing/) on the host
reports container state and restarts. A container of a service that exits with an
error, stays unhealthy, or restarts 3 times in 10 minutes is
[down](https://docs.kogut.dev/alerts/how-alerts-work/#containers). For a database monitor, add a TCP check
of its port.

Intervals and timeouts must fit the limits in
[`[[check]]`](https://docs.kogut.dev/reference/configuration/#check). Assertion syntax is in
[Checks](https://docs.kogut.dev/monitoring/checks/#assertions).

## Reconnect notifications

Add an `[[alert]]` for each Telegram, Discord, Slack, ntfy, webhook, or SMTP notification
you use, with its secrets as `${NAME}` placeholders.

- For ntfy password authentication, create an access token instead.
- For a channel address that is or resolves to a private address, set
  `allow_private = true` on the channel.
- Update webhook receivers for kogut's JSON body. Custom webhook headers are not sent.

Review [notification channels](https://docs.kogut.dev/alerts/channels/) and
[alert behaviour](https://docs.kogut.dev/alerts/how-alerts-work/). Per-monitor routing does not carry over.

## Finish the switch

Recreate the [status page](https://docs.kogut.dev/status-page/), maintenance windows, and users,
or let people sign in through [OpenID Connect](https://docs.kogut.dev/sign-in/openid-connect/) or
[forward auth](https://docs.kogut.dev/sign-in/forward-auth/). Tags, proxies, history, upside-down monitors,
and other check or notification types have no equivalent.

Run both until you have checked the new setup, then stop Uptime Kuma.
