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
Zabbix is downloaded and 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 Create a project and Create a Logstore.
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:
Log on to the ECS instance on which Zabbix is installed.
Open the zabbix_server.conf file.
vim /etc/zabbix/zabbix_server.conf
Specify the data storage path in the zabbix_server.conf file.
ExportDir=/tmp/
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
Log on to the Simple Log Service console.
In the Import Data section, select JSON - Text Log.
Select the project and Logstore. Then, click Next.
Create a machine group.
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.
After Logtail is installed, click Complete Installation.
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.
Confirm that the machine group is displayed in the Applied Server Groups section and click Next.
ImportantIf 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 Simple 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?
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.
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.
ImportantIf 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.