mlabouardy / grafana-dashboards

List of Grafana Dashboards 📺
136 stars 117 forks source link

unable to connect grafana to mysql #6

Open Daly123456 opened 3 years ago

Daly123456 commented 3 years ago

Hi i wanted to monitor my mysql database using this tuto https://www.blog.labouardy.com/mysql-monitoring-telegraf-influxdb-grafana/ After setting up telegraf correctly on the targets it worked fine but i found problem while importing datasource : i tried to import influxdb datasource and set it's database like mentionned on [[output.influx]] but it's not working i'am working with Grafana 7.2.0 Telegraf 1.15.3 Some help please i want to display this dashboard: https://grafana.com/grafana/dashboards/4031

Bentis commented 3 weeks ago

I know this is late, but for anyone else coming here:

I replaced the datasource (all occurences):

- "datasource": "MySQL",
+ "datasource": "InfluxDB-telegraf",

And the measurement name (all occurrences):

- "measurement": "mysql_mysql",
+ "measurement": "mysql",

Then i can import it and it will work. I have my datasource named "InfluxDB-telegraf".

Versions:

FWIW my telegraf config looks like this:

[[inputs.mysql]]
  servers = ["user:passwd@tcp(127.0.0.1:3306)/"]
  metric_version = 2

[[outputs.influxdb]]
  urls = ["http://127.0.0.1:8086"]
  database = "telegraf"

It seems the import function fails to map the old dashboard specification to new datasource, and instead selects my MySQL connection. Might be fixed by updating the dashboard source to newer export specification?