Hallo,
ich habe ein kleines Problem.
Es kommt zu einen Timeout des Check_MK Services bei der Überwachung der DMZ-Hosts über ssh bei Verwendung einer ssh-Jumphost und Multiplexing.
ich habe folgende Konfiguration.
···
--------------------------------------------------------
Check_MK-Server => ssh-Jump-Host mit Multiplexing(jumphost.xyz.at) => ssh mit Multiplexing(dmzhost.xyz.at mit Aufruf /usr/bin/check_mk_agent).
Als Datasource ist im WATO ein "Individual program call" mit der Command-Line: "/usr/bin/ssh -oLogLevel=ERROR $HOSTNAME$" gesetzt.
* Die ssh-Konfiguration für den Jump-Host und das Multiplexing wird in der .ssh/config des CMK--Servers folgendermaßen gesetzt.
.ssh/config
Host jumphost.xyz.at
User root
ForwardAgent yes
IdentityFile ~/.ssh//checkmk.key
IdentitiesOnly yes
BatchMode yes
PubkeyAuthentication yes
PasswordAuthentication no
GSSAPIAuthentication no
PreferredAuthentications publickey
StrictHostKeyChecking no
ExitOnForwardFailure yes
ConnectionAttempts 1
ServerAliveInterval 10
ServerAliveCountMax 15
ControlMaster auto
ControlPersist 60m
ControlPath ~/.ssh/master-%r@%h:%p.socket
LogLevel ERROR
Host dmzhost.xyz.at
ProxyJump jumphost.xyz.at
User root
IdentityFile ~/.ssh//checkmk.key
BatchMode yes
PubkeyAuthentication yes
PasswordAuthentication no
GSSAPIAuthentication no
PreferredAuthentications publickey
StrictHostKeyChecking no
ExitOnForwardFailure yes
ConnectionAttempts 1
ControlMaster auto
ControlPersist 15
ControlPath ~/.ssh/master--jump-%r@%h:%p.socket
LogLevel ERROR
* Wenn ich den Client mit dieser Konfiguration mehrmals per ssh-Abfrage bekomme ich innerhalb von 300ms die Antwort des Agents.
OMD[xyz1]:~/.ssh$ time ssh clienthost.dmzxyz.at /usr/bin/check_mk_agent
<<<check_mk>>>
Version: 1.5.0p19
AgentOS: linux
Hostname: clienthost.dmzxyz.at
...
real 0m0.211s
user 0m0.002s
sys 0m0.010s
* Wenn ich den gleichen Check mit cmk durchführe dauert die Rückmeldung von cmk mindestens so viel Sekunden, wie die ControlPersist des Tunnels in der ssh-Config gesetzt ist.
Also mit dieser ssh-Config mindestens 15 Sekunden.
OMD[xyz1]:~/.ssh$ cmk -v clienthost.dmzxyz.at
Check_MK version 1.5.0p21
+ FETCHING DATA
[agent] Execute data source
[piggyback] Execute data source
...
OK - [agent] Version: 1.5.0p19, OS: linux, execution time 15.7 sec | execution_time=15.656 user_time=0.020 system_time=0.000 children_user_time=0.010 children_system_time=0.010 cmk_time_ds=15.608 cmk_time_agent=0.001
Bei ControlPersist-Zeiten größer 60 Sekunden kommt es zu einem Timeout des Check_MK Services.
Als Workaround ist es möglich die ControlPersist für die dmzhost auf 1 zu setzen, dass macht aber die Verwendung des Multiplexing obsolet.
Ist jemanden schon ein ähnlicher Fall untergekommen und ist vielleicht eine andere, bessere Lösung dazu bekannt?
Mit freundlichen Grüßen
Friedrich Rechtberger