Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "grafana"]
path = grafana
url = https://github.com/torkelo/grafana.git
url = https://github.com/grafana/grafana.git
25 changes: 21 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }); });");
}
10 changes: 8 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down