Skip to content

Use Logtail to collect Zabbix data

Zabbix is a commonly used open source monitoring system. Zabbix provides a variety of alert rules for system monitoring.

Prerequisites

  • Zabbix is installed.For more information, visit Download and install Zabbix.
  • In this topic, Zabbix is installed on an Elastic Compute Service (ECS) instance.
  • A project and a Logstore are created.For more information, see the Create a project section of the "Manage a project" topic and the Create a Logstoresection of the "Manage a Logstore" topic.

Step 1: Specify a data storage path

  • Zabbix stores monitoring data on the machine on which Zabbix is installed. To specify the storage path for monitoring data, perform the following steps:
  1. Log on to the ECS instance on which Zabbix is installed.
  2. Open the zabbix_server.conf file.
vim /etc/zabbix/zabbix_server.conf
  1. Specify the data storage path in the zabbix_server.conf file.
ExportDir=/tmp/
  1. Restart Zabbix for the setting to take effect.
systemctl restart zabbix-server
  • After the setting takes effect, Zabbix generates a file whose file name extension is .ndjson in the /tmp directory to store monitoring data.

Step 2: Create a Logtail configuration

  1. Log on to the Simple Log Service console by using Alibaba Cloud Account A.
  2. In the Import Data section, click JSON - Text Log.
  3. Select the project and Logstore. Then, click Next.
  4. Create a machine group.

    a. On the ECS Instances tab, select the ECS instance on which Zabbix is installed. Then, click Create.

b. After Logtail is installed, click Complete Installation. c. In the Create Machine Group step, configure the Name parameter and click Next.

  1. Select the new machine group from Source Machine Group and move the machine group to Applied Server Groups. Then, click Next. ImportantIf you apply a machine group immediately after the machine group is created, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry.

  2. Create a Logtail configuration and click Next.

    Zabbix monitoring data is of the JSON type. We recommend that you specify JSON Mode for the Mode parameter in the Logtail configuration.

  3. Preview data, configure indexes, and then click Next. Preview data, configure indexes, and then click Next.You can also configure field indexes based on collected logs in manual mode or automatic mode. To configure field indexes in automatic mode, click Automatic Index Generation. This way, Simple Log Service automatically creates field indexes.For more information, see Create indexes.

ImportantIf you want to query and analyze logs, you must enable full-text indexing or field indexing.If you enable full-text indexing and field indexing at the same time, the system uses only field indexes.