grafana / grafana-zabbix

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

No data when querying custom item defined by User Parameter #173

Open grafoo opened 8 years ago

grafoo commented 8 years ago

when i try to create a graph from a custom item ( datasource is a command defined by a user parameter ) nothing will be plotted. also tables and other types of panels are not working.

alexanderzobnin commented 8 years ago

Do you see this metric in zabbix?

grafoo commented 8 years ago

Yeah. In zabbix itself it works alright. Can i somehow turn on logging in your plugin?

alexanderzobnin commented 8 years ago

Can you look at browser network requests in dev tools? What zabbix api return.

grafoo commented 8 years ago

good idea!

a successful api query will look like this request

'{"jsonrpc":"2.0","method":"history.get","params":{"output":"extend","history":"0","itemids":["11111"],"sortfield":"clock","sortorder":"ASC","time_from":1458182849,"time_till":1458204449},"auth":"someauthtoken1234","id":1}'

response the resultset will have an array of the following entries:

{"itemid":"111111","clock":"1458182870","value":"0.0112","ns":"839060550"}

when querying the custom item, it will look for all items of a given host matching value types from 0 to 3 request

'{"jsonrpc":"2.0","method":"item.get","params":{"output":["name","key_","value_type","delay"],"sortfield":"name","webitems":true,"filter":{"value_type":[0,3]},"monitored":true,"searchByAny":true,"hostids":["99999"]},"auth":"someauthtoken1234","id":1}'

response the response will have an array of those items e.g.

{"itemid":"22222","name":"$1 service available","key_":"net.tcp.service[ssh,,22]","value_type":"3","delay":"30","hostid":"99999"}

maybe it is important to know that the items where the query isn't working where created using low-level discovery?

grafoo commented 8 years ago

i guess it's slightly different than i first anticipated. you're using

'{"jsonrpc":"2.0","method":"item.get","params":{"output":["name","key_","value_type","delay"],"sortfield":"name","webitems":true,"filter":{"value_type":[0,3]},"monitored":true,"searchByAny":true,"hostids":["99999"]},"auth":"someauthtoken1234","id":1}'

for discovering all supported items by the host right?

so in this case when selecting the item which isn't working, grafana simply doesn't not send the additional request to get the values if the item.

alexanderzobnin commented 8 years ago

What version of Zabbix do you use?

grafoo commented 8 years ago

2.0.16

alexanderzobnin commented 8 years ago

I need to check api details for 2.0. It's very old version, and it may have some differencies from 2.2 and 2.4.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had activity in the last 2 years. It will be closed in 60 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!