grafana-telegraf-dashboard-generator
grafana-telegraf-dashboard-generator copied to clipboard
Problems with default setup
Hi!
I'm running a fresh install of Grafana 3.0.4, InfluxDB 0.13.0 and Telegraf 0.13.1 on a Debian Jessie server. All packages are left in their default configuration. In Grafana, I've set up a Datasource named "telegraf" with an InfluxDB connection to localhost:8086.
Generating and importing works:
# ./generator.py -v
INFO:urllib3.connectionpool:Starting new HTTP connection (1): localhost
DEBUG:urllib3.connectionpool:"GET /query?q=SHOW+DATABASES HTTP/1.1" 200 133
DEBUG:root:InfluxDB database telegraf :
INFO:urllib3.connectionpool:Resetting dropped connection: localhost
DEBUG:urllib3.connectionpool:"GET /query?q=SHOW+MEASUREMENTS&db=telegraf HTTP/1.1" 200 129
# ls dashboards
telegraf.json
# curl "http://admin:[email protected]:3000/api/dashboards/db" -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary @dashboards/telegraf.json
{"slug":"telegraf","status":"success","version":1}#
Problem: When i select the dashboard in Grafana, it doesn't work. The title of the first row is "NETFLOW - $PROJET", the Uptime has "$server" as title. All panels have red exclamation marks. Inspector shows following error:
{
"error": "error parsing query: found $, expected identifier, string, number, bool at line 1, char 100",
"message": "error parsing query: found $, expected identifier, string, number, bool at line 1, char 100"
}
How do i get this to work?
best regards, Thomas
Hi @thomask77,
I'm not sure you need netflow. You might as well comment it in the script.
The $server
thing is a templating that you don't have in your dashboard.
You would need to add one with the name server
and a value that is the hostname of your machine.
Once you've done that you can add a file in the templates folder so it is included in the dashboard when generated.