Notes:
- https://www.zabbix.org/wiki/Docs/protocols/zabbix_proxy/2.0
- https://www.zabbix.com/documentation/2.0/manual/appendix/api/history/definitions
- ZBXNEXT-473
(c/o js-sequence-diagrams)
Note right of Server: proxies.php
Note right of Proxy: /etc/zabbix\n/zabbix_proxy.conf\nProxyMode: Active\nConfigFreq 900s
Proxy->Server: Configuration \\nHeartbeat
Proxy->Proxy: Internal
Note right of Agent: /etc/zabbix\n/zabbix_agentd.conf
Proxy->Agent: zabbix_get\n(agent.verion)
Agent->Proxy: Value\n(x.y.z)
Proxy->Agent: zabbix_get\n(system.uptime)
Agent->Proxy: Value\n(13208227)
Note over Proxy: ...
Proxy->Server: Bulk item values
Note right of Proxy: DataSenderFreq 1s
Note over Proxy: ...
Proxy->Server: Configuration \\nHeartbeat
$ zabbix_get -s server.name -p 10051 -k '{"request":"history data","host":"PROXYNAME","data":[{"host":"monitored.host.name","key":"system.hostname","clock":1395680522,"ns":236229445,"value":"Hello, World"}]}'
{
"response":"success",
"info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000045"}
Setup:
- discoveryconf.php
- IP range: 0.0.0.0
- Checks: Zabbix agent "system.hostname"
- Device uniqueness criteria: Zabbix agent "system.hostname"
- actionconf.php
- Conditions: Discovery check = Discovery Test: Zabbix agent "system.hostname"
- Operations: Add host
Mapping:
drule
== discoveryconf.php druleiddcheck
== discoveryconf.php?druleid=... dcheckid
$ zabbix_get -s server.name -p 10051 -k '{"request":"discovery data","host":"PROXYNAME","data":[{"drule":58,"dcheck":112,"host":"monitored.host1.name","key":"system.hostname","clock":1395680522,"type":9,"ip":"192.168.1.10","port":10050,"dns":"monitored.host2.name"}],"clock":1395680522}'
$ zabbix_get -s server.name -p 10051 -k '{"request":"discovery data","host":"PROXYNAME","data":[{"drule":58,"dcheck":112,"host":"monitored.host2.name","key":"system.hostname","value":"monitored.host2.name","clock":1395680524,"type":9,"ip":"192.168.1.20","port":10050,"dns":"monitored.host2.name","status":0},{"clock":1395680524,"drule":58,"dcheck":null,"type":-1,"ip":"192.168.1.20","dns":"monitored.host2.name","status":0}],"clock":1395680524}'
(See also: VM monitoring: discovery: host prototype)