All Products
Search
Document Center

Simple Log Service:Use Logtail to collect Zabbix data

Last Updated:Aug 29, 2023

Zabbix is a commonly used open source monitoring system. Zabbix provides a variety of alert rules for system monitoring. Simple Log Service allows you to collect monitoring data from Zabbix and send the collected data to a Logstore. This topic describes how to collect and send Zabbix data to Simple Log Service.

Prerequisites

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
  3. Specify the data storage path in the zabbix_server.conf file.

    ExportDir=/tmp/
  4. Restart the Zabbix service 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 Log Service console.

  2. In the Import Data section, select JSON - Text Log.

  3. Select the project and Logstore. Then, click Next.
  4. Create a machine group.

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

      For more information, see Install Logtail on ECS instances.

      If Zabbix is installed on a server in a self-managed cluster or a server on a third-party cloud, you must manually install Logtail. For more information, see Install Logtail on a Linux server or Install Logtail on a Windows server.

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

      Log Service allows you to create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create an IP address-based machine group and Create a custom identifier-based machine group.

  5. Select the new machine group from Source Server Groups and move the machine group to Applied Server Groups. Then, click Next.
    Important If you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
  6. Create a Logtail configuration and click Next.

    Zabbix monitoring data is of the JSON type. We recommend that you select JSON Mode for Mode in the Logtail configuration. In addition, you must set Log Path to the data storage path that you specify in Step Step 1: Specify a data storage path. For more information about other parameters, see Collect logs in JSON mode.

    Logtail configuration
  7. Preview data, configure indexes, and then click Next.
    By default, full-text indexing is enabled for Log Service. 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, Log Service automatically creates field indexes. For more information, see Create indexes.
    Important If you want to query and analyze logs, you must enable full-text indexing or field indexing. If you enable both full-text indexing and field indexing, the system uses only field indexes.