Skip DHCP Leases when device is offline
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
Stefan Hoffmann 2023-03-26 18:43:50 +02:00
parent 3e0c70bb03
commit 926153b8e7

View File

@ -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{