4 Trapper items

Overview

Zabbix server uses a JSON- based communication protocol for receiving data from Zabbix sender with the help of trapper item.

Request and response messages must begin with header and data length.

Zabbix sender request

  1. {
  2. "request":"sender data",
  3. "data":[
  4. {
  5. "host":"<hostname>",
  6. "key":"trap",
  7. "value":"test value"
  8. }
  9. ]
  10. }

Zabbix server response

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

Zabbix sender request with a timestamp

Alternatively Zabbix sender can send a request with a timestamp and nanoseconds.

  1. {
  2. "request":"sender data",
  3. "data":[
  4. {
  5. "host":"<hostname>",
  6. "key":"trap",
  7. "value":"test value",
  8. "clock":1516710794,
  9. "ns":592397170
  10. },
  11. {
  12. "host":"<hostname>",
  13. "key":"trap",
  14. "value":"test value",
  15. "clock":1516710795,
  16. "ns":192399456
  17. }
  18. ],
  19. "clock":1516712029,
  20. "ns":873386094
  21. }

Zabbix server response

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