Ep 34: Introduction to Checkmk Ansible collection

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

[0:00:00] Automate your monitoring with the Checkmk Ansible collection.
[0:00:13] Welcome to the Checkmk channel. Today, we are taking a quick look at the Checkmk Ansible collection.
[0:00:19] An Ansible collection consists of modules that interact with a managed system somehow and of roles that can do more complex tasks against those systems.
[0:00:30] With the Checkmk Ansible collection, we created some modules to interact with the Checkmk REST API to automate things and we also created some roles that help you set up a Checkmk server and automate your agent deployment.
[0:00:44] So much for the theory, now let's take a look at what we have here. The page you're looking at is the galaxy page for the Checkmk collection, you can find the link in the description.
[0:00:58] And this is where you find all relevant information, the latest release, and where you can find information how to download and install the Checkmk Ansible collection.
[0:01:06] Of course, if you find any issues or anything comes up, you can directly jump to the Issue Tracker here or we can take a quick look at the GitHub Repo.
[0:01:15] This is where all the content is hosted, really, and from where we publish the releases to the galaxy.
[0:01:21] So, if you want to interact, you can open an issue here if there's any problem that you find. Or you can open a pull request with an improvement or a new feature that you developed, and we love to interact there with you.
[0:01:34] You can see some people already did that. At this point, we have 10 contributors who contributed at least some piece of code, some improvement to the collection.
[0:01:43] And of course, in the README down below, you find all the relevant information. Again, how to use the role, what it includes, what it contains, and stuff like that.
[0:01:52] Okay, so those are the pages where you can look at. Now let's take a quick look at what the collection actually does.
[0:02:01] So, now we are at the server where Ansible is installed. And to install the Checkmk collection, we can simply, say, ansible-galaxy collection install tribe29.checkmk which is the full qualified name of the collection.
[0:02:20] And then we can see the most recent version is downloaded from the galaxy and installed. And I prepared a small playbook that showcases the features that we have in the collection currently.
[0:02:32] And you can find that playbook and the accompanying configuration as it just on GitHub and the link to that is in the description. So, let's just run that here.
[0:02:48] So, what it does? It first uses the server role, which is included into the collection and installs a Checkmk server and starts the site.
[0:02:57] Of course, installing and starting sites is configurable and you can manage several sites with that role.
[0:03:02] And the second part you saw is that we installed the Checkmk agent through the agent role on the Checkmk server where we're running at, so we are able to monitor the server itself.
[0:03:14] So, that's what has been done so far. Now we're taking a look at what the modules do. And there we can see we create folders, we create hosts in that folder.
[0:03:24] Then we discover the services on that hosts to have proper monitoring of that host. And after that finishes, we activate the changes and then we can take a quick look at how that looks in Checkmk.
[0:03:39] We need to wait just a few seconds because as you know the discovery takes a little time per device to run through and get all the information. And now we can see the activate changes dialog. And now we can take a quick look at our site here.
[0:03:56] And there we can see the hosts have been added. This is a demo setup, so you see a lot of red here because these hosts are not real hosts. 
[0:04:03] But you can see they have been added here, we see the test names, stuff like this. And if we switch back and let the playbook finish the execution, then it will clean up just to have the state like before for this demo here.
[0:04:18] And we see the hosts are removed, the folders are removed from Checkmk, and we activate those changes, and now you can see everything has run through as expected.
[0:04:26] And if we look at the web interface again, refresh the dashboard here, then we can see all the hosts are gone, only the localhost is still monitored.
[0:04:40] With that, thank you so much for watching. I hope you will give this collection a try. Try it out see what it does.
[0:04:47] If you find problems, report them back to us, we appreciate any form of feedback. If you feel like you can improve something in the collection, feel free to open pull requests, we always do appreciate that.
[0:04:47] And with that, be sure to subscribe to not miss another video. And I will see you guys around.

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

Register now

More Checkmk Videos