Ep. 8 (part III): Managing Hosts in Folders

To load this YouTube video you are required to accept advertising cookies.

Note: All the videos on our website offered in the German language have English subtitles and transcripts, as given below.

[0:00:10] Now we come to the third part of our trilogy about configuring services and hosts with rules, and as promised, I would now like to show how to manage hosts in folders.
[0:00:22] Working with folders makes sense if you have more than a handful hosts – if there are 20, 30 or 50 hosts – and some of our users have many thousands of hosts in their monitoring. So it is very important that you then have a logical structure. Well, with the folders it is in principle very easy – so you can imagine that, with a normal file system, such as those in Linux or Windows, that I simply have folders in which there are subfolders, and finally the contents are not files, but rather hosts.
[0:00:52] There is also a good manual article, which I would just like to show you now.
[0:00:56] So if you go to our homepage, in the official manual you will find in the article 'Host Administration' – i.e. the administration of hosts – a description on working with these folders, and there is also a very nice graphic, as you can see.
[0:01:15] I have this main folder – the main directory – which you always have, it is automatically there, and I can create subfolders in it. I can then manage my hosts in these folders, and once I have done that, I not only have a better overview, but then I can – and that's exciting about this – I can attach attributes such as host tags to the folder, and then all hosts in the folder automatically get these attributes, and I can also even define exceptions. This can be seen here in this second diagram.
[0:01:47] So here I have set, for example, in the main folder that a host should have the tags 'prod' and TCP – this would also work in exactly the same way with labels. I can then say – in the Network folder there is additionally – or as a replacement for TCP – there is tag 'snmp' in this case – and the Host F then has the tag 'test' again instead of 'prod' and so the result is that, for example, the Host F has inherited the tag 'snmp' from the Network folder, and the tag 'test' is assigned here directly.
[0:02:23] Host D, for example, inherits the prod from the Main folder, and the 'snmp' from the Network folder, and Host A which simply inherits everything from Main Folder because it was not explicitly assigned on the way there. So this concept is very powerful, especially in combination with the rules, if you then assign rules via the tags – or you can also put a rule directly into a folder.
[0:02:48] Let's now just take a look at this in practice. Back to our monitoring system that we have built up during this short series. And I go to the Hosts management as always, and now I can see a list of six to seven hosts. So, how do I now get to my folders? Quite simply – there is a button here – you just have to find it.
[0:03:07] It is called 'New folder', and it is here. So - please do not be alarmed – why does this folder have so many settings?
[0:03:16] I'll explain that right away. First open the Basic Settings. The most important thing is the title of the folder, and I'll use the same example as in the handbook.
[0:03:23] Here I'm going to say folder 'Networking', I'm just filling out this one word, and then I will save the whole thing. And when I go up again, I can see this single folder, and I then create another, second folder, which I now call 'Servers', and I also do nothing more now than to simply save this.
[0:03:45] So now I have these two folders, and next I simply want to move the hosts into the individual folders.
[0:03:53] I can do this in different ways, the easiest is when I again activate the check boxes, and then I select the switch, for example, and here below at (select target folder): choose Networking, and then Move to – now it has been moved into it.
[0:04:13] If I now want to move all of the others to Servers, I can, for example, with the little cross at the top simply turn on all the checkboxes at the same time, and say Move to Servers, and there they are. The main folder is now empty, so to speak, there are no hosts hosts in it at all, and it is actually something that we recommend – that you add either folders or hosts to the folder. You can also have a combination, but it could then get a bit confusing. So, unless there is a good reason, then either just create additional subfolders in the folder, or put the hosts into the lowest level subfolder.
[0:04:53] I'm now going to the Servers folder again - if I move the mouse up a bit higher here, you will see three symbols open.
[0:05:01] The left one is the pen, which is the properties of the folder. I also get this when I go into the folder itself, and go to the top, to Folder properties, it is exactly the same mask, so we are now back to the spot where I said earlier that "I'll explain about it later".
[0:05:18] We now have very many settings here – these are all of the properties that we know of for the host – they can now also be defined for the folder, and they will then be inherited by the host. So now, for example, I'm now closing everything here, except for the last one, My Own Tags – Application.
[0:05:39] Here I could say for example – all hosts in this folder are web servers. So, and it now follows that a host which is located in this folder is a web server, unless this tag or attribute is defined differently on the host itself. I will now look at the dbserver01 again.
[0:06:04] Here Database Server is explicitly selected, which means that it would not inherit the attribute.
[0:06:10] But if I take out this cross, you can see that it now has the property 'Webserver', because that is inherited from the folder 'Servers'.
[0:06:21] In short - if you build the structure well, then you will need very few such exceptions, since you can just pass on most of the attributes via the folder. But in individual cases there is always the possibility to deviate from that.
[0:06:33] If we want to, what we can now do here, for example, is to say – I actually want to remove this explicit tag from all of the hosts that I created earlier.
[0:06:45] Of course you can now go into each one and take out the checkbox. However here there is also a button called Cleanup, which has the function of removing explicitly-defined attributes.
[0:06:59] I can now see here in this folder that I have set the IP address on all hosts, for example. I could now remove these, and pass them on via the folder.
[0:07:07] This is of course total nonsense, because the address should be different for each host. But I could, for example, remove the Criticality and the Application from the hosts, and thus achieve the effect that they are passed on via the folder.
[0:07:23] If I now go into any of the hosts – let's take the dbserver03, for example - then I can see that these have now also been inherited again, and in the Custom Attributes at Criticality – here the checkbox has now disappeared, and in this case there is the default value, so why not put the folder here?
[0:07:44] Well, simply because I did not specify this attribute in the folder. That is why it is inherited from the default. The rest is as before – I have now inherited my host tags via the folder structure, and can now define my rules in the normal way by working with these tags again.
[0:07:59] But I can also do a new, completely different thing that is now – I can attach rules directly to the folder, or, it is also possible to make the folder a property in the rule. Let's go back to the rules that we have created.
[0:08:11] I'm looking in CPU again – I'm looking for my rule for utilization. I take the first of the two rules, and there you can see a condition in the second line – namely the Folder. And here I say – this rule only applies in the Servers folder, and that of course means in all of its possible subfolders as well. I save, and you will see something surprising, namely that this rule chain has broken down into one chain per folder.
[0:08:41] The simple rule here is that things specified in a subfolder always take precedence over the main folder.
[0:08:50] That also makes total sense. It means that if you have specified something in the Services Folder, this is of course more important and binding for the computers there than if you had specified it in the Main Directory. Therefore, there is no longer a common order, but instead one for each folder. And that is actually the whole thing – how the folders function technically – so it is really a very powerful concept for getting very, very large numbers of hosts under control.
[0:09:16] Incidentally, this also has another advantage – if you add a new host and this whole folder structure has been intelligently drawn up, then it is enough if the host is created in the correct folder – there it will automatically inherit all tags and all attributes – and the whole monitoring will then be set up as it should be.
[0:09:34] Now you will be asking yourself the question of what a sensible structure for folders is? How should I create my folder structure so that it somehow works well. One can't really say that there is a general rule, but from experience it has emerged that there are three important principles. One is structuring by location, then there is the possibility to structure by technology, and the third is to structure by organization. So, for the location example I could say that I have a data center in Munich, one in Shanghai, and one in Budapest, and I can simply create three folders for it. And this has the advantage that in distributed monitoring, for example, I can use the folders to very easily determine which host is monitored from where.
[0:10:14] A breakdown by technology could be, for example, I say that I have network devices in the folder, and then for the folder I can say that everything in it should be monitored using SNMP.
[0:10:24] The third option – Organization - would be according to groups of people – for example, all people who are responsible for the Linux server. Then I again have the advantage that I can fix permissions in the folder for who is allowed to edit these hosts, and who is permitted to see them in the monitoring.
[0:10:42] And of course I can also combine all of the three principles, and choose one of them depending on the level.
[0:10:46] So, now we have completed our trilogy. I hope it was interesting for you, and that we'll see you soon in the next episode.

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

Register now

More Checkmk Videos