CMK version: 2.1.0p24
OS version: Ubuntu 20.04
Error message:
I have a fresh installation of apache on an Ubuntu 22.04. With default config for apache_status, the generated url inside the python script is http://*:80/server-status?auto which ends in HTTP-Error (*:80): 400 HTTP Error 400: Bad Request.
the ss output:
:~# ss -tlnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=739,fd=14))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=890,fd=3))
LISTEN 0 50 0.0.0.0:445 0.0.0.0:* users:(("smbd",pid=961,fd=46))
LISTEN 0 70 0.0.0.0:33060 0.0.0.0:* users:(("mysqld",pid=962,fd=21))
LISTEN 0 151 0.0.0.0:3306 0.0.0.0:* users:(("mysqld",pid=962,fd=32))
LISTEN 0 50 0.0.0.0:139 0.0.0.0:* users:(("smbd",pid=961,fd=47))
LISTEN 0 511 *:80 *:* users:(("apache2",pid=16757,fd=4),("apache2",pid=16756,fd=4),("apache2",pid=16755,fd=4))
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=890,fd=4))
LISTEN 0 4096 *:6556 *:* users:(("cmk-agent-ctl",pid=7011,fd=9))
LISTEN 0 50 [::]:445 [::]:* users:(("smbd",pid=961,fd=44))
LISTEN 0 50 [::]:139 [::]:* users:(("smbd",pid=961,fd=45))
Do I have to configure apache in order to get the apache_status check working?
In my opinion, the .py should also consider 127.0.0.1 if *:80 is seen.
# Use localhost when listening globally
if server_address == "0.0.0.0": # nosec - B104
server_address = "127.0.0.1"
elif server_address == "::":
server_address = "[::1]"
elif ":" in server_address:
server_address = "[%s]" % server_address
Thanks ![]()