Skip DHCP Leases when device is offline
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
3e0c70bb03
commit
926153b8e7
4
unms.go
4
unms.go
@ -148,7 +148,11 @@ func processUNMSAPIRouter() []node {
|
|||||||
// API CALL FOR DHCP LEASES
|
// API CALL FOR DHCP LEASES
|
||||||
log.Println("Getting DHCP Leases of ", d.Devices[i].Name, "from UNMS API")
|
log.Println("Getting DHCP Leases of ", d.Devices[i].Name, "from UNMS API")
|
||||||
var dhcpleases UNMSdhcp
|
var dhcpleases UNMSdhcp
|
||||||
|
if isOnline {
|
||||||
UnmsCallAPI("/devices/erouters/"+dev.Identification.ID+"/dhcp/leases", &dhcpleases)
|
UnmsCallAPI("/devices/erouters/"+dev.Identification.ID+"/dhcp/leases", &dhcpleases)
|
||||||
|
} else {
|
||||||
|
log.Println("Router ist offline, skipping DHCP Leases")
|
||||||
|
}
|
||||||
|
|
||||||
// Open connection to InfluxDB
|
// Open connection to InfluxDB
|
||||||
bp, err := client.NewBatchPoints(client.BatchPointsConfig{
|
bp, err := client.NewBatchPoints(client.BatchPointsConfig{
|
||||||
|
Loading…
Reference in New Issue
Block a user