nSights Talks

How to Deploy Zabbix Front-End Server

Tutorial Highlights & Transcript

00:00 - nSights Zabbix Monitoring Platform ( Introduction )
My name is Rishav and I’m a part of nClouds On-Call Support Services. During one of our kickoff calls with a client who came to know about Zabbix monitoring system with how to take an overview of that monitoring tool. So during that, I just came to know about how we can implement that, also. So yeah, let us start the demo.
00:30 - Scope of this tutorial
So in this demo, we will see how we can configure and deploy Zabbix front-end server and use it as a monitoring platform for our application instances. For that we need to create a database in Zabbix server, where it will keep all the details of the servers that need to be monitored. And then we need to configure the Zabbix agent on the servers which sends the data metrics to the Zabbix server from the instances that has to be monitored.
00:55 - What is Zabbix?
A little bit about Zabbix. It is an open source monitoring software tool for IT components including network servers, VMs, and cloud services. Zabbix uses the out-of-box templates for many operating system means templates already have predefined system alerts which means in terms of Zabbix, those are called triggers which makes adding new devices for monitoring very easy. For now it is free to use but its support is paid currently. So, apart from that, I have also created a documentation where I have mentioned all the steps of how we can implement Zabbix Front-End system and I have mentioned all the commands that we have to run and also for the command that we have to run all these countries server which we have to monitor with that.
01:45 - Step-by-step tutorial
So for that we need two EC2 instances which I already have launched using the Ubuntu AMI that is 18.04 and already have SSH into both of the servers there. So yes, I will start the demo. Now, using all those steps I have mentioned here. So first three steps will remain same for both the servers. So where I have taken those commands, this is the reference document you can see here. As I have told you already that I have used Ubuntu operating system that in 18.04 and I want to install Zabbix latest version and the database will be MySQL and web server is Apache and this is the official website of Zabbix. So by selecting those things, we will get these three commands to install the repository and the packages will need to start for this Zabbix and after that in the main server. Now we have to do the installation of Zabbix server front-end its agent as the database so we need to run this command now.

It will take some time. So in the meantime, we also have to secure our MySQL server as well so we will run this command after that command is finished. And moreover I just forgot to tell you that the default port of Zabbix is port 10050 That I have already open at the security group which we use for these instances. So after running this command it will ask for some of the questions like if we want to validate the password plugins. This is for if we need the password that has great strength like if we have to use alphabets or numeric values and so on at the least. So I will go through and we’ll do all the steps which has been mentioned. We can also confirm the installation of packages using this command. So I will run this, as well. You can see here it is showing MySQL, Apache server, and PHP, as well. So now move to the next command. We are here. I will select No because I just want to use the simple password for the demo purpose and the password I will mention as password again. So yes, I want to remove the anonymous users and here I will choose No because I want to log in as the root user. So yes, we will remove the test database, as well. We will choose yes and yes then we have to reload the privileges, as well. So this is done. So now we will be accessing our MySQL server. So password we have mentioned above is password. So we will use the same. So here we are into the database. So now we will have to create a new database with the name of Zabbix with this command and we have to create a user as well with the name of Zabbix. And it’s possible we will again mention as passwords, we’ll just have to run this command, as well. Now, we have to grant all the privileges to the Zabbix user. After that, we have to import the initial schemas and data for our database. So, it will again take 30 seconds at least. So, now, as we are installing the Zabbix server, we have to do the changes on its configuration file like we have to just mention the password here. So, we are using password as password. So, we just have to do that. Let it be done. Now, we have to do Apache configuration because once we install and access the web UI of Zabbix it will show us the local time. So I currently am in India I’m using this time. So let me do that, as well.

Now, we just have to restart the Apache Zabbix server and Zabbix agent, as well. And also we need to enable it. So, yes, all the steps needed to be done for the Zabbix front-end we have done now, the other part is to copy the IP address of the main server and just have to put Zabbix at the last you can see that we are now able to access it. So we just have to ensure that all those issues need to be okay.

The next step. So, yeah have we will again mention the password here and the rational value will remain same. So, we can also mention that any of the name here it will show during its web UI. So I am selecting it as nClouds demo. So, we can also change the theme here and addition which time we want to use. I’m selecting it as default for now. So, it is showing that all the configuration changes and the file we have selected. Now you can see it is showing that you have successfully installed the Zabbix front-end. So, as you can see here, this is the default dashboard view of the Zabbix here. It is showing currently we have only one server which is itself Zabbix server and it is showing that it is running. So this is the part we have to do for the Zabbix front-end. Now we have to do the next part which we have to do on the other monitor that is the server which we have to monitor. For that we just have to install the Zabbix agent which will provide all the details to the Zabbix means server. And after that, we have to generate a pre-shared key to secure the connection between server and the agent. So this is the command to do. So the key is being generated and also we will get it as well because we will be using this key in the next steps. So yes, all the part is done. So we have to do the changes on the Zabbix agent. Now as well, we just have to replace those words with the agreements. So here we have to mention the IP address of our Zabbix main server. Now the next step, we have to replace the TLSConnect unencrypted to PSK and then the TLSAccept, as well. And then the identity here we will be using Zabbix PSK-01 and then here we have to just mention the part of the PSK file our agent. So this is done.

So now we just have to restart the agent and enable it. We are also allowing the UFW for the traffic to be running. So yes, this is what we have to do on the monitored server. So now we have to configure that host here, as well. So for that we just have to click on configuration and host and here we just have to click on create host and here I’m just giving it name as Zabbix monitor. And the group I will be selecting as Linux because we are using the Linux OS and the interface we have to select the agent because the communication part is being done by the Zabbix agent through this Zabbix front-end server and the server which has to be monitored and we have to mention the IP address for the server which we have to monitor here. So, this is my business. All will be same and in the template are the predefined values which will create the alerts on the host automatically. So, we are using the template as Linux by Zabbix agent. So, it will have all the pre defined conditions there which will trigger the alerts once the violation is being raised. So yes, we have entered that. So rest all will be same and in the inscription type we will be using PSK and the identity we have mentioned in the Zabbix agent, it was a PSK-01 and and here we have to use this key we have generated Yes, now we just have to click on add. So yes, it is added as you can see here now the new host has started showing there, but currently it is showing that the availability is not available. I think for that we need to restart the Zabbix agent on these monitored servers and the Zabbix server and agent, as well. Yes, this has been done. So let me refresh it. You can see, here it is showing the availability, as well. So yeah, so currently, you can see here it is showing only 14 triggers. So let me show you. For now, this is only show the 14 because these are the alerts that have been configured here by the templates only. We have not done anything so far. And in the discovery rules, we just have to execute these rules, as well, because currently the file system that has been not configured so we’ll just have to execute it now. That will now again start to show, as well. So in the triggers, you can see another trigger has been increased. So the file system that has also been generated. And one more thing I just had to show you like in the macros, these are the predefined values and the threshold values of each alert we have defined here. So you can see if the file system has been used above the 90% it will create a critical violation. And for the warning, it is showing that it will create a violation. And if it goes at 80% over so yeah. So also we can create the integration with the PagerDuty, as well. We just have to click on here and has to mention the API key which we can do from the PagerDuty using the new services and have to mention the URL that it will do that old thing also.

And one more thing. In the configuration part. Of course, we can also do the configuration of the host by using an import here, like in the import file here we will be using this one. Let me show you, as well. So this is the main file, like we just have to mention the name of the host and its IP address. And then we just have to monitor it. So import it. It will do all those steps. So yeah, this is all about my demo.

01:45 - Step-by-step tutorial
A little bit about Zabbix. It is an open source monitoring software tool for IT components including network servers, VMs, and cloud services. Zabbix uses the out-of-box templates for many operating system means templates already have predefined system alerts which means in terms of Zabbix, those are called triggers which makes adding new devices for monitoring very easy. For now it is free to use but its support is paid currently. So, apart from that, I have also created a documentation where I have mentioned all the steps of how we can implement Zabbix Front-End system and I have mentioned all the commands that we have to run and also for the command that we have to run all these countries server which we have to monitor with that.
Jasmeet Singh

Rishav Bagga

Support Team Lead

nClouds

Rishav is a Support Team Lead at nClouds. He has a Bachelor of Technology Engineering degree from the Rayat & Bahra Institute of Engineering & Nano Technology. Rishav has achieved AWS certifications as a Cloud Practitioner, Solutions Architect (Associate), SysOps Administrator (Associate), and is a Datadog Certified Technical Specialist.