Contents
Open source integrated monitoring software "Zabbix
Zabbix is an open source integrated monitoring software for centralized monitoring of servers, networks and applications. It provides monitoring, fault detection and notification functions required for integrated monitoring. With Zabbix agent and SNMP support for many platforms, you can monitor your entire system with a single Zabbix.
To run Zabbix, you will need the PHP programming language, MySQL as a database server, and a web server such as Apache or Nginx. In this article, we will assume that all of these have already been configured.
1. Install Zabbix
1.1 Configure Zabbix repository
Zabbix official team provides Apt package repository for Debian based systems. To add a repository to a Debian system, use the following command
1 |
# wget https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/zabbix-release_6.0-4+debian$(cut -d"." -f1 /etc/debian_version)_all.deb |
1 |
# dpkg -i zabbix-release_6.0-4+debian$(cut -d"." -f1 /etc/debian_version)_all.deb |
1.2 Installing Zabbix Server
Once you have added the Apt repository, install the Zabbix server package using the following command
Package zabbix-server-mysql contains Zabbix server with MySQL support.
Package zabbix-frontend-php provides a web interface to Zabbix server.
1 2 |
# apt update # apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent |
1.3 Create Zabbix database and user
Create database schema for Zabbix server.
Login to MySQL server as root account and create MySQL database (e.g. my_zabbix_db), user (e.g. zabbix_user) and password (e.g. WWWabcd123).
1 2 3 4 5 6 7 |
# mysql -u root -p Password: > CREATE DATABASE my_zabbix_db character set utf8 collate utf8_bin; >CREATE USER 'zabbix_user'@'localhost' IDENTIFIED BY '?WWabcd123'; >GRANT ALL PRIVILEGES ON my_zabbix_db.* TO 'zabbix_user'@'localhost' WITH GRANT OPTION; >FLUSH PRIVILEGES; >exit; |
Load Zabbix default schema for database
1 2 |
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix_user -p'?WWabcd123' my_zabbix_db Enter Password: |
1.4 Update Zabbix configuration
Edit Zabbix server configuration file /etc/zabbix/zabbix_server.conf and update database configuration for Zabbix server to connect to database
1 2 3 4 5 6 7 8 9 |
# vi /etc/zabbix/zabbix_server.conf # Line 93 : Uncomment DBHost=localhost # Line 105 : change DBName=my_zabbix_db # Line 121 : change DBUser=zabbix_user # Line 129 : change DBPassword=[zabbix_user password] |
Configure Zabbix service to start at system startup.
1 2 |
# systemctl enable zabbix-server # systemctl restart zabbix-server |
1.5 Monitor Zabbix server itself
1 2 |
# systemctl enable zabbix-agent # systemctl restart zabbix-agent |
1.6 Zabbix frontend Configure
1 2 3 4 |
# vi /etc/zabbix/apache.conf Line 30: # php_value date.timezone Europe/Riga" Uncomment and set the time zone appropriate for your country. In the example, Japan php_value date.timezone Asia/Tokyo |
1 2 |
# systemctl restart apache2 # systemctl enable apache2 |
1.7 Configure Zabbix firewall
Allow Zabbix ports 10050 (Zabbix server side) and 10051 (zabbix agent side)
1 2 3 |
# ufw allow 10050/tcp # ufw allow 10051/tcp # ufw reload |
2. Running Zabbix Web Installer
Zabbix Web Installer can be accessed via "server IP/zabbix" or "domain/zabbix".
Open a web browser and enter "http: //[your-server-IP_Address]/zabbix".
The following screen will appear.
Click [ Next step ].
After confirming that all requirements are OK, click the [ Next step ]
Enter the information you have set in the "Database name", "User" and "Password" fields.
Check time zone Check if you are in your own time zone
Reconfirm settings If information is correct, click "Next step".
When the installation is successfully completed, the following page will appear. Click "Finish
You will be redirected to Zabbix login page
Log in using the following credentials
UsernUsername:Admin
Password:zabbix
After successful login you will see the following screen (Zabbix Dashboard).
3. administrator password change, administrator email address settings
Change the default administrator password for security purposes
Also, set up the administrator's email address.
Once the above dashboard is displayed, continue
①Select "Administration" - "Users" in the left pane and click "Admin" in the right pane
③Enter the password you wish to change and click Update.
④Come back to the [Users] screen again, go to the [Media] tab, and click the [Add] link
⑤[Select "Email" in the "Type" field, enter the administrator's email address in the "Send to" field, and click the "Add" button.
⑥Click the "Update" button to complete registration.
4.Monitoring Host Configuration
①Log in to the Zabbix administration site and select Configuration - Hosts in the left pane.
In the right pane you should see the local host with Zabbix Agent installed, check it and click the Enable button. (Currently you should see the zabbix server itself)
②"Status" changes to "enabled" to indicate that the system is being monitored.
A template for Linux is set by default, so this is all that is needed to monitor key items such as CPU usage.
③After some time has passed, various data will be collected and the status of the server can be checked as shown below.
Left side Monitoring Hosts click
④Click on Zabbix server Select Graphs