New agent does not run on rasperry-pi with debian

CMK version: v2.1.0p2
OS version: Linux raspberrypi 4.19.66+ armv6l

Error message:

Hi,
the new check_mk agent in v2.1 does not work on arm - chip of raspberry-pi.
If we try to register the agent with cmk-agent-ctl we get the error message:
-bash: /usr/bin/cmk-agent-ctl: Kann die Binärdatei nicht ausführen: Fehler im Format der Programmdatei

Therefor it is impossible to activate the agent TLS encryption - neither directly nor the import.
Regards,
Christoph

cmk-agent-ctl is an amd64 binary as far as I know.

yes, but the agent itselft used to run on ARM Debian, so we could monitor our raspberries. So the expection is that this works also after a update …

1 Like

The documentation says on Monitoring Linux - The new agent for Linux in detail

However, the agent also supports a so-called legacy mode which supports Linux systems with computer architectures that are different to x86_64, without RPM or DEB package management and without the systemd init system. In this legacy mode, the new agent works like the old one, i.e. without the Agent Controller and thus without a registration at the Checkmk server.

1 Like

yes, we know.
We just hope, that we don’t have to drive a mixed setup with partly TLS encryption and some Hosts in legacy mode.
The DEB package was running without any problems in all the old versions, and the new agent.service is running on the host.
Its just the piece of software which handles the TLS registration, which is “from outside” normally no big deal (receiving a Cert and saving it somewhere in the file system).

1 Like

With some effort it is possible to compile cmk-agent-ctl for Raspberry Pi. Unless you want to set up cross-compiling you need to do this on a Raspberry Pi (or multiple Pi if you are using e.g. armv7l as well as aarch64). The rustc package of Debian/Raspbian is too old so you have to install rust as described here:

Install Rust - Rust Programming Language
Use git to clone /checkmk/agents/cmk-agent-ctl change do /checkmk/agents/cmk-agent-ctl and issue a cargo build. After compiling the binary is at targets/debug relative to that directory. As cmk-agent-ctl contains debugging information you could/should strip that information.

If you are using a shell script for deploying the agent you just have to add a few steps:

  • copy the cmk-agent-ctl for the architecture you are using to e.g. /root/bin and make sure that /root/bin is in the PATH and before /usr/bin_
  • install the checkmk agent deb
  • wait for a few seconds (sleep 5)
  • cp /root/bin/cmk-agent-ctl /usr/bin/
  • systemctl start cmk-agent-ctl-daemon.service

After that you can register your hosts as usual.

1 Like

I tried this - but it is far more work than just replacing the binary…

Adding a user: cmk-agent, systemd-units, a socket, etc…

Actually for me compiling was the most time-consuming part. If you proceed as I wrote (the first step is essential) the service will be created as well as the user. I was using a script to install the agent before and now it is about 15 lines longer from which most of it is logic like what architecture is used.

Still it would be nice not having to do it, but fortunately it is just a little more work.

no problem, i just wanted to point that out…

i deploy the agents via salt in my home lab, so i want to show this additonal things…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.