Ep. 50: Working with the push mode of the Checkmk agent
[0:00:00] | Push your monitoring data to the Checkmk server in the cloud via the Push mode. |
[0:00:15] | Welcome to the Checkmk channel. Today I'll be talking about a new agent configuration option that is the Push mode. This option is only available in the Checkmk Cloud starting from version 2.2. |
[0:00:28] | In the push mode the monitoring agent sends the data to the monitoring server once per minute. The agent is responsible for pushing the data transmission, and it never waits for the request from the monitoring server. |
[0:00:42] | In this tutorial, I will show you how to configure the push mode, register your agents in order to use this new agent configuration option. So without further Ado let's get started. |
[0:00:52] | Before we jump into the tutorial, I would like to give you a brief overview on how the data from the Checkmk agent was being collected before and what has changed now. |
[0:01:05] | As you can already see the Checkmk server was pulling the data from the Checkmk agent via Port 6556, which in turn was calling the agent script and the data was transported back to the Checkmk server. |
[0:01:19] | In Checkmk 2.1 we introduced a new agent component which is known as the agent controller and this was responsible now for collecting the data from the agent script and transporting it back to the Checkmk server. The Checkmk agent controller listens on Port 6556 for the incoming requests and in turn queries the agent script. Likewise, on the left-hand side where you see the Checkmk site we have another component which is known as the agent receiver which serves as an endpoint for the agent controller communication. For example, it registers the connection request that comes from the agent controller. |
[0:02:03] | Both the components are responsible for the TLS encryption and data compression that also means that the Checkmk server and the agent must have at least version 2.1. After you install the agent the first step is the registration of the agent controller with the Checkmk site agent receiver, which basically establishes a trust relationship between these two components. |
[0:02:28] | This results in the TLS encryption. Until now the Checkmk server was responsible for initiating the connection and also requesting the data from the Checkmk agent. But since Checkmk Cloud Edition version 2.2 it is now possible to push the data to the Checkmk server and here the agent never waits for the request from the Checkmk server. |
[0:02:55] | It just pushes the data once per minute. The agent controller still does the registration and the agent receiver is responsible for receiving the data that is sent by the agent controller in the push mode. So that was a brief overview on the agent architecture, now let's move on to a live demo on setting up the agent configuration option and push mode. |
[0:03:24] | For this demo I'm using a Checkmk Cloud Edition that I have obtained by subscribing to the AWS Marketplace image. And after you subscribe to it you can simply create an EC2 instance and once you SSH to the EC2 instance you can create a site. So I already created a site here and I'm also logged in via the command line the version is 2.2.0p6 and the site is also running right now. |
[0:03:52] | So we can directly go on to the Checkmk web UI and go ahead with the prerequisites. So let's log into the site. |
[0:04:09] | And here we can simply start creating a host. For this demo I have also created an additional EC2 instance which will basically be my Linux server wherein I'll be installing the agent and I'll be configuring the push mode option. |
[0:04:28] | Let's go back. We need to simply define a host, I'll name the host as 'mylinuxhost', the IP can be set to no IP, and the most important option here is the agent connection mode which will be push mode. |
[0:04:44] | Simply Save and view folder and activate the changes. After this click on setup go under Agents > Windows, Linux, Solaris. You have a vanilla package already available. You can simply download the package, SCP it to the Target host or you can also use the WGET and directly fetch it via the REST API or from the from the Checkmk web UI as well. |
[0:05:20] | Here I will simply define in the browser agents and I already have the Debian package available so let me copy the link. |
[0:05:28] | And I can switch to the command line and copy this command. For that first of all let me SSH to the EC2 instance that I created and then we are going to copy the command. So lets SSH to the EC2 instance > root and then we are going to copy this package. Let's copy the link. |
[0:06:03] | And after downloading the package you can simply install the package. So after the agent has been installed you can register it. "cmk-agent-ctl register". If you invoke The Help menu you see all the options. So we can simply define "--server", which will be the IP address or the hostname of my Checkmk server. |
[0:06:40] | Let's remove the URL. Here then I will define the site which will be "cloud", the hostname "mylinuxhost' which I already defined on the web UI. And finally the user which will be 'cmkadmin' in my case. And I just press enter here. Here, I have to acknowledge whether I want to establish the connection with a simple 'yes' or 'no'. I accept the certificate I enter the password and now the registration is complete. |
[0:07:20] | If we quickly check whether our agent is working fine we can do a simple "ss- tlupn" and grep for 6556. We can already see that the agent controller is listening on Port 6556 for any incoming requests that should come from the Checkmk site. If we verify the status of the agent controller we can also see that it has a connection established to the Checkmk site. It has a unique identifier here. |
[0:07:57] | The local and remote connection mode is set to 'push-agent'. So now this agent is going to push the data to the monitoring server. We can now go back to the Checkmk web UI and have a look at if we already have the data from this host or not. |
[0:08:20] | Right now as you can see it shows "no cached data available". So it may take a few minutes for the data to arrive for this host you can simply reschedule the check and we can already see that the data is already in there. If we now perform the service discovery we should be able to see all the basic service checks that is delivered by the Checkmk agent ,this includes CPU load Checkmk agent, all the statistics about disk IO, filesystem, memory, number of threads, TCP connections, uptime, and if you have baked your agent with any special agent plug-ins or local checks or any other custom files then they are also going to be executed by the agent and are going to deliver the data or maybe more checks that is requested out of that agent. |
[0:09:15] | Let's simply accept all because we want to accept all the undecided services and also the discovered host labels. After we accept all the changes we can simply activate it. |
[0:09:35] | After that once we go to the monitor "All hosts" view, you can simply reschedule the check and now we have all the checks available. Some checks that you are showing as pending they will also show their state once they have the first counters or at least the initial check data available for them. All right so that was a very simple tutorial on how to configure the push mode. |
[0:10:07] | So that's it for today thanks for watching please don't forget to like and subscribe and I see you around. |
Want to know more about Checkmk? Join us for our Introduction to Checkmk Webinar