CMK version: 2.1.0p15 OS version: TrueNAS SCALE 22.02.4
I installed the CheckMK Agent on a TrueNAS SCALE host. After the installation everything worked. After a reboot the cmk-agent-ctl-daemon and the check-mk-agent.socket failed.
I had to add the checkmk user again.
After that the service and the socket both seemed to work again but the daemon did not bind port 6556 so the agent did not work.
Hi, I use ssh with the authorized_keys file to connect to the agent instead of systemd.
You can configure the authorized_keys file in the root user settings via the WebGUI.
it should still be installed, the user is missing though.
I know itās a hacky solution and thereās probably a better one, but I added the following command as a pre init script: useradd -r -s /bin/false cmk-agent
After a TrueNAS update you also have to reinstall the agent and reregister for updates and TLS I think.
Maybe Iāll switch to just reinstalling the deb package in the futureā¦
Ok since an update or something itās not really working anymore. After a reboot of the system CheckMK isnāt able anymore to get access to the system.
I tried with āsudo apt install --reinstall ./check-mk*ā but the same - no connection.
Has anybody a good solution?
-Install is not possible / only reinstall without any effect
-check-mk-agent.socket fails - after creating the user itās possible to start the service
-no open socket for 6556
-not able to register the agent (cmk_agent_ctl - No such file or directory)*
*itās there with +x
Any ideas how to the the CheckMK service running again?
I use this script for installing and registering the agent. It is placed in my home folder ā/mnt/zfs_pool_01/myhomedir/install_checkmk_agent_from_bakery_true_nas_scale.shā
The script is executed as user Root. (login as user; then sudo su -; then execute the install script)
This:
apt -y install python3-pip
pip3 install docker
is possibly not working in the current version of TrueNAS Scale. The Debian repo is missing. If you want to see the docker values, you have to add the repo tempoarily, install the package and add the docker plugin to the agent.
And I have some Cronjobs in the TrueNAS Scale GUI defined. Iām unsure if they are still needed. They are running every minute.
a)
if [ ! -d /usr/lib/check_mk_agent ]; then ln -s /mnt/zfs_pool_01/checkmk/check_mk_agent /usr/lib/ > /dev/null 2> /dev/null; else echo ā/usr/lib/check_mk_agent does existā; fi
I took a closer look at the install-dev-tools command.
The interesting part for us is /usr/local/libexec/disable-rootfs-protection $FORCE_ARG.
/usr/local/libexec/disable-rootfs-protection is a python script which does a few things:
checks the license (if an enterprise license is used, the above-mentioned āFORCE_ARGā (āforce) is needed)
looks up the dataset configuration (/conf/truenas_root_ds.json)
flags the root dataset as developer mode (truenas:developer=on)
sets all datasets listed in /conf/truenas_root_ds.jsonto rw
chmods apt and dpkg as executable
To install the checkmk agent we already chmod apt and dpkg so /usr/local/libexec/disable-rootfs-protection is exactly what we want for non-enterprise configurations.
I am personally using checkmk to monitor my home NAS so running this script is no problem for me.
For enterprise users who might need support for their TrueNAS installation this is no option of courseā¦
In this case a minimal agent installed to some writable dataset and called via SSH would probably be a better solution.
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.