Zabbix uses JSON based communication protocol for communication with Zabbix Agent.
Passive check is a simple data request. Zabbix Server (or Proxy) asks for a data, for example, CPU load, and Zabbix Agent sends the result back to the Server.
Server Request
Agent Response
For example:
Active checks requires more complex processing. The Agent must retrieve list of items for independent processing first. It also periodically sends new values to the Server.
Agent Request
Server Response
{
"response":"success",
"data":[
{
"key":"log[\/home\/zabbix\/logs\/zabbix_agentd.log]",
"delay":"30",
"lastlogsize":"0"
},
{
"key":"agent.version",
"delay":"600"
}
]
}
The Server must respond with success. For each returned item, key and delay must exist. For items having type "Log", the lastlogsize must exist as well.
For example:
Agent Sends
<HEADER><DATALEN>{
"request":"agent data",
"data":[
{
"host":"<hostname>",
"key":"log[\/home\/zabbix\/logs\/zabbix_agentd.log]",
"value":" 13039:20090907:184546.759 zabbix_agentd started. ZABBIX 1.6.6 (revision {7836}).",
"lastlogsize":80,
"clock":1252926015
},
{
"host":"<hostname>",
"key":"agent.version",
"value":"1.6.6",
"clock":1252926015
}
],
"clock":1252926016
}
Server Response
<HEADER><DATALEN>{
"response":"success",
"info":"Processed 2 Failed 0 Total 2 Seconds spent 0.002070"
}
For example: