|[0:00:00]||Hello, my name is Bastian Kuhn and today, I'm gonna show you a short introduction into the Checkmk REST API..|
|[0:00:18]||First, I'm gonna show you the Swagger documentation, which you can use to play around a bit and to see all the calls which are possible. And then I'm going to show you where you can find some coding examples how to use the API endpoints.|
|[0:00:34]||At first, let's look into the Swagger documentation. You can find them on the left side, on the Help part. There's a link for REST API interactive GUI.|
|[0:00:50]||I can open it in a new window. It just takes a moment to load. Okay. After the page is loaded, you just need to scroll a bit down. And in fact it's quite a bit because here you already can find a lot of documentation. It's basically the syntax and the commands you can use for the replacement of the Livestatus queries commands you can use for the replacement.|
|[0:01:26]||But of course, there is way more you can do. At some point, you're going to end up with the list of endpoints and here we are. They are separated in different groups.|
|[0:01:42]||You can go, for example, with the agents part, where you can handle everything related to the agent bakery, including getting agents, bake the agents, sign the agents. You can control the Dynamic Configuration Daemon.|
|[0:02:02]||You can set Acknowledgments, which we look into later. You can activate changes, you can manage tags. You can set even rules for the Business intelligence. You can handle your groups, like Contact groups, Host groups, Service Groups. You can set Downtimes. We're also going to look into that.|
|[0:02:26]||You can get all the information from the Event Console. You can manage your Folder structure in the Setup. It means creating folders, get a list of the folders, delete folders. You can do the same for hosts.|
|[0:02:42]||Also, for that we're going to do a little example. So, you can basically create those delete hosts or change even the attributes. In another group you can create tag groups. Then you can manage your Passwords store. You can create every type of Rules. You can search for Rulesets.|
|[0:03:09]||Here the Service status part is a replacement for everything you did with Livestatus before. You can manage the Service discovery, which means you can start discovery. In other groups in this time the Service groups, you can create Time periods. And finally, Users. The last one is just the version.|
|[0:03:34]||The good thing here with the specker is you are already authenticated. So, when I click on one of the endpoints, for example, the version here. I can just try it out.This one has no parameters, and click execute. I see the request was sent. I see the URL to which the request is sent.|
|[0:04:01]||And finally, I can see the response. The response is always like here, is a JSON object. So, then let's do some examples. First, let's start with Acknowledgment. For that, I need to correct endpoint. This's basically on the beginning. Here you can set acknowledgment for host or for service.|
|[0:04:34]||Let's start with the service. I'm gonna try out. This time, I have a request body, where I need to fill out the needed information. First, acknowledge_type, service. That's correct. We don't want to have the acknowledgment sticky. Sticky means when the acknowledgment is for warning server or for warning service, it will stay acknowledged if the state changes to critical.|
|[0:05:07]||We don't want the command for persistent. This means the command stays at the service or server even the problem is gone. You don't want to send notification. But what we need is comment. For this example, we just keep it how it is here. And now we just need to fill in the host and the service description.|
|[0:05:29]||For that, I go back to Checkmk and look for a problem. I have two of them. Let's see. On pve I have the service Check_MK on failure. Let's what's that. I enter then pve, and here "Check_MK". I execute.|
|[0:06:03]||I again see the curl request, which I can use on the command line to test it out. Just a little information here, if you do the same on the command line, you won't be authenticated, you need some header information for that. But I show you later how this works. For now we stay with the response. Basically, there is none. But let's see.|
|[0:06:35]||In Check_MK, there is already my acknowledgment. But no, let's say we want to do downtime. I scroll a bit down to the Downtimes part. Then I'm gonna do a host related one. I'm gonna try it out. Then again, I see the the request body. I need to enter some valid information. That's that. No, let's go back to March.|
|[0:07:24]||Let's start at 10th and go until next month. The option here are start_, end_ time. If you set the duration, which we don't do now, you're gonna create a flexible downtime. This time let's stay with security updates. It's for host and in this time it's for the pve. We execute.|
|[0:07:59]||And then we should already have a downtime here. And refresh. And with this icon here, I can see the hosts in downtime. And as a final example, I'm going to show how to get the hosts and change the hosts. I know I'm gonna search for the Hosts part, which is here. And the most simple thing is to just get the list of all hosts.|
|[0:08:30]||To this endpoint, just try out. I execute. And now the response is a little bit bigger just not too big. I only have two objects. And there's a part value on the bottom. There we have the pve host. And we have, wait for more a bit, the cluster object, and a bit down we have the testsrv.|
|[0:09:10]||So, that are basically our hosts we can work with. If I directly go to a host, let's use this as an example, let's collapse this and go with Show a host. Can Try it out. And the host_name here. The effective_attributes just basically mean if you want to get all attributes, which the host gets by folders.|
|[0:09:43]||In my example, they are in the main directory and there's stuff or nothing. So, I can save that, just execute it. And now I just have this single object. One little part here is now important. In the response headers, you're also going to find this etag. If we later want.|
|[0:10:17]||If you later want to change this object, we need to make sure to have the latest etag. So, basically we prevent with this feature that we change within the API, a host which was changed in between from another system. So, imagine you would load the host information, you want to change the host information, and then store it back. But in between this information is changed so the etag will change and you wouldn't be able to update the system then.|
|[0:10:51]||So, we just copy it for now And then finally, we're gonna add a label to the system For that, we need the update host. It's like here it's the put one. I'm gonna try out. We need to enter the etag header here.|
|[0:11:22]||We need to enter the host_name. And here you already see a little example how to add new attributes there's this part here. how to update existing attributes, so basically how to change them, and how to remove them. We want to add new ones, so basically I gonna remove this both from the examples. And since we have Json here, you need to remove the comma here as well.|
|[0:11:58]||It's not like in Python. And we wanted to create the label, so for that would be that we can see how labels look. So, let's go back to the response here. And sadly, if we scroll down in the attributes, we just have a tag but not yet the label.|
|[0:12:26]||So, to show you how to find out how they look, I'm gonna just add a label to one of the hosts. Let's use this one. Let's go with server: yes. I activate the changes. Then I vary the host.|
|[0:13:07]||And now we can see in attributes we have a key labels. And there we have also a label. I copy it, paste it in here. I remove the IP address part because I don't need it, I just want to set the label. And testlabel: yes. Execute. Sorry, I need to remove the comma here. Execute.|
|[0:14:00]||And we see a 200 response. If we look then on the system, we see the label. Another nice way to see these labels is actually also possible in the overview. If I go back to the folder with the Display option, I can, say, Show explicit host labels. And now I can already see it here.|
|[0:14:32]||If you now want to build your own scripts, I'm going to show you another documentation. It's also with Help. And it's the REST API documentation. Also, this documentation needs a moment to load On the left side then you find some examples. As I showed before, Acknowledgment and Downtimes. Let's use Acknowledgment as an example.|
|[0:15:08]||You now have the full documentation about the terms. And the best thing here on the right side, you got the examples. This is the normal Payload but you can see a Python example for the whole thing. Another Python example with urllib.|
|[0:15:32]||On the right side, you can see the Payload You can see a request example with Python. You can see urllib example with Python. And for example, if you want to work on the command line, there's even a curl example with a back script. The final thing we need to talk about is the authentication. It's really simple. It's either a user with a password automation secret.|
|[0:16:04]||As you can see in the example here,for the authentication just this header is needed. and the username and the password is set here. This users here are nothing else than the ones you can find in Setup, Users. And you can either use the automation, with automation secret or a normal user with a normal password here.|
|[0:16:32]||I hope this video gave you a short introduction into the Checkmk REST API. Don't forget to subscribe and see you next time.|
Ep. 1: Installing Checkmk 2.0 and monitoring your first host
In this video, Baris explains how to take get started with Checkmk and start monitoring your first host within a few minutes.
Ep. 2: The Checkmk 2.0 user interface
In this video, Baris take you through the new user interface in Checkmk 2.0. He explains the various components of the User interface such as the new navigation menus, the Sidebar, main dashboard, tactical overview, how to switch between the Checkmk interface themes and much more
Ep. 3: Using SNMP to monitor network devices in Checkmk 2.0
In this episode, Baris explains how to monitor network devices with Checkmk. SNMP is a protocol that many switches, routers, printers, UPSs, hardware sensors and other devices have implemented with the purpose of being able to monitor them easily.
Ep. 4: Monitoring Windows in Checkmk
In this video of our Getting started with Checkmk series, Baris explains how to install a Checkmk agent on a Windows host system and add that into your monitoring environment.
Ep. 5: Using metrics and graphs in Checkmk 2.0
In the 5th episode of the Getting started with Checkmk series, Baris explains using various metrics that you can monitor in Checkmk such as CPU utilization, CPU load etc. You can also see graph visualizations for these metrics or create and customize your own as per your requirements.
Ep. 6: Updating Checkmk 2.0 and using multiple instances
In this video, Baris explains how to update your Checkmk instance. It is very easy and can be done within minutes. You can run multiple Checkmk instances with different versions on the same system. This gives you the flexibility to test the new version before using it in production.
Ep. 7 (part 1): Working with rules and setting thresholds in Checkmk
In the following three-part videos series, Baris explains rule-based monitoring with Checkmk. In the first part, he shows you how you can work with rules and set threshold values. Rule-based configuration is one of the key features for Checkmk which helps you to scale your monitoring easily within minutes.
Ep. 7 (part 2): Smart rules with Host Tags in Checkmk
In the second part of this video, Baris explains using Smart rules with host tags in Checkmk. In the first part, he shows you how you can work with rules and set threshold values. These are features that you can use to build your rules even more intelligently and to better organize your monitoring.
Ep. 7 (part 3): Managing Hosts in Folder in Checkmk
In this final part of our episode on Rule-based monitoring in Checkmk, Baris demonstrates how to manage hosts in folders in Checkmk. This helps you to apply your monitoring configurations at scale and organize your hosts according to your needs.
Ep. 8: Working with Host and Service Groups in Checkmk
In this Baris demonstrates how to create host and service groups in Checkmk, so you can perform actions on an entire group instead of configuring each of them individually.
Ep. 9: Using the Quicksearch function in Checkmk
In this episode of the Checkmk tutorials, Baris shows how you can use the Quicksearch function in Checkmk. You can use it to easily find and manage certain hosts or services. He also explains some examples of filters to you. In Checkmk 2.0 you can use the same syntax in the Seach function found in the monitor menu to get identical results.
Ep. 10: Detecting configuration errors with the Analyze Configuration feature
With the Analyze Configuration feature, you can check if there are any configuration errors in your installation. Checkmk controls a number of possible security risks or potential performance restrictions and indicates if there are any problems.
Ep. 11: View creation and customization in Checkmk
In this video, Baris demonstrates how to customize headers, columns, and more in Views in Checkmk for yourself or other users. He also explains how to create custom views and add desired information to these views.
Ep. 12: Acknowledging problems in Checkmk
In this video, Baris explains how you can acknowledge problems in Checkmk. This function helps you to qualify the states of hosts and services. This allows you to keep track of messages in the main dashboard and, for example, you can add comments to problems.
Ep. 13: Scheduling downtimes in Checkmk
In the episode of our Getting started with Checkmk series, Baris explains how you can manage the maintenance times of your systems in Checkmk. Such scheduled downtimes prevent your monitoring from sending false alarms when a host or service goes to WARN or CRIT during maintenance work. You can also inform the users concerned about the maintenance via Checkmk.
Ep. 14: Distributed monitoring with Checkmk
In this video, Baris explains how you can connect several Checkmk instances to a monitoring system and then manage it.
Ep. 15: MKPs and Plugins in Checkmk
In the 15th episode of our Getting started with Checkmk tutorial series, Baris explains what are Checkmk Extension Packages (MKPs) and how easy it is to integrate them into your Checkmk monitoring environment. MKPs are the preferred format when you make your own extensions as it makes it easy to share with other users or deploy in distributed environments.
Ep. 16: Working with 'Bulk Actions' in Checkmk
In this episode of our Checkmk tutorials series, Baris explains how you can save a lot of time with bulk actions. With this feature you can perform various tasks such as deleting, renaming, service discovery etc. on a large number of hosts simultaneously.
Ep. 17: Working with network topologies in Checkmk
In this video of our gettign startted with Checkmk series, Baris explains how to map network topologies in Checkmk. This feature is quite helpful to manage your network and prevent any unnecessary notifications from the devices in your network.
Ep. 18: Creating and customizing dashboards in Checkmk
In this video of our Getting started with Checkmk series, Mathias explains how you can create and customize dashboards in Checkmk 2.0, so you can get insights into your monitoring according to your requirements. Find out more in this video.
Ep. 19: Monitoring websites and their certificates with Checkmk
In this episode, Bastian demonstrates how to monitor a website and its certificate with Checkmk. You can also monitor specific web pages with Checkmk by using the several options that will suit your use case. Learn more in this video.
Ep. 20: Configuring dashboard elements in Checkmk
Learn how to add data visualization elements of the various metrics into your Checkmk Dashboard. In this video, Mathias explains how you can configure these elements and create a dashboard as per your requirements.
Ep. 21: Setting up notifications in Checkmk
Learn how to set up notifications in Checkmk and assign relevant contacts and contact groups to be notified for various events. Later in this video, our presenter Bastian also demonstrates how you can set up rule-based notifications according to different conditions for hosts and services.
Ep. 22: Monitoring logfiles with Checkmk
Monitor your logfiles with Checkmk using its Logwatch plugin. It is very useful when you want to monitor your logfiles regardless of whether you are using a UNIX/Linux or a windows based system. Learn more in this video.
Ep. 24: 3 Rules for efficient network monitoring
In this video, Bastian demonstrates 3 rules that will help you to efficiently monitor your network interfaces. With Checkmk 2.0, with just three rules, you can set up an efficient network monitoring that will not only monitor all of your network interfaces but also simultaneously provide a detailed overview of all of your ports.
Ep. 25: New UX and security improvements in Checkmk 2.1
Checkmk 2.1 come with many UX improvements such as pre-built dashboards for Linux and Windows, faster core performance and much more. Security features such as two-factor authentication etc. were also added in this new version. Watch this video to learn how to use these new features and enhancements in Checkmk.
Ep. 28: Working with InfluxDB integration in Checkmk
Learn how to send data to InfluxDB from Checkmk. As InfluxDB introduced a new protocol to send data to it, a new connector was developed with Checkmk to talk natively with it. Learn more about it in this video.
Ep. 29: New agent architecture in Checkmk 2.1
With Checkmk 2.1, the agent architecture was modified to enable performance improvements and add new features such as TLS encryption, data compression, and the reversal of direction of communication from the agent. This will enable push mode and pull mode.
Ep. 30: Clustering the Checkmk appliance
In this video, Robin demonstrates how you can cluster your Checkmk appliance to make it resilient against hardware failures. If you are using the Checkmk hardware appliance, it may be helpful to cluster your appliance to maintain high availability.
Ep. 32: Working with the Agent bakery in Checkmk
In this video, Robin demonstrates how to roll out agent packages with the required configuration for different monitored systems using the agent bakery in Checkmk. The "Automatic agent update" is quite a helpful feature as it pulls the latest configurations for an agent automatically and you don't need to manually update all of your agents deployed on different systems.
Ep 33: Monitoring Docker containers with Checkmk
Learn how to monitor Docker containers with Checkmk.In this video, Robin demonstrates the process of setting up a rule to configure the docker plugin and bake an agent with the desired settings for the Docker host.
Ep 34: Introduction to Checkmk Ansible collection
Last year the Checkmk Ansible collection was created to interact with the Checkmk REST API. In this video, Robin demonstrates how you can use this Ansible collection to automate your monitoring with Checkmk.
Ep 35: Monitoring SQL databases with Checkmk
In this video, Robin demonstrates how you can configure your Checkmk site to monitor your SQL databases. As there are many flavours of SQL databases, the process is mostly the same.
Ep. 36: Introduction to different types of checks for monitoring with Checkmk
Learn about the different types of "checks" and services in Checkmk. In this video, Robin demonstrates how you can expand the information collected by your Checkmk agent using these different "Checks".
Ep. 43: Working with Hardware/Software inventory in Checkmk
In this video, Robin demonstrates the hardware/software inventory feature in Checkmk. With this feature one can get an overview of various pieces of hardware present in their servers, switches etc. and also the software packages installed on their operating system. Watch this video to learn more.