anryko / grafana-influx-dashboard

Grafana InfluxDB scripted dashboard
MIT License
132 stars 44 forks source link

Fixes incorrect filtering of hosts #3

Closed yannh closed 9 years ago

yannh commented 9 years ago

Hi Anryko, can you give me your opinion on this? I had to change it to get it to work. The goal of this filter is to return the datasources that have grafanadb set to True and type set to "influxdb"? It would seem that your condition is wrong? Thanks a lot!

anryko commented 9 years ago

Hey! Goal of the filter is to exclude grafanaDB datasources and all datasources that are not of influxdb type. So if datasource.grafanaDB is true we need to discard this datasource (aka return false from the filter function). Also we need to return true if datasource.type is 'influxdb' and false in all other cases. In your correction we will get grafanaDB datasource (this is a database where grafanadb saves its configuration and not actual datasource) which we do not need.

yannh commented 9 years ago

@anryko > Thank you I understand now. The issue in my case was then that I currently store my graphs in InfluxDB (which is not such a good idea and I might change soon, though). Therefore the datasource was of type InfluxDB but also a grafanaDB.

anryko commented 9 years ago

@yannh > influxdb is great. I store my graphs there too and use this script to present them. Your problem is just "grafanaDB: true" in your data datasource configuration. According to http://docs.grafana.org/install/ you should have this enabled only on your 'dashboard storage' (datasource in influxdb where you store your static dashboard configuration).