Ep. 45: Monitoring Proxmox with Checkmk

[0:00:00] Hello, my name is Bastian Kuhn. And today I'm going to show you how to monitor Proxmox with Checkmk.
[0:00:16] First, I'm gonna show you how to set up the user and permissions in Proxmox. Later on, I'm going to show you how to set the special agent in Checkmk. And finally, I'm going to show you how to use the piggyback feature with Proxmox.
[0:00:31] So, at first we look into Proxmox. The first thing we're going to need is a group. I create this group, and I just name it read_only. This group yet has no any permissions but let's change that. I go to Permissions. I add a permission.
[0:00:58] It's a Group Permission. The Path is /. The Group might just created to read_only. And the function is auditor, so we only have read access. And the last part I'm going to add my user.
[0:01:23] This is in Users. I'm going to go to Add. User name checkmk. It should be on the Proxmox himself but not on the server.
[0:01:38] I'm going to use a simple password, put the user to the read_only group, and the Proxmox part is done. Next, we switch over to Checkmk. 
[0:02:03] The first thing we need to do is to add the Proxmox server. In my example, I just have one of them. But in your example, you maybe even have a cluster of multiple servers, so you need to add, of course, this multiple servers.
[0:02:25] My Hostname, it's really simple here. But I can't go yet to the services because there's another configuration to make before, and that's the special agent configuration. So, I go Save & go to folder, go back to Setup, search for proxmox.
[0:02:53] Now I'm in the empty rule window. I click to Add rule. The first thing I want to do is to apply this rule only to my Proxmox server. I enter my Username. That's checkmk@pve.
[0:03:14] And under my Password, to keep it a bit simpler I don't want to use the password stored here and just directly enter it. Then the port is a default, so I don't need to change anything here. Of course, I need to disable the SSL certification.
[0:03:37] But just in my case because I just have here this locally running one with some problems here. But if you are in a production environment should really think about if you want to disable this because this can lead to security problems. I saved the rule. Then this part is done. I go back to Setup, Hosts.
[0:04:04] And from here I can directly go to the discovery, so I don't need to click to edit, I can directly go to the yellow box here. This is the edit services part. I rescan.
[0:04:26] And there I already have the little Proxmox information of my setup here. In your case, you should, of course, see way more services here. I accepted. I'm going to activate the changes. And let's use this search here. Go back to the server.
[0:05:01] Here we have it already in our monitoring. So, only thing left now is the piggyback data. I promise to show. In my setup here, I have just one virtual machine. It's not running. It's named testsrv. And this system is already providing piggyback information about this machine.
[0:05:29] To get access to it, I go to Setup, Hosts, and add it as a host. Normally, you would install the Checkmk agent also on this system, so you get even more inside information. Since in my virtual setup here, it's not possible to run something. I cannot even start a site, so I can't install the agent.
[0:05:51] So, I just gonna show you the additional piggyback information. So, I go to Add host. I need to name it in the same way it's in Proxmox. In my case here, I don't have the Checkmk agent. So, I disable it, so that I don't run in any errors. I go to the service configuration.
[0:06:28] And now I see the Proxmox piggyback information, which are provided from the server. I accept it. I activate the changes again. And then I can check the server inside our monitoring.
[0:06:58] There are also some additional functions in Checkmk who can help you to monitor Proxmox. For example, the cluster function of Checkmk.
[0:07:08] Imagine you have multiple Proxmox servers, and they share resources. These resources can switch between the clusters nodes. So, you can set up also this in Checmk. I'm going to show you how. 
[0:07:22] You go back to Setup, to the Hosts again. And instead of Add host, you go to, say, Add cluster. And then you need to know the cluster name. Best case, this is also DNS name.
[0:07:41] In my case, it's not even existing. And the second part, you're going to add all your cluster nodes. In my case, I just have one. And the second part would be to define which of the services from this system I want to have in the cluster. For that, we just can set up a rule.
[0:08:08] It's again in the Setup, Clustered services. So, we're gonna add a rule there. Here we just need the conditions nothing more to set. So, we add the host names, which are part of the cluster and which are sharing the information.
[0:08:32] And then we just add the services, which are these resources which I can change. And there we only need the beginning of the name, for example, Interface, or for example, Filesystem. But that really depends on your server.
[0:08:49] And important is that here, it, the matching is everything what starts with this word. So, if you would go the Filesystem/, it would match basically every file system. In this case, just add a $ here in order to make sure only matching the Filesystem/.
[0:09:10] Checkmk even helps you with that if you want to save it, you see in the conditions Service name begins with Interface or is Filesystem/.
[0:09:20] If you read exactly here, you're going to be never wrong normally. The second part I talked about piggyback, and that I added the system with the same name as the piggyback information. The problem, not always these names are the same. 
[0:09:38] For example, in your Proxmox the server names are different, configured as you have the server names in your Checkmk. For that, you have the piggyback translation feature. You can find it in Setup. You search for piggyback. And then you find the Hostname translation for piggyback. You add a rule here.
[0:10:04] And this rule is really simple. You can, for example, Drop the domain part out of the domain, can make a Case translation to upper or lowercase. You can apply regular expressions, for example, to add a domain name or whatever else.And finally, if nothing else helps, you can even do an exact matching here from hostname to new hostname.
[0:10:35] Make sure to apply it only to the piggyback host here, because otherwise the rule will apply to every system which has piggyback, and maybe depending on the piggyback source, the whole systems are different.
[0:10:51] So that's about that. You can find even more information on the blog article we're gonna link for you in the description. Thank you for watching. And don't forget to subscribe. We see you next time.

Want to know more about Checkmk? Join us for our Introduction to Checkmk Webinar

Register now

More Checkmk Videos