Compare commits
2 Commits
064161584d
...
0411e59eed
Author | SHA1 | Date | |
---|---|---|---|
0411e59eed | |||
ae6d96a0ff |
@ -16,14 +16,17 @@ func processGateways() []node {
|
|||||||
log.Println("Processing Static Device: ", d.Devices[i].Name)
|
log.Println("Processing Static Device: ", d.Devices[i].Name)
|
||||||
currentDevice := d.Devices[i]
|
currentDevice := d.Devices[i]
|
||||||
|
|
||||||
//Calulate Memory
|
//Collect data
|
||||||
|
//Calulate Memory (%)
|
||||||
mem := getInfluxDataPoint("mem", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
mem := getInfluxDataPoint("mem", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
||||||
maxmem := getInfluxDataPoint("maxmem", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
maxmem := getInfluxDataPoint("maxmem", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
||||||
memory := mem / maxmem * 100
|
memoryMap := mem / maxmem
|
||||||
|
memory := memoryMap * 100
|
||||||
|
// Get Network
|
||||||
rx := getInfluxDataPoint("netin", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
rx := getInfluxDataPoint("netin", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
||||||
tx := getInfluxDataPoint("netout", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
tx := getInfluxDataPoint("netout", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
||||||
// Get CPU
|
// Get CPU (%)
|
||||||
cpu := getInfluxDataPoint("cpu", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
cpu := getInfluxDataPoint("cpu", currentDevice.FQDN, conf.General.ProxmoxInfluxPort) * 100
|
||||||
//Uptime (seconds)
|
//Uptime (seconds)
|
||||||
uptime := getInfluxDataPoint("uptime", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
uptime := getInfluxDataPoint("uptime", currentDevice.FQDN, conf.General.ProxmoxInfluxPort)
|
||||||
t := time.Duration(uptime * float64(time.Second))
|
t := time.Duration(uptime * float64(time.Second))
|
||||||
@ -54,6 +57,7 @@ func processGateways() []node {
|
|||||||
log.Fatalln("Error: ", err)
|
log.Fatalln("Error: ", err)
|
||||||
}
|
}
|
||||||
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
sendInfluxBatchDataPoint(point, conf.General.FreifunkInfluxPort)
|
||||||
|
|
||||||
//Build Nodes
|
//Build Nodes
|
||||||
nodes = append(nodes, node{
|
nodes = append(nodes, node{
|
||||||
Firstseen: up.Format(iso8601),
|
Firstseen: up.Format(iso8601),
|
||||||
@ -66,7 +70,7 @@ func processGateways() []node {
|
|||||||
ClientsOther: 0,
|
ClientsOther: 0,
|
||||||
RootFSUsage: 0,
|
RootFSUsage: 0,
|
||||||
LoadAVG: cpu,
|
LoadAVG: cpu,
|
||||||
MemoryUsage: memory,
|
MemoryUsage: memoryMap,
|
||||||
Uptime: up.Format(iso8601),
|
Uptime: up.Format(iso8601),
|
||||||
GatewayNexthop: "",
|
GatewayNexthop: "",
|
||||||
Gateway: "",
|
Gateway: "",
|
||||||
|
Loading…
Reference in New Issue
Block a user