Hi Christian, thank you for your time. I have solved the problem. Please also add this to your troubleshooting documents, as many people have the same problem. Before you install the agent on Linux. Linux administrator should disable the “Xinetd service”.
The following guide will hopefully help others.
- Stop Xinetd service
- Stop all agent controller services
- Uninstall the agent controller on the host
- Delete all directories/files of the agent controller from the host
- Install a clean installation of the agent controller and follow
The new agent controls over port 6556 and runs a service on systemd. Some operating systems also have a Xinetd service. The old version of Agent used Xinetd, and the new version uses systemd. So before you install the new version, you must stop the older service. If you do not, the new Agent Controller Deamon will not run actively because the old service uses port 6556 somehow.
1.1 Stop the Xinetd service
╰─$ sudo systemctl stop xinetd
1.2 Verify the xinetd stop service
╰─$ sudo systemctl status xinetd
● xinetd.service - LSB: Starts or stops the xinetd daemon.
Loaded: loaded (/etc/init.d/xinetd; generated)
Active: inactive (dead) since Wed 2022-10-05 15:14:25 CEST; 17h ago
Docs: man:systemd-sysv-generator(8)
2.1 Stop all agent controller services
╰─$ sudo cmk-agent-ctl delete-all
╰─$ sudo systemctl stop check-mk-agent.socket
╰─$ sudo systemctl stop check-mk-agent-async.service
╰─$ sudo systemctl stop cmk-agent-ctl-daemon.service
3.1 Uninstall the agent controller on host
╰─$ sudo dpkg -r check-mk-agent
(Reading database ... 56008 files and directories currently installed.)
Removing check-mk-agent (2.1.0p12-1) ...
Removing deployed systemd units: cmk-agent-ctl-daemon.service, check-mk-agent@.service, check-mk-agent-async.service, check-mk-agent.socket
Deactivating systemd unit 'cmk-agent-ctl-daemon.service' (if active)...
Deactivating systemd unit 'check-mk-agent-async.service' (if active)...
Deactivating systemd unit 'check-mk-agent.socket' (if active)...
╰─$ sudo apt purge check-mk-agent
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete werden ENTFERNT:
check-mk-agent*
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 2 nicht aktualisiert.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] y
(Lese Datenbank ... 54393 Dateien und Verzeichnisse sind derzeit installiert.)
Löschen der Konfigurationsdateien von check-mk-agent (2.1.0p12-1) ...
dpkg: Warnung: Während Entfernens von check-mk-agent ist Verzeichnis »/var/lib/check_mk_agent« nicht leer, wird daher nicht gelöscht
dpkg: Warnung: Während Entfernens von check-mk-agent ist Verzeichnis »/usr/lib/check_mk_agent/plugins« nicht leer, wird daher nicht gelöscht
4.1 Delete all configuration and dependent packages of the agent from the host
- You can uninstall or removes an installed check-mk-agent package
sudo apt-get remove check-mk-agent
- If you would like to remove check-mk-agent and it’s dependent packages which are no longer needed
sudo apt-get remove --auto-remove check-mk-agent
- If you use with purge options to check-mk-agent package all the configuration and dependent packages will be removed.
sudo apt-get purge check-mk-agent
- If you use purge options along with auto remove, will be removed everything regarding the package, It’s really useful when you want to reinstall again.
sudo apt-get purge --auto-remove check-mk-agent
4.2 Delete all directories/files of the agent controller from the host
cd /etc
sudo rm -r check_mk
cd /var/lib
sudo rm -r check_mk_agent
sudo rm -r cmk-agent
cd /usr/lib
sudo rm -r check_mk_agent
sudo systemctl daemon-reload
When you have done all this, install the agent again and it will work properly.