このページでは、Zabbix を使って Linux マシンの基本的な監視を開始するために必要な手順を順を追って説明します。 このチュートリアルで説明する手順は、あらゆる Linux ベースのオペレーティングシステムに適用できます。
Who this guide is for
This guide is designed for new Zabbix users and contains the minimum set of steps required to enable basic monitoring of your Windows machine. If you are looking for deep customization options or require more advanced configuration, see Configuration section of Zabbix manual.
Prerequisites
Before proceeding with this installation guide, you must download and install Zabbix server and Zabbix frontend according to instructions for your OS.
Zabbix agent is the process responsible for gathering data.
Check your Zabbix server version:
Install Zabbix agent of the same version (recommended) on the Linux machine that you want to monitor. Based on your monitoring needs, it may be the same machine, where Zabbix server is installed, or a completely different machine.
Choose the most suitable installation method:
Run as a Docker container - see the list of available images in Zabbix Docker repository.
Install from Zabbix packages (available for Alma Linux, CentOS, Debian, Oracle Linux, Raspberry Pi OS, RHEL, Rocky Linux, SUSE Linux Enterprise Server, Ubuntu).
Compile from sources.
Zabbix agent can collect metrics in active or passive mode (simultaneously).
A passive check is a simple data request. Zabbix server or proxy asks for some data (for example, CPU load) and Zabbix agent sends back the result to the server. Active checks require more complex processing. The agent must first retrieve from the server(s) a list of items for independent processing and then bulk send the data back. See Passive and active agent checks for more info.
Monitoring templates provided by Zabbix usually offer two alternatives - a template for Zabbix agent and a template for Zabbix agent (active). With the first option, the agent will collect metrics in passive mode. Such templates will deliver identical monitoring results, but using different communication protocols.
Further Zabbix configuration depends on whether you select a template for active or passive Zabbix agent checks.
1. Open the Agent configuration file on the machine where the Agent is installed.
2. Add the IP address or DNS name of your Zabbix server to the Server parameter.
3. Restart Zabbix agent.
1. Log in to Zabbix frontend.
2. Create a host in Zabbix web interface.
3. Click on Add to add the host. This host will represent the monitored Linux machine.
Open Zabbix agent configuration file (by default, the path is /usr/local/etc/zabbix_agentd.conf):
Add:
For example:
1. Log in to Zabbix frontend.
2. Create a host in Zabbix web interface.
This host will represent your Linux machine.
3. In the Templates parameter, type or select Linux by Zabbix agent active.
Congratulations! At this point, Zabbix is already monitoring your Linux machine.
To view collected metrics, open the Monitoring->Hosts menu section and click on the Latest data next to the host.
This action will open a list of all the latest metrics collected from Linux server host.
Zabbix は、インフラの問題を様々な方法で通知できます。
このガイドでは、メールアラートを送信するための設定手順を説明します。
1. ユーザー設定 -> プロファイル に移動し、メディア タブに切り替えて メールアドレスを追加 します。
2. 問題通知の受信 のガイドに従います。
次回以降、Zabbix が問題を検出すると、メールでアラートが届くようになります。
On Linux, you can simulate high CPU load and as a result receive a problem alert by running:
You may need to run several md5sum processes for CPU load to exceed the treshold.
When Zabbix detects the problem, it will appear in the Monitoring->Problems section.
If the alerts are configured, you will also receive the problem notification.
See also: