System Integration Monitoring Debian11 : Zabbix Install

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

# wget https://repo.zabbix.com/zabbix/5.4/debian/pool/main/z/zabbix-release/zabbix-release_5.4-1+debian11_all.deb
# dpkg -i zabbix-release_5.4-1+debian11_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.

# apt update
# apt 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).

# mysql -u root -p
Password:
> CREATE DATABASE my_zabbix_db character set utf8 collate utf8_bin;
>CREATE USER 'zabbix_user'@'localhost' IDENTIFIED BY 'WWWabcd123';
>
>FLUSH PRIVILEGES;
>exit;

Load Zabbix default schema for database

# zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -u zabbix_user -p 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

# 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] # Line 398 : Uncomment
ListenIP = 0.0.0.0

Configure Zabbix service to start at system startup.

# systemctl enable zabbix-server
# systemctl restart zabbix-server

1.5 Monitor Zabbix server itself

# systemctl enable zabbix-agent
# systemctl restart zabbix-agent

1.6 Configure Zabbix firewall

Allow Zabbix ports 10050 (Zabbix server side) and 10051 (zabbix agent side)

# 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

Leave as default, "name" is optional and can be left blank
Confirm "Host localhost" and "Port 10051

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

②Click [Change password]

③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

The following monitoring status screen will appear

タイトルとURLをコピーしました