diff --git a/.gitmodules b/.gitmodules index d67fcb0..da0949b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "grafana"] path = grafana - url = https://github.com/torkelo/grafana.git + url = https://github.com/grafana/grafana.git diff --git a/app.js b/app.js index 38c11b4..3f85086 100644 --- a/app.js +++ b/app.js @@ -101,8 +101,25 @@ function grafanaconfigjs(req, res) { res.setHeader('Content-Type', 'application/javascript'); res.end("define(['settings'], " + - "function (Settings) {'use strict'; return new Settings({elasticsearch: '" + config.base_path + "/__es', graphiteUrl: '" + config.base_path + "/__gr', default_route : '/dashboard/file/default.json'," + - "grafana_index: '" + - getGrafanaIndex() + - "', timezoneOffset: null, panel_names: ['text','graphite'] }); });"); + "function (Settings) {'use strict'; return new Settings({"+ + "datasources: {"+ + "graphite_api: {"+ + "type: 'graphite',"+ + "url: '"+ config.base_path + "/__gr', "+ + "default: true"+ + "},"+ + "grafanadashboards: {"+ + "type: 'influxdb',"+ + "url: 'http://"+ config.influxdb_host + ":8086/db/"+ config.grafanadb_dbname +"', "+ + "username: '"+ config.grafanadb_user +"',"+ + "password: '"+ config.grafanadb_password +"',"+ + "grafanaDB: true"+ + "},"+ + "},"+ + + //"elasticsearch: '" + config.base_path + "/__es',"+ + "default_route : '/dashboard/file/default.json'," + + "grafana_index: '" + + getGrafanaIndex() + + "', timezoneOffset: null, panel_names: ['text','graphite'] }); });"); } diff --git a/config.js b/config.js index 37ce434..f03b9be 100644 --- a/config.js +++ b/config.js @@ -9,7 +9,13 @@ module.exports = { "es_username": "", // The basic authentication user of ES server, leave it blank if no basic auth applied "es_password": "", // The password of basic authentication of ES server, leave it blank if no basic auth applied. - "base_path": "/grafana", + "base_path": "", + + "influxdb_host": "influx_servername_here", + + "grafanadb_dbname": "grafana-dashboards", + "grafanadb_user": "dashboarduser", + "grafanadb_password": "dashboardpassword", //////////////////////////////////// // Proxy server configurations @@ -51,7 +57,7 @@ module.exports = { * in nginx or apache for cross origin domain sharing to work (CORS). * Check install documentation on github */ - "graphiteUrl": "http://"+window.location.hostname+":8080", + "graphiteUrl": "http://"+window.location.hostname+":8000", //////////////////////////////////// // Security Configurations