The Zabbix Server 5.0 LTS is out with plenty of new features and beautiful improvements. This guide has been tuned to help you install and configure Zabbix Server 5.0 on Ubuntu 20.04 (Focal Fossa). Zabbix is the ultimate enterprise-level software designed for real-time monitoring of millions of metrics collected from tens of thousands of servers, virtual machines, and network devices.
New features in Zabbix 5.0
Listed below represents just the first layer of the Onion.
- Vertical menu: A modern vertical menu in a sidebar replaces the horizontal menu in the new version.
- Test item from UI: Previously, it was difficult to tell if a newly-configured item was configured correctly or not. In the new version it is possible to test the item (template item, item prototype, low-level discovery rule) from the user interface even before saving and, if configured correctly, get a real value in return.
- Copy and paste widgets: Dashboard widgets can be copied and pasted in the new version
- Managing large numbers of hosts: Several improvements have been made to make it easier to work with large numbers of hosts and other elements.
- IPMI sensor discovery: A new ipmi.get IPMI item has been added that returns a JSON with IPMI-sensor related information
- Secure connections to Zabbix database: It is now possible to configure secure TLS connections to MySQL and PostgreSQL databases from Zabbix frontend or server.
- Stronger cryptography for passwords: A stronger bcrypt cryptography is now used for hashing user passwords instead of MD5
- SAML authentication: SAML 2.0 authentication is now supported for logging into Zabbix.
- Webhook integrations: Push Zabbix notifications to (Microsoft Teams, Jira, Telegram, Zendesk, Redmine etc)
Zabbix Architecture
The Zabbix Monitoring architecture comprises of a Client and Server model. The server communicates to the native software agents available for various Operating systems like Linux, NIX, and Windows. For systems without an agent, generic monitoring protocols such as Simple Network Management Protocol (SNMP) or Intelligent Platform Management Interface (IPMI) can be used.
How To Install Zabbix Server 5.0 on Ubuntu 20.04
The next steps will cover complete steps for the installation of Zabbix Server 5.0 on Ubuntu 20.04 (Focal Fossa). The Zabbix Server depends on the following software applications:
- Apache web server
- PHP with required extensions
- MySQL/ MariaDB database server
In this setup we will have MySQL and Apache web server running on the same server where Zabbix packages will be installed. For monitoring on large infrastructures, you’ll need to a dedicated database sever that will be able to handle the load.
Step 1: Install Apache httpd server
Update your system then install the apache2 package by running the following commands:
sudo apt update && sudo apt -y upgrade
Check if a reboot is required after the system is updated.
[ -e /var/run/reboot-required ] && sudo reboot
Install Apache web server
sudo apt install -y apache2
After installing Apache, configure basic security by allowing Prod ServerTokens only on /etc/apache2/conf-enabled/security.conf
sudo sed -i "s/^ServerTokens OS$/ServerTokens Prod/" /etc/apache2/conf-enabled/security.conf
sudo sed -i "s/^ServerSignature On$/ServerSignature Off/" /etc/apache2/conf-enabled/security.conf
The directiveServerTokens
configures what is returned as the Server HTTP response. Valid options are Full | OS | Minimal | Minor | Major | Prod.
Restart Apache web service after making the changes:
sudo systemctl restart apache2
If you have UFW firewall installed and enabled, allow access to port 443 and 80:
sudo ufw allow proto tcp from any to any port 80,443
To enable UFW firewall on Ubuntu, use:
sudo ufw enable
Don’t forget to enable ssh service:
sudo ufw allow ssh
Step 2: Install MariaDB Database server
Install MariaDB database server on Ubuntu 20.04 LTS.
sudo apt install mariadb-server
Secure Database server:
sudo mysql_secure_installation
Update authentication plugin for root user.
$ sudo mysql -u root
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';
FLUSH PRIVILEGES;
QUIT;
Once Database server installation is done, you need to create a database for Zabbix user. Replace “StrongPassword” with your desired password for the database.
sudo -i
zabbix_db_pass="StrongPassword"
mysql -uroot -p <<MYSQL_SCRIPT
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@'localhost' identified by '${zabbix_db_pass}';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
Step 3: Install Zabbix 5.0 Server on Ubuntu
Now that we have required dependencies installed and working, we can finalize our installation by deploying Zabbix 5.0 server.
exit
Add Zabbix 5.0 repository on Ubuntu 20.04 (Bionic Beaver) LTS:
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
sudo dpkg -i ./zabbix-release_5.0-1+focal_all.deb
Now install Zabbix 5.0 Server on Ubuntu 20.04 with frontend and MySQL support:
sudo apt update
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
Import Zabbix Server database schema
For Zabbix server and Zabbix proxy daemons, a database is required. It is not needed to run Zabbix agent. If Zabbix server and proxy are installed on the same host, their databases must be created with different names!
Import initial schema and data for the server with MySQL:
sudo su -
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix
Enter your Zabbix database user password when prompted.
Step 4: Configure and start Zabbix server
Edit your Zabbix configuration file /etc/zabbix/zabbix_server.conf and set database connection settings.
$ sudo vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=StrongPassword
Configure PHP for Zabbix frontend
Edit file /etc/zabbix/apache.conf, uncomment and set the right timezone for you.
$ sudo vim /etc/zabbix/apache.conf
php_value date.timezone Africa/Nairobi
The full section will look like below.
............
<IfModule mod_php7.c>
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value max_input_vars 10000
php_value always_populate_raw_post_data -1
php_value date.timezone Africa/Nairobi
</IfModule>
.....
Restart Zabbix server after modifying this file:
sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2
Configure Firewall
If you have ufw firewall installed and running on your system, ensure you allow port 5000 and port 5001:
sudo ufw allow proto tcp from any to any port 10050,10051
Restart apache2
and start frontend installation:
sudo systemctl restart apache2
Step 5: Perform Zabbix initial setup
Access “http://(Zabbix server’s hostname or IP address)/zabbix/” to begin Zabbix initial setup.
Step 1 is a welcome page, click “Next step” to proceed.
Click next to validate dependency requirements.
Configure DB settings
Enter the Database details we set up earlier. You can notice that TLS can be configured in this step if you would wish to have encryption in your database connection. Click “Next step” once done
Click “Next step” to finish installation of Zabbix Server 5.0 on Ubuntu 20.04 Linux machine.
Finish installation to access Zabbix administration dashboard.
Once you get the login page, the default login credentials are:
Username: "Admin" Password: "zabbix"
Step 6: Change Admin Password
Login to Zabbix admin dashboard with admin user and password zabbix. You need to change the password for admin user after the first login for security reasons.
Navigate to Administration > Users > Admin > Password > Change Password
Reference
Read in documentation: Quickstart guide to start monitoring your Systems with Zabbix server.
Recommended Linux Books to read:
- Best Linux Books for Beginners & Experts
- Best Linux Kernel Programming Books
- Best Linux Bash Scripting Books
- Top RHCSA / RHCE Certification Study Books
- Best Top Rated CompTIA A+ Certification Books
- Best LPIC-1 and LPIC-2 certification study books
More reading:
Install and Configure LibreNMS on Ubuntu with Nginx
10 Best Open Source Linux Monitoring Tools