Sidebar

2022 Zabbix中国峰会
2022 Zabbix中国峰会

4 捕捉器监控项

概述

Zabbix服务器使用基于JSON的通信协议,使用trapper item从Zabbix sender接收数据。

请求和响应消息必须以header and data length开头。

Zabbix sender请求

{
           "request":"sender data",
           "data":[
               {
                   "host":"<hostname>",
                   "key":"trap",
                   "value":"test value"
               }
           ]
       }

Zabbix服务器响应

{
           "response":"success",
           "info":"processed: 1; failed: 0; total: 1; seconds spent: 0.060753"
       }

Zabbix sender可以发送带有时间戳的请求

{
           "request":"sender data",
           "data":[
               {
                   "host":"<hostname>",
                   "key":"trap",
                   "value":"test value",
                   "clock":1516710794
               },
               {
                   "host":"<hostname>",
                   "key":"trap",
                   "value":"test value",
                   "clock":1516710795
               }
           ],
           "clock":1516712029,
           "ns":873386094
       }

Zabbix服务器响应

{
           "response":"success",
           "info":"processed: 2; failed: 0; total: 2; seconds spent: 0.060904"
       }