Ep. 16: Working with 'Bulk Actions' in Checkmk
Read Video Transcript
|[0:00:00]||Welcome back to the Checkmk channel in this episode, we're taking a look at a topic requested by our viewers namely how to work with bulk actions.|
|[0:00:18]||With bulk actions, you can perform certain actions on a large number of hosts so now let's take a look on how that works. We are back in our test site which we have been using throughout the series.|
|[0:00:31]||For now let's go to setup, hosts and then into the servers folder. So here we have six hosts and you see a checkbox at the beginning of each line, and you can use that to select one or multiple hosts and you can use the checkbox at the top to select or deselect all of them.|
|[0:00:55]||For now, let's check the four database servers and then go to the Hosts menu. Now here under unselected host, you see all the bulk actions that we can perform on these hosts so you can move them to another folder, you can delete them, edit the attributes.|
|[0:01:15]||For now, let's just edit the attribute. Here you see an overview of all the attributes that we can edit in bulk. And it's important to know that you will only edit a certain attribute when you check the box of that line.|
|[0:01:38]||And if a box is already checked like here at IP that means that all the selected hosts are sharing the same value for that attribute. You can also see which are using the default value for a certain attribute or you can see if the value differs for a certain attribute, so that means that the host we have selected do not share the same value for this attribute. But for now, let's edit an attribute.|
|[0:02:09]||Let's edit networking segment. So we check the box and then we choose a value that we want to give. So let's choose the WAN. And now if we save that, if we press save then the WAN value for the networking segment will be applied to all or selected hosts.|
|[0:02:40]||In Checkmk, there is a difference between explicitly setting the value of an attribute or leaving it empty so it gets the default value or it inherits the value of a folder, when you edit a single host and remove the value of an attribute and it will fall back to the default value or the inherited value.|
|[0:03:02]||When doing bulk edits this is not possible. You can only set values but you cannot remove them. So if I bulk edit these hosts again and I would remove this checkbox that doesn't mean that I will unset the value of this attribute it just means that I don't want to edit it.|
|[0:03:29]||So if I were to save it everything will remain the same. The reverse is true for the bulk removal of explicit attributes action. So let's select the same four hosts and go to the host menu and click on remove explicit attribute settings.|
|[0:03:55]||And you'll see that the list is a lot shorter here that's because only attributes show up that have a value explicitly set. So you see that the criticality has been set on two of the four hosts while the IPv4 address has been set on all of the selected hosts and of course also the networking segment that we have just set.|
|[0:04:17]||So now let's remove the networking segment for these four hosts and press save. And if I now look into a single host here you'll see, that the networking segment is again the default value 'Local network'.|
|[0:04:38]||So this is a powerful way to reset our inheritance and make sure that it worked properly again. Let's say that I want all hosts in a folder to start inheriting an attribute directly from the folder. If I were to have hundreds of hosts in that folder that have the value for that attribute explicitly set and it would be a painful process to reset or remove that attribute on each of them.|
|[0:05:06]||But this way we can easily make sure that all hosts will inherit the value that we want.|
|[0:05:14]||So another important action we can perform in bulk is the adding of missing services to a host or remove them if they have disappeared and you already know this feature from earlier episodes and you can easily go there by clicking on this yellow box.|
|[0:05:36]||And then you will see an overview of all the services that are currently being monitored on this host.|
|[0:05:44]||Since we are talking about bulk actions in this episode, I want to show you how you can do this for multiple hosts at once. Like with other bulk actions you first have to select the host you want to perform the action on. So once again let's select our database hosts and then go to the host menu and here you find this item discover services. In this dialogue, we can exactly configure what we want to do.|
|[0:06:16]||The currently selected mode is to add unmonitored services and new host label that means it will only add these two things and it will not remove any vanished services. Automatically removing vanished services can potentially be risky.|
|[0:06:37]||For example, let's say that you have a problem with one of your file systems and it vanishes.|
|[0:06:42]||In that case, you don't want it to be automatically removed from your monitoring because that way you wouldn't know that there is a problem, instead you want to be notified about the issue.|
|[0:06:53]||If I would have configured remove vanished services then it would have been simply kicked from the monitoring altogether and that's not without risk. So here you can choose if you only want new services to be added or the inverse if you only want to remove vanished services.|
|[0:07:13]||And with this third option, you can do both at the same time, the fourth option will let you do a service discovery from scratch. So basically it will remove everything and then re-discover everything and then the fourth option will only discover new host labels. Then there are some additional options for example this one only include hosts that failed on previous discovery.|
|[0:07:42]||When you do a bulk or a CSV import of hundreds of hosts and do a service discovery at the same time then it could be that a few of these hosts are not reachable at a time. So to prevent that you have to find and select all these hosts manually, you can simply select this checkbox and it will only perform the service discovery on the host that previously failed.|
|[0:08:06]||And then there is another option to only run the service discovery on host where the discovery check has failed.|
|[0:08:13]||This is a check that warns you when there are undiscovered services on your host that are currently not being monitored. When you are ready simply click start and this will trigger a background job and this can take a while depending on the number of hosts that you are rediscovering.|
|[0:08:32]||When it's ready the state like here we'll go to finished and down here you'll see a summary of everything that has been discovered. So it discovered a total of four hosts, a total of eight host labels has been discovered and the total of 116 services have been discovered.|
|0:08:56||So now let's go back to our host configuration. So there is another way you can perform a service discovery in bulk and that is for the entire folder. So in the host menu, there is this section in this folder and it also has an item discover services when you click it you'll see a similar screen that you saw before, the only change is that there is a new checkbox include all subfolders and if you check this it will perform the host discovery or the service discovery recursively, so if there were any subfolders here then it would also do the service discovery for all those subfolders.|
|[0:09:44]||Another bulk action that you can perform on hosts is Renaming.|
|[0:09:53]||While this might not sound very spectacular, anyone who has done this before knows that in Checkmk this is actually quite a complex undertaking. And that's because the hostname is also the key for historical data and the logs and the databases.|
|[0:10:10]||So when you rename a host, Checkmk actually has to go through all these logs and databases and update the hostname. In order that you don't lose any historical data after renaming.|
|[0:10:23]||If this were not the case you could have simply deleted or removed the host and then added again with the new hostname. But often you want to keep data regarding availability notifications and so on.|
|[0:10:36]||And that's why the renaming action works in such a way that it will basically rename the entire past of a host to the new hostname in order that you have complete historical data.|
|[0:10:49]||So it's more complex than it sounds and it also requires your Checkmk site to be stopped in order that the host hostname can be updated in a database consistently.|
|[0:11:02]||So if you were to rename a large number of hosts and this could be quite a time-consuming undertaking because for every host the Checkmk site has to be stopped and started again and that's why there is a bulk action to do this.|
|[0:11:15]||You can find the bulk renaming in the host menu here, and you'll see that the include all subfolders is already pre-selected. And this would mean that it would perform the renaming recursively for all hosts and all subfolders.|
|[0:11:43]||Important is this hostname matching and this is where you configure which hosts need to be renamed. If you leave this empty then it will apply to all hosts.|
|[0:11:58]||This field will accept a regular expression and if you want to read more on the topic then you can find an article in our documentation.|
|[0:12:07]||Important to know is that this will match from the start of the hostname. So I can for example say DB_server and now it will match on all hosts starting with DB_server.|
|[0:12:25]||Now we need to configure the renaming operation we cannot simply give all hosts the same name because hostnames are unique. So now let's configure one by clicking 'Add renaming'.|
|[0:12:42]||In this first drop-down, you'll see some pre-configured operations you can choose from. For example, case translation and with this one, you can convert all host names to either upper or lower case and this can be quite useful after an import if the case of all the hostnames are not consistent.|
|[0:13:04]||So let's convert all our hostnames to uppercase now. You can simply click 'Bulk rename', and before it will actually apply the rename you'll see an end result that it would be. If I click 'Cancel' I can go back and change my configuration.|
|[0:13:30]||We can for example add a second rule. So add renaming and this time we'll add a suffix and we'll add a suffix of '_test'.|
|[0:13:45]||And if I then once again go to the example so both rename you'll see that every hostname will have a suffix '_test'. But it's not an upper case yet and that's because we added the suffix after the case transformation.|
|[0:13:59]||To change that we can simply drag the rule above the case translation. So if we go to the example now, you'll see that everything is in caps.|
|[0:14:18]||Then there is a more extensive operation you can perform, more extensive than the case translation and the suffix and that one is the 'Regular expression substitution'. So let's first remove the other two.|
|[0:14:39]||So this one is a bit more complex, but I will show you a good example of what you can do with it. Instead of naming our hosts 'DB_server' and I followed by a number I want to name them 'db - number - server', all lowercase. So to do that I would have to extract a portion of the hostname and reuse that in the new hostname. And to do this I would need to create a subgroup in regular expression and in my case I want to extract the part that's always at the end after DB_server.|
|[0:15:25]||So how would I write that. So I want to capture everything after 'DB_server', and you could write that like this. So every host that starts with 'DB' or contains 'DB_server' and then you have this group and what is in the parentheses is what we want to capture and " .* ", basically means anything or everything. And this will work fine because we know that we have only four hosts and all of them have a number after 'DB_server'.|
|[0:16:10]||But if we would for example have a host that was called only 'DB_server' without a number then this can potentially go wrong because then there is nothing to capture. And the renaming of the new host will probably not work how we want it to work.|
|[0:16:31]||So we could write this in a safer way we could for example write " ^DB_server(\d+)$ " parentheses to start the group and then we want to capture "\d+" and then a "$" sign to say that's the end of the string. So what is written here is the string starts with 'DB_server' and then we want to capture this group '\d' means any digit and "+" means one or more. So it will capture any hostname starting with DB_server and followed by one or more digits and then the end of the string.|
|[0:17:26]||And now we need to configure with what we want to replace it. And like we said we wanted to replace it with "db-\1-server". The "\1" will be replaced with whatever we captured here in our original hostname.|
|[0:17:44]||So let's take a look on how this will look. And now you see that all our hostnames will be renamed to 'db-number-server'.|
|[0:18:06]||And if you are happy with the end result you can simply click confirm. And once I do that the renaming procedure will start and this is done in a background job.|
|[0:18:22]||And the whole procedure may take a bit of time because like I said before Checkmk will need to be stopped to consistently rename all the host names and all the logs and databases. And that's why you should avoid doing this in a productive system when the system is required to be functioning.|
|[0:18:42]||The whole process can take somewhere from a few seconds to a few hours depending on how many hosts you want to rename and how old your monitoring system is.|
|[0:18:54]||And afterwards, your monitoring will automatically be started again. So let's press Confirm.|
|[0:19:01]||Like I said (it's being) now a background job is being started and while it's running you'll find the current status or what is being done here in the progress info.|
|[0:19:13]||And once it's done the state here will go from running to finished. Like now. Then here in the result, you'll see where exactly all the renaming has taken place.|
|[0:19:28]||And that's how easy it is to rename or bulk rename a number of hosts. And that's everything I wanted to show you regarding bulk actions.|
|[0:19:40]||I hope this video was helpful to you. If so, please subscribe to our channel and like the video. I hope to see you in the next episode.|
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. 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.