Zabbix is a powerful open source tool that allows system administrators to monitor their IT infrastructure. The following guide will walk you through the steps of setting up Zabbix 5.0, from installation and configuration to monitoring your servers with MySQL databases and more.
The “install zabbix on vmware” is a guide to setting up Zabbix 5.0 monitoring in your environment. This article will walk you through the process of installing Zabbix 5.0 on VMware and how to set it up for monitoring different types of devices, such as servers, switches, routers, etc.
Have you ever wanted to monitor a single VMware ESXi host or a group of them but didn’t have the cash for enterprise-grade monitoring? I’ve got some fantastic news for you! You can acquire the monitoring you need for free and start monitoring ESXi hosts and virtual machine guests in approximately an hour. Zabbix is the top enterprise-ready open-source monitoring system that is completely free.
We shall construct a full solution in this essay. You’ll learn all you need to know to properly install, setup, and operate a Zabbix server from the ground up.
What you’ll be doing is as follows:
- Installing Ubuntu Server 20.04 LTS, which will be used to run Zabbix.
- Installing Zabbix 5.0 LTS and configuring it for the first time.
- Using built-in templates to configure Zabbix to monitor ESXi hosts.
- Configure triggers based on observed items and investigate alerting options.
You’ll have all the information you need to start monitoring your VMware ESXi servers at the conclusion of this article. We’ll wrap up with all of the extra resources you’ll need to get started with Zabbix.
Do you want to learn more? If that’s the case, keep reading.
You must be willing to obtain real-life, hands-on experience in order to completely understand and follow along with this program. But don’t be concerned. Everything you need to know is laid out for you. Even if you lack knowledge in certain areas, this book will walk you through each step, explaining what is required and why. So, if you’re planning on following along and building this solution yourself, know what to anticipate ahead of time.
The following is assumed:
- You know how to use the command line and have some expertise with the Linux operating system.
- You’re familiar with the fundamentals of networking terminology and ideas.
- You’re familiar with VMware’s ESXi hypervisor technology.
Zabbix may be installed on a variety of Linux distributions, and it even provides options for web servers and databases. However, for the sake of this article, we’ll concentrate on defaults. If you want to follow along, you’ll need the following items:
Perhaps you’re asking why an SSH client isn’t required. While this approach will leverage PowerShell 7’s inbuilt ability to open SSH connections, you may use whichever SSH client tool you choose to connect to the Linux VM. If you’re just going to use a virtual machine management console, you’ll have to type a little more than usual since the SSH clients won’t let you paste the code samples in this article.
Zabbix Enterprise Monitoring 5.0 Installation
It’s time to start installing your Zabbix server after you’ve completed all of the prerequisites. In just six minutes, you’ll be up and running if you follow the instructions below. So, let’s get started!
The Zabbix Repository is being added.
The step in the installation process is preparing The Zabbix Repository is being added. to Ubuntu so you can download and install the package.
- SSH into your Ubuntu Linux server first.
- Download the Zabbix repo using the wget command. When you hit Enter, Zabbix will start downloading the source repository information to your server. Zabbix may now be installed directly from per-compiled packages.
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release 5.0-1+focal all.deb https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release 5.0-1+focal all.deb
3. Add the configuration to your local repository list by unpacking the download. Unpack the download using the following command:
dpkg -i zabbix-release 5.0-1+focal all.deb sudo dpkg -i zabbix-release 5.0-1+focal all.deb sudo dpkg -i
This is a fast-paced procedure. Re-run the sudo apt update -y command as a best practice, exactly as you did after you finished the Ubuntu Server setup and configuration. The Zabbix repositories should appear like in the following screenshot:
After upgrading the APT repository on Ubuntu Server, this is the output.
Now it’s time to start Zabbix Components Installation.
Zabbix Components Information
Every Zabbix installation has three essential components:
- Server Zabbix (which contains MySQL or Postgre SQL)
- Web Front End for Zabbix php 7.4 (apache2, httpd, nginx)
- Agent for Zabbix
Splitting Zabbix Server and Zabbix Web Front End into separate instances is possible with Zabbix. Splitting apart components is a more complicated circumstance that isn’t common. As a result, that form of setup will not be covered in this book.
Each of these components is an essential part of Zabbix.
- The backend operations are handled by the Zabbix server daemon. It’s the most important procedure. The Zabbix server handles data polling and trapping, trigger calculations, and user notifications. It serves as a central storage location for configuration, statistical, and operational data. More information on the Zabbix server procedure may be found here.
- The webserver components utilized in Zabbix are referred to as the web front end. You’ll be using Apache2 / HTTPd / PHP 7.4 for this tutorial. All of these elements work together to create the web interface and visualizations you’ll see later in this course.
- Agent for Zabbix – a local agent that gathers data, and reports it to a central Zabbix server for additional processing. These agents use native system calls to gather data. The Agent for Zabbix is supported on nearly every OS platform available today. You can read more about the Agent for Zabbix here.
Zabbix Components Installation
Enter the following command to begin installing the Zabbix components. The components will begin downloading and installing from the Zabbix repository we set up earlier. The -y option just bypasses the confirmation dialogs.
> sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent -y
After that, you may proceed to set up the MySQL server, create a blank database, and import a predetermined schema into that database.
Zabbix Database Setup and Configuration
To store statistics and configuration data, Zabbix needs a database. MySQL is the most popular option. MariaDB, the upstream version of MySQL, is used by default in Ubuntu Server 20.04. Both are open-source relational database systems. You may use PostgreSQL instead, although the procedure is somewhat different. Use MariaDB as the default database for this tutorial.
Begin by establishing a blank database on the database server. Type the following command and press Enter to connect to your local MySQL server. It’s possible that you’ll be asked for your credentials. Remember that the credentials you used during the OS installation and for SSH connections should be the same if requested.
You should now see mysql> at the terminal prompt. From here we can begin to issue MySQL-specific commands to set up the database. The database configuration process creates the database, then creates a user, and then assigns that user privileges on the database before exiting MySQL.
Create a blank database named zabbix using the following command, which will be used by the Zabbix server to store all acquired data.
construct a zabbix database using the utf8 character set and the utf8 bin collation;
The next step is to establish a user and assign a password to that user. Replace ‘password’ with something more safe, preserving the single quotes, and keep a record of it. This password will be required at a later point in the tutorial. This is the account that will be able to login to the database and make changes to it:
Now you must provide that user permissions to the newly formed database and all of its tables. The Zabbix server uses this user to write gathered data to the relevant tables in the Zabbix database.
If there were no problems, disconnect the connection by entering and clicking Enter on the following command:
You should be back at the Bash prompt now.
The Zabbix Database Schema is Imported
You have an empty database at this stage. There aren’t any tables or structures to speak of. The next step is to import the schema using a Zabbix-provided script and database template.
The command-line program zcat will be used in the code sample below to expand the compressed SQL file that includes the Zabbix database structure. All of this is written to standard output, which is then fed into MySQL using the -uusername zabbix command. You’ll be required for a -p password and then asked to connect to a database, zabbix. If you don’t input the -uzabbix -p zabbix credentials precisely as stated below, the script won’t construct the database schema.
To import the schema, run the script included with the Zabbix server installation using the following command:
sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabbix zabb
It will take a minute or two to complete this task. You may continue when you return to the Bash prompt.
Zabbix Server Configuration
You’ll need to update the /etc/zabbix/zabbix server.conf file using the built-in text editor Nano that comes with Ubuntu Server.
You may also use Vim if that is more convenient for you. The pictures and instructions in this post utilize Nano, but the actual modifications are the same regardless of whatever text editor you use.
You will need to look for, uncomment, and update two parameters. DBPassword and StartVMwareCollectors are the two.
When using the nano text editor, use CTRL+W to fast search for these settings.
To begin, open zabbix server.conf in nano and make the necessary changes. Press Enter after typing the following command into your terminal prompt:
> sudo nano /etc/zabbix/zabbix_server.conf
After accessing the Zabbix server configuration file, search for the DBPassword parameter using the shortcut key combination CTRL+W and hit Enter. As illustrated below, the DBPassword parameter choices should now be visible. Remember that you’re inputting the [email protected] database user’s password, not the database server’s.
Using nano on Ubuntu Server to change the DBPassword option in /etc/zabbix/zabbix server.conf
StartVMwareCollectors should now be edited. Search for StartVMwareCollectors with CTRL+W and hit Enter. The StartVMCollectors=0 argument should now appear below. Change the value of the StartVMwareCollectors option to 5.
Using nano on Ubuntu Server to change the StartVMwareCollectors setting in /etc/zabbix/zabbix server.conf
You may have noticed a few of additional VMware-related settings before saving the file. You don’t need to change them right now since the defaults are good. If you want to create various settings, I recommend that you look at the whole list of options here.
Save your changes by pressing CTRL+X, then selecting Y and pressing Enter. You’ll be brought back to the Bash prompt.
You’ll need to update /etc/zabbix/apache.conf for the final settings. The parameters for the Zabbix web front end are controlled by this file.
Change the line in the <IfModule mod_php7.c> section. This is the section for PHP7 configuration parameters. The older <IfModule mod_php5.c> section is for PHP5 and here for backwards compatibility. PHP5 is no longer used in Zabbix starting with Zabbix 5.0 due to security vulnerabilities.
Using nano on Ubuntu Server to edit the apache settings in /etc/zabbix/apache.conf
Remove the # php value date.timezone Europe/Riga comment and replace it with the timezone you want to use. To change the timezone to Eastern Standard Time, for example, type America/New York. A comprehensive list of valid PHP timezones may be found on this website. The following is an example of how your setup should look:
Date.timezone value set to America/New York in php value
Make a backup of your modifications. You’re back at the Bash command prompt. Now it’s time to start the Zabbix server.
Zabbix Server Installation
Restart the Zabbix services and allow them to start automatically when the computer is turned on.
You’ll need to restart the Zabbix server, agent, and apache2 daemons using the instructions below in order for your configuration file changes to take effect. Then you’re allowing these daemons to start automatically after a reboot. If you don’t do this, you’ll have to manually start services every time your host is restarted for maintenance or becomes unstable.
> sudo systemctl restart zabbix-server zabbix-agent apache2 > sudo systemctl enable zabbix-server zabbix-agent apache2
You may now shut your terminal and log out of your SSH session.
You should now be able to go to the Zabbix web front end and complete the basic settings using any current web browser. That is exactly what you will accomplish in the following part.
Zabbix Web Front End Configuration
You’re nearly finished! Navigate to http://[IP Address]/zabbix/ in your web browser and follow the on-screen instructions. Use the static IP address you set up during the OS installation on your server.
The welcome page is the first page you see. Next, choose the following option:
Welcome page on the Zabbix web front end
After that, Zabbix will go through a list of prerequisites. As you scroll down the list, you should see all OK statuses. You’ll be able to check whether the changes you made previously were right at this stage. If they aren’t, the setup wizard won’t let you continue until you fix your configuration files. If everything is in order and well-documented, go on to the next step:
Front end for Zabbix on the web Pre-requisites must be met.
Now provide the web front end the database connection information. If you didn’t use the default MySQL port 3306, update the Database Port and input the database user password you set up while setting up the Zabbix database. If everything is in order and well-documented, go on to the next step:
Front end for Zabbix on the web Set up the database connection
Finally, give the Zabbix server a name and leave the Host and Port fields blank. This is only a method to label your Zabbix server in the Zabbix UI, and any name will do. However, as a best practice, attempt to use your server’s real hostname. When you’re ready, go to the next step:
Front end for Zabbix on the web Details about the Zabbix server
Finally, double-check the information in the Pre-installation summary. Another nice place to keep track of your Zabbix server setup is here. When you’re ready, go to the next step:
Front end for Zabbix on the web Summary page for pre-installation
It’s now time to put the finishing touches on the installation. Finish by pressing the Finish button.
Complete web front end for Zabbix
You’ll be sent back to the Zabbix server login page immediately. The default login credentials are case sensitive. The default credentials for installing a new instance of Zabbix are Admin / zabbix:
Login page for the Zabbix server’s web front end
Keeping an eye on a VMware ESXi Host
By installing Zabbix, you’ve finished the most challenging portion. Now that you have a fully functional Zabbix UI, it’s time to get to the meat of this tutorial.
This section will lead you through creating and Adding a Host for VMware ESXi to Zabbix, as well as establishing a trigger to notify you of host status when a condition is satisfied. Remember that Zabbix can monitor almost any device that has an internet connection. The methods for Adding a Host for VMware ESXi are largely same, with a few exceptions for different kinds of devices.
Adding a Host for VMware ESXi
To begin Keeping an eye on a VMware ESXi Host, you need first to create a host. A host in Zabbix is any device you wish to monitor, such as servers, workstations, virtual machines, switches, routers, firewalls, etc.
To do so, go to the Zabbix UI’s left-hand navigation menu and click to expand the Configuration menu, then select Hosts:
On the left side of the Zabbix UI, there is a navigation menu.
Now choose Create Host from the drop-down menu. This button may be found in the web UI’s top right corner:
Screens are hosted by Zabbix.
Now fill in the following details about the VMware ESXi host you want to monitor:
Configuration screen for Zabbix Hosts
Here are some definitions for parameters:
- The hostname is just a unique identifier for the monitoring device. An IP address or a FQDN may be used in this field. There are no leading or following spaces allowed, however alphanumeric, dots, dashes, and underscores are allowed.
When using the Agent for Zabbix, do be sure to use the same hostname here as you do in the agent configuration file. If you do not use the same hostname, active checks will fail. This is a required parameter.
- You may give your gadget a more friendly name that will appear on lists, maps, and other places. It’s a non-mandatory parameter.
- Groups are just that—groups of hosts who are related to one another. Every host must be a member of at least one of the groups. You have the option of joining an existing group or starting a new one.
- Zabbix supports a number different sorts of interfaces. Agent, SNMP, JMX (java), and IPMI (out-of-band IP management interface like iLO/iDRAC) are the four protocols. This is a needed parameter for monitoring VMware ESXi hosts, although it does not need to be changed.
- Although the description parameter is optional, it’s a good idea to utilize this chance to describe what you’re doing by including one.
- The parameter monitored by proxy is optional and may be left at its default value. This article does not cover Zabbix proxies.
- It’s a good idea to check Enabled. If it isn’t already selected, make sure it is so that the host is active and monitored.
In the Hostname area, enter the IP address of the VMware ESXi host you wish to monitor, and in the Visible name field, give it a more friendly name. Make a new Group named “VM Hosts,” and give it a brief description like “This host is a part of the ATA Blog guide.” Do not press the Add button just yet!
Configuration screen for Zabbix Hosts filled out
After that, we’ll apply a template to the host. A template is a collection of things that may be applied to a single host or a group of hosts. To do so, go to the Hosts setup screen and choose the Templates menu item:
Configuration screen for Zabbix Hosts menu
The following screen will appear:
Configuration screen for Zabbix Hosts Templates
You’ll see that there are no associated templates, which is to be anticipated given that you haven’t yet gathered any objects to monitor on your host. You might make your own template by copying and changing one that already exists. Zabbix, on the other hand, includes VMware templates straight out of the box! You don’t have to spend hours setting up your monitored things.
Connect the Template VM VMware template. This will add all of the ESXi hosts’ item expressions and definitions. You’ll get autocomplete suggestions if you start entering that name into the search area. By utilizing the arrow keys and hitting enter whenever you see the proper template, you may save some time typing. Do not press the Add button just yet!
Configuration screen for Zabbix Hosts Templates linked template
There are two more templates offered. Template VM VMware Guest and Template VM VMware Hypervisor are the two options. These two templates are Low-Level Discovery (LLD) templates that are included in the one you selected. These will collect more information about the host you’re adding using low-level discovery rules.
An error warning concerning unsupported objects with an incorrect hypervisor UUID may appear. You might try activating the Module Object Browser option on your VMware ESXi host. For further information, see this Knowledge Base article. With that stated, you should not notice this with a generic ESXi host if you have picked the right host template.
Now it’s time to complete the last host setup step. Before Zabbix can connect to VMware ESXi hosts, you must first provide certain host macros or settings that will enable you to connect. To do so, go to the Hosts setup screen and choose the Macros menu item:
Configuration screen for Zabbix Hosts menu
The following screen will appear:
Configuration screen for Zabbix Hosts Macros
Now provide the host macros below, which will allow Zabbix to run basic checks against the host you’re setting. There are three requirements that must be met:
- $URL — VMware service SDK URL (vCenter or ESX hypervisor).
- $USERNAME is the name of the VMware service user.
- $PASSWORD — VMware service password Password for user $USERNAME
You only have one macro field by default, but you’ll need two more. You’ll need extra macros since you’ll need to offer more parameters. When you click Add, a new field will appear for the next parameter you wish to provide. Click Add two more times, as illustrated in the image below:
Adding a new field for host macros
Add the $USERNAME and $PASSWORD macros described before using the defined macros for VMware services:
User macros are entered into the Hosts Macros settings panel.
You may have noticed that the password box has an option. With Zabbix 5.0, this is a new option.
This option may be used to encrypt all user macros and is ideal for API tokens, passwords, and other sensitive information that you don’t want non-admin users to see. It is suggested that you choose this option.
Option for Secret Text
After you’ve finished this step, click the blue Add button as seen below:
Zabbix Server: Add Host
You’ll be sent back to the Hosts Configuration screen. Your VMware ESXi server should now appear in the list:
ESXi-01 has been added to the Hosts list.
If you don’t see any values for objects being watched straight immediately, don’t panic. Starting to get data from the VMware ESXi host might take up to an hour. If you like, you may also add alternative templates for VMware guests and VMware (for logs).
Creating an Alerting Trigger
In the interim, create a trigger based on the objects that have previously been observed. Information is coming in thanks to the low-level discovery templates related to the template you deployed to your host. The hypervisor has a lot of information, including a few of your visitors (if you have any)! When reading Latest Data, you’ll see that information is being collected. You may go through the things on each host to get an idea of what you would want to establish an alert for. However, for the sake of this tutorial, you will just be creating a basic trigger.
When you create a trigger, you’ll be able to get an alert depending on the condition(s) you specify. For example, you may want to know when your ESXi hypervisor in your home lab starts to run out of RAM. You have so little free memory that you decide you need to be notified when the consumption reaches or exceeds 8GB. Because the hypervisor name in this lab is the default localhost.localdomain, it will be utilized in the examples going forward. Click the Triggers link as shown below to begin setting the condition for your alert:
VMware hypervisor was discovered. localhost.localdomain
On the next screen, in the top right corner, click the Create Trigger button:
Create Trigger for VMware hypervisor was discovered. localhost.localdomain
The Triggers setup screen should now appear:
Trigger creation for localhost.localdomain
Give the trigger a descriptive name like Half of Memory in Use, and choose the Warning Severity level. To begin generating a conditional expression for the trigger, click the Add button in the Expression box, as shown below:
Localhost.localdomain Trigger: Creating Trigger Conditions
A pop-up window will open, allowing you to choose the trigger’s requirements. Begin by selecting an item in the Item field:
The Trigger’s Conditions
To begin examining the available things for which conditional expressions may be created, click Select.
Items that are available to be utilized in condition
Scroll down the list until you locate Used Memory and click it. The item will be added to the condition expression as a result of this. There are three more fields that you may play with. Function, Last of (T) Count, and Time shift Time are the fields in question. All of them are part of predictive trigger expressions, which are outside the scope of this tutorial. For the time being, stay with the default function option and then change the = to = drop-down. When it comes to memory measurements, Zabbix prefers bytes, thus you’ll provide a number of 8589934592, which is 8GB. To continue Trigger setup, click Insert once again.
Trigger expression: Adding Used Memory Conditions
You’ll be taken back to the screen with the trigger expressions. There are a few more alternatives available, but one in particular is worth considering. Problem event generation is the polar opposite of OK event generation. It’s simply a condition of your trigger, and it’s a problem. Consider it this way: A issue event is triggered when your conditional statement evaluates to TRUE. An OK event is issued when the next check interval runs and the conditional expression evaluates to FALSE. To produce an OK event based on a conditional expression, you may add a second trigger expression. If your ESXi host shut down a few VMs and ceased consuming so much RAM, this may be handy for automating alert processing.
Add a short description and make sure the Enabled box is checked, then click Add:
Add a trigger with a condition expression that is complete.
You’ve now built the first trigger for your ESXi host:
The host has been given a trigger.
As long as the trigger expression evaluates to FALSE, the initial Value should be OK. If the trigger expression evaluates to TRUE, the value PROBLEM is shown. Now it’s time to put the trigger to the test. If the trigger condition expression in the following part is true, the alarm will appear on the monitoring dashboard.
Alerts are being viewed.
Let’s imagine you want to create some new Linux virtual machines on your ESXi host. You’ve tasked your Junior Sysadmin with keeping an eye on the systems monitoring you’ve set up.
Your junior sysadmin phones you up after morning coffee.
“Hey, Boss,” I said. On one of your VMware hosts, you have an alert. “Are you deploying to the incorrect server?”
On your iPad or Surface book, you go to your Zabbix URL and login in. The Global view dashboard is shown by default.
You can create your own custom dashboard views, but this is out of scope for this guide. You can learn more about creating custom dashboard views Global View Dashboard
There’s a date for when the trigger condition was satisfied, as well as the Host to which the trigger was assigned and the Problem Severity level you specified. That additional RAM should have been purchased.
When you look at the specifics, you’ll see the Duration the trigger has matched your requirement and an Ack(acknowledgement) that you or your Junior Sysadmin may use to track remedial action if it’s required. A section for Actions and Tags is also included.
After ensuring that you’ve utilized all of the RAM, you should shut down the two new VMs for the time being until you purchase more. You reward your Junior Sysadmin for staying on top of things and elevate them to Network Operations Center Manager!
Your Zabbix server changes the trigger status while the poller subprocesses continue to collect data. A flashing RESOLVED message now appears when you choose Problems from the Monitoring menu:
That’s all there is to it. That’s how to monitor your VMware ESXi hosts using Zabbix 5.0!
If you’ve made it this far, I hope you’ve gained enough knowledge to feel more comfortable using Zabbix and monitoring VMware ESXi servers. Zabbix provides a ton of cool features and functions that this article just scratches the surface of.
You’ve built a ground-up solution by installing Ubuntu Server, Zabbix 5.0, and Adding a Host for VMware ESXi. You then configured an alert trigger to complete the monitoring project. You can not only monitor 1 or 100 VMware ESXi hosts for free but ANY device you can connect to!
That’s a lot of work done, and the advantages of having a good, established monitoring system for your core virtualization infrastructure will pay out in the long run.
Zabbix is an enterprise-grade monitoring system with a lot of capability. For the novice, though, it may be a difficult and frequently perplexing experience. But don’t be disheartened! Begin small, keep things simple, and just monitor/alert on the most critical items.
So, where do we go from here? Check out the extra learning materials listed below and get started exploring on your own! Examine what and how you monitor devices and services, as well as what Zabbix can help you with.
The “how to start zabbix server-mysql” is a guide that provides information on how to set up and configure Zabbix 5.0 monitoring.
Frequently Asked Questions
How do I set up monitoring in Zabbix?
A: You can set up monitoring for your organization to monitor the health of your servers. If a server goes down, it will send an email notification and alert you on Slack or other channels that are configured in Zabbix.
How do I monitor my server with Zabbix?
A: There are a few things you can check to see if your server is running properly. The first thing you should do is make sure the data collector daemon (dcd) is configured and started. To start it, enter this in terminal:
sudo service zabbix-server restart
The second thing that would be good to look at on your monitoring page would be an overview of all tasks currently being run by Zabbix agents across all monitored systems. It may show something like this where every agent has a different percentage completed or 0% as no activity was detected yet:
How do I install Zabbix 5?
A: Thank you for your question. To install Zabbix, first download the installer and then run it with administrator privileges.
- zabbix download
- how to start zabbix server
- zabbix firewall configuration
- unable to locate package zabbix-apache-conf
- zabbix agent