Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 1 | /** @scratch /configuration/config.js/1 |
| 2 | * == Configuration |
| 3 | * config.js is where you will find the core Grafana configuration. This file contains parameter that |
| 4 | * must be set before kibana is run for the first time. |
| 5 | */ |
| 6 | define(['settings'], |
| 7 | function (Settings) { |
| 8 | "use strict"; |
| 9 | |
| 10 | return new Settings({ |
| 11 | |
| 12 | /** |
| 13 | * elasticsearch url: |
| 14 | * For Basic authentication use: http://username:password@domain.com:9200 |
| 15 | */ |
Michael Kutý | 56bc4d1 | 2014-03-03 19:01:04 +0100 | [diff] [blame] | 16 | elasticsearch: "http://{{ salt['pillar.get']('grafana:server:elasticsearch:host', "") }}:{{ salt['pillar.get']('grafana:server:elasticsearch:port', 9200) }}", |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * graphite-web url: |
| 20 | * For Basic authentication use: http://username:password@domain.com |
| 21 | * Basic authentication requires special HTTP headers to be configured |
| 22 | * in nginx or apache for cross origin domain sharing to work (CORS). |
| 23 | * Check install documentation on github |
| 24 | */ |
Michael Kutý | a52b0db | 2014-03-03 19:54:05 +0100 | [diff] [blame^] | 25 | {% if (pillar.grafana.server.data|length) == 1 %} |
Michael Kutý | 56bc4d1 | 2014-03-03 19:01:04 +0100 | [diff] [blame] | 26 | |
Michael Kutý | 8af5295 | 2014-03-03 19:38:47 +0100 | [diff] [blame] | 27 | {% for data in pillar.grafana.server.data %} |
| 28 | {%- if data.type == "graphite" %} |
Michael Kutý | a52b0db | 2014-03-03 19:54:05 +0100 | [diff] [blame^] | 29 | graphiteUrl: "http://{{ data.host }}:{{ data.port }}", |
Michael Kutý | 8af5295 | 2014-03-03 19:38:47 +0100 | [diff] [blame] | 30 | {%- endif %} |
| 31 | {% endfor %} |
| 32 | |
| 33 | {%- else %} |
| 34 | /*graphiteUrl: "http://"+{{ salt['pillar.get']('grafana:server:data:host', "")}}+":{{ salt['pillar.get']('grafana:server:data:port', 80)}}", |
| 35 | */ |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Multiple graphite servers? Comment out graphiteUrl and replace with |
| 39 | * |
| 40 | * datasources: { |
Michael Kutý | a52b0db | 2014-03-03 19:54:05 +0100 | [diff] [blame^] | 41 | |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 42 | * data_center_us: { type: 'graphite', url: 'http://<graphite_url>', default: true }, |
| 43 | * data_center_eu: { type: 'graphite', url: 'http://<graphite_url>' } |
| 44 | * } |
| 45 | */ |
Michael Kutý | 8af5295 | 2014-03-03 19:38:47 +0100 | [diff] [blame] | 46 | {%- endif %} |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 47 | |
| 48 | default_route: '/dashboard/file/default.json', |
| 49 | |
| 50 | /** |
| 51 | * If your graphite server has another timezone than you & users browsers specify the offset here |
| 52 | * Example: "-0500" (for UTC - 5 hours) |
| 53 | */ |
| 54 | timezoneOffset: null, |
| 55 | |
| 56 | grafana_index: "grafana-dash", |
| 57 | |
| 58 | panel_names: [ |
| 59 | 'text', |
| 60 | 'graphite' |
| 61 | ] |
| 62 | }); |
| 63 | }); |