Ep. 8: Working with Host and Service Groups in Checkmk

Please accept marketing cookies to watch this video.

[0:00:00] Welcome back to the Checkmk channel, today we're looking at host and service groups.
[0:00:14] The concept of host and service groups is pretty straight forward, you can simply bundle hosts and services together and then give it a name. And while operating your monitoring system you can then perform actions on an entire group instead of having to apply the same action over and over again on each individual host. So for the management of these host and service groups you go to 'Setup' and then under 'Hosts' you have 'Host groups' and under 'Services' you have 'Service groups'.
[0:00:45] So if I click on Host groups, I see there currently are no groups. But if you want to toggle fast to service groups under 'Related' there is a option 'Service groups'. So here you can toggle between the two. Okay so now let's add our first group.
[0:01:05] Okay we first need to give it a handle or an ID, and I will call this one 'prod'and then alias will be 'Production Systems'. Okay now we save this one, and let's quickly create a second one, which is called 'test'. And will be 'Test Systems'.
[0:01:37] So what you need to know is that one host can be part of multiple groups. In this example we have 'Production Systems' and 'Test Systems', so a host will probably not be in both systems at the same time. But if you for example have another group called web servers, then the host could be in the production group and be in that new group called web servers. Okay so now we need to assign hosts to these groups. And in Checkmk that is done using rules. So you have this button here called 'Rules'. If you click on it we can simply create a new rule and you see the rule is called 'Assignment of hosts to host groups'. Okay so let's create one. Now we select the group that we want to assign the host to. It's already pre-selected now, 'Production Systems' that's fine and now we need to set the conditions. So when is a host being assigned to this group, we can use a host tag for that. There is one called 'Criticality' here. Let's add that one. So we want to add the host to the group when the criticality is production system, these are predefined criticalities in Checkmk. So that looks about right let's save it and I do the same thing for our test group.
[0:03:05] So let's create another one.We assign them to the test systems and again the host tag 'Criticality' and this time it has to be 'Test system'.
[0:03:21] This is of course a very simple example where the group name is pretty much the same as the host tag.
[0:03:27] In practice you will probably have more complex rules to assign hosts to groups and that's why groups are useful to use alongside host tags. Now let's take a look at the rules, you'll see that when the criticality is 'Productive system', we will assign them to the production systems group and the same goes for 'Test systems', then we assign them to the test systems group.
[0:03:54] Now the only thing left to do is activate the changes, as always. So let's click here. And now all our hosts should be assigned to the correct group, so let's take a look.
[0:04:09] And you can find that here under 'Monitor', and then 'Overview', and 'Host groups'. So here you have an overview of all our host groups.
[0:04:21] You'll see that there are six hosts in this group you also can see the amount of services here, and their status so 'Warning', CRIT, OK, etc. So now the question is where is our Test systems group, well it appears that it's empty and that's because none of the hosts meets the conditions that we set on the rule. So whenever a group is empty it will not show up in this host group's overview.
[0:04:46] So let's fix this. And we can do that simply by giving one or more hosts the criticality 'Test system'. So we go to the setup of our hosts so Setup > Hosts and let's give these two so just check the boxes so we can edit the attribute at the same time.  
[0:05:06] And now let's go to 'Hosts' and then 'Edit attributes'.Okay so we can change the criticality and you can do that here. You can explicitly set it to something and we're gonna explicitly set it to 'Test system'. Okay then we simply save and obviously activate the changes.
[0:05:36] And now if we go back to monitor and or host groups you'll see that there is now a 'Test systems' group with the two hosts that we just gave the new criticality. And you can do the same with services so once again go to Setup and then under Services go to 'Service groups'.
[0:05:56] And now let's add one. So add group and we'll call this one 'cpu' and alias should be CPU. Okay, save. Just like with host groups there are rules. So now let's set the rule for this service group.
[0:06:14] Now this time we don't care about properties of the individual host. We just going to assign services that start with the string 'CPU'.

[0:06:28]

So every service starting with 'CPU' should be part of this group. Okay now, save it. And as always apply changes.
[0:06:47] And to view the service groups once again go to Monitor and then here to 'Service groups'. And now you see we have a group called CPU with nine services in it. When you click on a service group, you'll see an overview of all the services grouped underneath their host.
[0:07:10] Like you can see this can create a very clear overview of all services and hosts that share specific properties. And as you will see in the next episode, you can also use these hosts and service groups in our 'Quicksearch' to search for a very specific host and services. So that was our introduction into hosts and service groups. You can of course do a lot more with these groups and if you want to learn more, you can take a look at our documentation on docs.checkmk.com.
[0:07:42] If this video was helpful to you please subscribe to the channel and like the video. See you next time.

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

Register now

More Checkmk Videos