diff --git a/staticDevices.go b/staticDevices.go index e5bd2da..289657a 100644 --- a/staticDevices.go +++ b/staticDevices.go @@ -57,7 +57,9 @@ func processGateways() []node { if err != nil { log.Fatalln("Error: ", err) } - sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + if conf.General.InfluxEnabled { + sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + } //Build Nodes nodes = append(nodes, node{ diff --git a/types.go b/types.go index 158e199..a63de51 100644 --- a/types.go +++ b/types.go @@ -11,6 +11,7 @@ import ( type config struct { General struct { + InfluxEnabled bool `json:"influx_enabled"` FreifunkInfluxPort string `json:"freifunk_influx_port"` ProxmoxInfluxPort string `json:"proxmox_influx_port"` InfluxURL string `json:"influx_url"` diff --git a/unifi.go b/unifi.go index 9fe9ffc..bb58616 100644 --- a/unifi.go +++ b/unifi.go @@ -125,7 +125,9 @@ func processUcAPIs() ([]node, []link, error) { log.Fatalln("Error: ", err) } - sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + if conf.General.InfluxEnabled { + sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + } // INFLUX STOP diff --git a/unms.go b/unms.go index bbe5377..fa6bcce 100644 --- a/unms.go +++ b/unms.go @@ -192,8 +192,9 @@ func processUNMSAPIRouter() ([]node, error) { if err != nil { log.Fatalln("Error: ", err) } - - sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + if conf.General.InfluxEnabled { + sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort) + } // Get info from json file (static) nodes = append(nodes, node{ Firstseen: dev.Overview.CreatedAt.Format(iso8601),