Linux Agent: Issues with systemd-timedated.service creates timeouts

CMK version: 2.3.0p23
OS version: (Client): Debian 11

Error message: Agent timeout

When the Linux agents checks systemd-timesync, it calls timedatectl show: checkmk/agents/check_mk_agent.linux at 86cbbd37f87b11f5a7fab9f7403d26a995da210d · Checkmk/checkmk · GitHub
When the service systemd-timedated.service doesn’t run, the command times out and blocks the agent out for ~25 seconds:

# time timedatectl show
Failed to parse bus message: Connection timed out

real    0m25.020s
user    0m0.000s
sys     0m0.006s
# systemctl status systemd-timedated.service
● systemd-timedated.service - Time & Date Service
     Loaded: loaded (/lib/systemd/system/systemd-timedated.service; static)
     Active: failed (Result: exit-code) since Wed 2025-02-12 15:35:38 CET; 7s ago

25 seconds is nearly half of the default 60 seconds agent timeout, so the agent reaches this timeout sometimes when systemd-timedated is down.

Remove systemd-timesyncd and use chrony or ntpd.

1 Like

Also do that after: How to adjust NTP TIME global service thresholds?

I don’t want to replace systemd-timesyncd, just because Checkmk has an issue with that. The fact that systemd-timedated doesn’t work on this host is an issue and needs to be fixed by myself, but Checkmk should be able to monitor other services/checks on this host.

Maybe add a timeout? Fix: Avoid Linux Agent timeouts when systemd-timedated doesn't run by mueller-ma · Pull Request #790 · Checkmk/checkmk · GitHub

1 Like

Checkmk does not have an issue. I have the issue that systemd-timesyncd is not fit for server time synchronisation. But that discussion is really off-topic for this forum.

2 Likes

Thanks for the hint. I migrated to chrony, which fixed the issue with the long agent execution for me.

2 Likes

My fix has been merged: Fix: Avoid Linux Agent timeouts when systemd-timedated doesn't run by mueller-ma · Pull Request #790 · Checkmk/checkmk · GitHub