config influxdb host

This commit is contained in:
root 2016-04-29 12:39:53 +02:00
parent 756d9e3697
commit 18acdd7642
3 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@ nodes:
aliases_path: /var/www/html/meshviewer/data/aliases.json
influxdb:
enable: false
host: http://localhost:8086
database: ffhb
username:
password:

View File

@ -34,6 +34,7 @@ type Config struct {
} `yaml:"nodes"`
Influxdb struct {
Enable bool `yaml:"enable"`
Addr string `yaml:"host"`
Database string `yaml:"database"`
Username string `yaml:"username"`
Password string `yaml:"password"`

View File

@ -22,7 +22,7 @@ type StatsDb struct {
func NewStatsDb() *StatsDb {
// Make client
c, err := client.NewHTTPClient(client.HTTPConfig{
Addr: "http://localhost:8086",
Addr: config.Influxdb.Addr,
Username: config.Influxdb.Username,
Password: config.Influxdb.Password,
})