I have installed check-mk-agent_2.0.0p3-1_all.deb on an old Debian 7 test VM. I skipped xinet.d set up as I intend to access via SSH instead.
I then followed “6.3. Invoking over SSH” instructions from The agent for Linux in detail
I created key pair without “-t ed25519” due to seeing: userauth_pubkey: unsupported public key algorithm: ssh-ed25519 [preauth]
So a pair of standard RSA keys (id_rsa, id_rsa.pub) was created instead (no passphrase).
On Check MK server the keys are located in both:
/home/user/.ssh/
/root/.ssh/
On the target client I’ve added public one to /root/.ssh/authorized_keys
Ownership and permissions are correct.
I can connect from Check MK server as both a regular user and root:
$ ssh root@testvm
<<<check_mk>>>
Version: 2.0.0p3
AgentOS: linux
Hostname: testvm
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
(…)
ssh root@testvm
<<<check_mk>>>
Version: 2.0.0p3
AgentOS: linux
Hostname: testvm
AgentDirectory: /etc/check_mk
DataDirectory: /var/lib/check_mk_agent
SpoolDirectory: /var/lib/check_mk_agent/spool
PluginsDirectory: /usr/lib/check_mk_agent/plugins
LocalDirectory: /usr/lib/check_mk_agent/local
(…)
I went to Agents → Other integrations → Custom integrations → Individual program call instead of agent access
Added rule:
Description: CUSTOM agent over SSH
Command line to execute: ssh -i $OMD_ROOT/.ssh/id_rsa -T root@$HOSTADDRESS
Folder: Main directory
Host labels has AGENT:SSH
The rest left at defaults.
I went to Setup → Agents → Access to Agents → TCP port for connection to Checkmk agent
Added rule:
Description: CUSTOM agent over SSH
TCP port for connection to Checkmk agent: 22
Folder: Main directory
Host labels has AGENT:SSH
Finally: Host → testvm → Lables → AGENT:SSH (added)
Selecting: Data sources → Checkmk agent:
Normal Checkmk agent, or special agent if configured → Save & go to connection tests → Agent → Program ‘5’ not found (exit code 127)
Normal Checkmk agent, all configured special agents → Save & go to connection tests → Agent → Program ‘5’ not found (exit code 127)
No Checkmk agent, all configured special agents → Save & go to connection tests → Agent → the field goeas solid green and blank, no messages
No agent → Save & go to connection tests → Agent → the field goeas solid green and blank, no messages
Interestingly on connection test page → Options → Checkmk Agent Port is still showing the default 6556 instead of 22.
When I click on “Rules” next to it I see my rule created earlier.
Why is it not working? What am I missing / doing wrong?