send influx datapoints only when enabled
This commit is contained in:
parent
7549eaa5d0
commit
73166fcedc
@ -57,7 +57,9 @@ func processGateways() []node {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("Error: ", err)
|
log.Fatalln("Error: ", err)
|
||||||
}
|
}
|
||||||
|
if conf.General.InfluxEnabled {
|
||||||
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
||||||
|
}
|
||||||
|
|
||||||
//Build Nodes
|
//Build Nodes
|
||||||
nodes = append(nodes, node{
|
nodes = append(nodes, node{
|
||||||
|
1
types.go
1
types.go
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
General struct {
|
General struct {
|
||||||
|
InfluxEnabled bool `json:"influx_enabled"`
|
||||||
FreifunkInfluxPort string `json:"freifunk_influx_port"`
|
FreifunkInfluxPort string `json:"freifunk_influx_port"`
|
||||||
ProxmoxInfluxPort string `json:"proxmox_influx_port"`
|
ProxmoxInfluxPort string `json:"proxmox_influx_port"`
|
||||||
InfluxURL string `json:"influx_url"`
|
InfluxURL string `json:"influx_url"`
|
||||||
|
2
unifi.go
2
unifi.go
@ -125,7 +125,9 @@ func processUcAPIs() ([]node, []link, error) {
|
|||||||
log.Fatalln("Error: ", err)
|
log.Fatalln("Error: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if conf.General.InfluxEnabled {
|
||||||
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
||||||
|
}
|
||||||
|
|
||||||
// INFLUX STOP
|
// INFLUX STOP
|
||||||
|
|
||||||
|
3
unms.go
3
unms.go
@ -192,8 +192,9 @@ func processUNMSAPIRouter() ([]node, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("Error: ", err)
|
log.Fatalln("Error: ", err)
|
||||||
}
|
}
|
||||||
|
if conf.General.InfluxEnabled {
|
||||||
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
||||||
|
}
|
||||||
// Get info from json file (static)
|
// Get info from json file (static)
|
||||||
nodes = append(nodes, node{
|
nodes = append(nodes, node{
|
||||||
Firstseen: dev.Overview.CreatedAt.Format(iso8601),
|
Firstseen: dev.Overview.CreatedAt.Format(iso8601),
|
||||||
|
Loading…
Reference in New Issue
Block a user