Hello, in our application we are using in-house software to monitor devices and maintain their status in Zabbix. The in-house software is the source-of-truth for what devices exist so the flow is:
What I've found is that if you send a data point too quickly after creating the host, the data-point is rejected. What I mean is that the response to the `"sender data"` request is:
but if I wait long enough (at least 30 seconds), the response is:
How can I find out, programmatically, when the trapper item is ready to receive data?
Code:
for each device:
test if it exists in Zabbix and if not, add it with the API `host.create` call, applying a template which gives each host a trapper item and a couple of triggers.
for each device:
obtain its 'status' [doesn't matter what that means here] and send a data-point (0 or a 1) as appropriate to the devices trapper item: {"request":"sender data","data":[{"host":"$HOSTNAME","key":"$TRAPPERITEM","value":"0 or 1","clock":epoch}`
Code:
{"response":"success","info":"processed: 0; failed: 1; total: 1; seconds spent: 0.000022"}
Code:
{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000057"}
Comment