Checkmk
Checkmk is a program for infrastructure monitoring. It’s great software, and the free version gives access to a lot of great features. This works by installing itself and using a port locally, which is great… But not so great: It installs Apache and wants you to use that as the front-end automatically through a reverse-proxy. This is fine in most cases, however if you’re like me, using Nginx, how do we stop using Apache and instead use Nginx?
That’s simple.
Installing Checkmk
First, installing Checkmk. Follow the installation insructions on the Checkmk Download Page for your version. Likely you’ll select Raw, and Ubuntu or Debian.
The steps in this guide are for Ubuntu/Debian, but similar commands should work for other platforms as well.
For me, it was (For Ubuntu 22.04, using Checkmk 2.3.0p8):
|
|
Also: Make a note of the username and password in the console at this point. You will need them to login to the Checkmk panel.
Later, you can use cmk-passwd cmkadmin
to change the password, should you need to.
Switching from Apache to Nginx
At this point Checmk is running, and Apache is installed and attempted to start. If you’re running an Nginx server locally, or under Docker and ports 80 are already used: Apache failed to start.
This is great as there shouldn’t be any conflicts. Now, to shut down and disable Apache.
|
|
And that’s it. Apache should now be disabled. There should be no worry of it conflicting with Nginx while it’s disabled.
Using Nginx as a reverse proxy
There are a few ways of adding bits to your existing website. I chose to use it on a subdomain, but you could leave it as your domain /monitoring, as suggested by the installer.
The installer shows The default web UI is available at http://tcno.co/monitoring/
, where tcno.co
is my system’s hostname. This assumes that you leave the Apache server running in the default configuration, and don’t use Nginx or another web hosting software.
For me, I create a new site .conf
file in my Nginx sites-available
folder, and symlink to sites-enabled
, so let’s do that.
|
|
And I entered the following:
|
|
If you’re using Certbot for SSL, or want 443 to be used for https, you will obviously include that as well. This is just a barebones setup for just the /monitoring
end point to work.
How did I get 127.0.0.1:5000
? Will this work for you? Maybe not.
You can get the port and address of Checmk from the Apache configuration file. There must be another way, but this is how I did it:
|
|
You should find the address of Checkmk next to ProxyPass
.
Now, link and enable the site for Nginx:
|
|
Now you should be able to access your new Checkmk installation using your Nginx server on your domain.
Just make sure to secure it as you see fit, and set up SSL/HTTPS if you haven’t already.