How-to renew an expired Checkmk Relay certificate

How-to renew an expired Checkmk Relay certificate

This article explains how to restore communication between a Checkmk Relay and a Checkmk site when the Relay certificate has expired.

LAST TESTED ON CHECKMK 2.5.0P13

How do I know I’m affected?

A Relay will no longer be able to communicate with a Checkmk site if its certificate is no longer valid. The Relay consequently stops receiving check jobs and submitting metrics, and all services of the hosts monitored through the Relay go stale. A Relay in this state can also no longer update itself because it needs a working connection to the site to do so.

You are affected if you run Checkmk 2.5.0p9, 2.5.0p10, 2.5.0p11, or 2.5.0p12 and have at least one Relay registered.

Ā 

Check the Relay logs for the following errors.

On a Linux Relay host:

sudo journalctl -u checkmk_relay.service --since "-10m"

Ā 

On a Windows Relay host:

wsl.exe -d Ubuntu-Checkmk-Relay -u root -- journalctl -u checkmk_relay.service --since "-10m"

Ā 

The entries look like this:

cmk.relay.processors.verbose_transport - ERROR - HTTP request failed (https://<your-site>/relays/<relay-id>/tasks ...) cmk.relay.processors.site_client - WARNING - HTTP request to get tasks from site failed: Server disconnected without sending a response...

Ā 

Ā 

What you need to do

To restore communication with the affected Relays:

  1. Update your Checkmk site to at least 2.5.0p13. This applies only to the Ultimate and UltimateMT editions.

  2. Download the attached script to your Checkmk site server.

  3. Run the rescue script to temporarily allow affected Relays to connect and renew their certificates.

  4. Wait until all affected Relays have renewed their certificates.

  5. Stop the rescue script.

  6. Verify that the Relays have been updated.

Ā 

Step 1: Update your Checkmk site

If you are using the Ultimate or UltimateMT edition, the Checkmk site must be running 2.5.0p13 or newer.

On the Checkmk server, open a shell as the site user:

sudo su - <site>

Ā 

Check the installed Checkmk version:

omd version -b

Ā 

Step 2: Prepare the rescue script

Download the attached script to your Checkmk site server.

Place the script in the site user's home directory, for example:

mv /tmp/rescue-receiver.sh ~/

Ā 

Make the script executable:

chmod +x rescue-receiver.sh

Ā 

Step 3: Run the rescue script

Warning
While the script is running, Relays and agents with expired certificates are allowed to connect to the Checkmk site. Stop the script after the affected Relays have renewed their certificates.

Ā 

Run the rescue script:

./rescue-receiver.sh

The script stops the Agent Receiver service and restarts it in relaxed mode.

Ā 

Step 4: Wait for the Relays to renew their certificates

Wait a few seconds for the affected Relays to connect to the Checkmk site and renew their certificates.

The script reports each Relay when it connects and again after its certificate has been renewed:

- Relay <alias> (<relay-id>): its certificate expires Sep 5 11:08:57 2026 GMT. - Relay <alias> (<relay-id>): certificates renewed!

Ā 

Step 5: Stop the rescue script

After all affected Relays have renewed their certificates, press:

Ctrl+C

The script then restarts the Agent Receiver in regular mode.

Ā 

Step 6: Verify the Relays

Verify that the Relays have been updated by checking the relevant service logs on each Relay host:

sudo journalctl -f \ -u checkmk_relay-update-manager.path \ -u checkmk_relay-update-manager.service \ -u podman-auto-update.service \ -u checkmk_relay.service

Ā 

Related articles