Just recently installed CHECK_MK and have successfully added hosts (web servers)
But upon checking the apache_status on the services list does not show up.
Based on the documentation i followed, the plugin apache_status should be in the folder /usr/lib/check_mk_agent/plugins and made executable.
But still the apache_status is not shown in the server’s SERVICES list.
You can run the plugin manually to see if if its autodiscovery worked and if there are any problems.
Without a config file, the plugin will check netstat to find the running apache processes and ports.
You can override the autodiscovery by using a config file (/etc/check_mk/apache_status.cfg), e.g.
servers = [
# system apache on port 80, IPv6:
('http', '[::1]', 80),
# It's the same daemon on :443 as on :80, so do not query it twice:
#('https', '[::1]', 443),
# site apache from a local checkmk site on port 5000, IPv4:
('http', '127.0.0.1', 5000),
]
The apache_status.cfg shown above was only a example from one of my machines, a system running a checkmk site incidentally, hence the localhost:5000.
You probably do not have any apache listening on port 5000, so leave that out. In fact, try the plugin without any config at all and see what autodiscover finds.
The message about the hostname mismatch looks like there is a problem with SSL/TLS. Do you perhaps have a redirect from http to https in place? Then try to exclude /server-status from that redirect, e.g. with something like RewriteCond %{REQUEST_URI} !=/server-status before the relevant RewriteRule.
Or try a config file that sets up the correct hostname (plus protocol and port) so TLS should work.
I tried the “apache_status” plugin without any config. Placed it on a host /usr/lib/check_mk_agent/plugins/ directory. Is there anything i should do or command to execute after this?
When I checked the server in the Hosts, WATO then clicked on the server’s “SERVICES” there is still NO apache_status under the Check plugin Row.
<Location “/server-status”>
SetHandler server-status #Require host localhost #uncomment to only allow requests from localhost
The browser showed:
Apache Server Status for 12.34.56.78 (via 10.0.0.5)
Server Version: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips PHP/5.6.40 SVN/1.7.14
Server MPM: worker
Server Built: Jun 22 2018 01:19:25
Current Time: Tuesday, 17-Nov-2020 15:59:06 EST
Restart Time: Tuesday, 17-Nov-2020 15:58:54 EST
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 11 seconds
Server load: 0.00 0.01 0.05
Total accesses: 0 - Total Traffic: 0 kB
CPU Usage: u0 s0 cu0 cs0
0 requests/sec - 0 B/second -
1 requests currently being processed, 31 idle workers
W_______________________________…
…
(truncated)
Still there is no “apache_status” in the list of plugins even after full scan of inventory.
The contents of my /etc/check_mk/apache_status.cfg shown below:
servers = [
# system apache on port 80, IPv6:
#(‘http’, ‘[::1]’, 80),
# It’s the same daemon on :443 as on :80, so do not query it twice:
#(‘https’, ‘[::1]’, 443),
# site apache from a local checkmk site on port 5000, IPv4:
# (‘http’, ‘127.0.0.1’, 5000),
# (‘http’, ‘stage.mydomain.com’, 80),
]
By commenting out all server entries, you have defined an empty list of servers!
Try without the config file (i.e. delete it).
Or use the config file to define a server exactly the way you can call server_status manually: protocol + hostname/address + port
Yes, AFAIK this is normal. I guess the check does some averaging over multiple runs. So with a single run (as in the WATO service discovery), it cannot calculate an average. That’s why it “cannot be done offline”.