grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.08k stars 461 forks source link

How do annotaions work? #13

Closed nucleusv closed 9 years ago

nucleusv commented 9 years ago

I add metrics, but I don't get any annotaions vertical line for those metrics which have trigger?

alexanderzobnin commented 9 years ago

Sorry, annotation now in working.

alexanderzobnin commented 9 years ago

What do you think is better - annotation selection from items or from triggers?

nucleusv commented 9 years ago

According to http://play.grafana.org/dashboard/db/annotations?panelId=1&fullscreen&edit

I don't understand where it can be managed.

How I understand the logic, you have array of targets (itemids in zabbix ) in datasource, annotations are the lines when trigger fires up ?

so you should select all events for every target (itemid) https://www.zabbix.com/documentation/2.4/manual/api/reference/event/get

"output" => "extend", "object" => 0, //trigger "source" => 0, //by trigger "value" => 1, //fired up trigger "select_acknowledges" => "extend", //nice to have in tooltip by whom it was acknowledged "selectRelatedObject" => "extend", //to get trigger name - it will annotation title "sortfield" => ["clock", "eventid"], "sortorder" => "DESC"

here you should decide what field to use hostids string/array Return only events created by objects that belong to the given hosts. objectids string/array Return only events created by the given objects.

i.e. the event is created by trigger not by itemid directly so you cannot search in events by itemid, first you need to get all triggers for all targets - you will get trigger ids

then you should get all events: objectids : [all trigger ids] then you should group them by trigger name you will get it in sub array as related object

alexanderzobnin commented 9 years ago

See screenshot: 2015-05-15 22-49-22 grafana - zabbix datasource - mozilla firefox Annotations is just a marker at the graph related to some event (trigger change for example). In this plugin realization annotations get the events of triggers related to the given item.

nucleusv commented 9 years ago

is it working now ?

alexanderzobnin commented 9 years ago

Yes, but needed to specify itemid manually. Not useful.

alexanderzobnin commented 9 years ago

Resolved by 17392c06248550c1186093203961fa845533ccd8