diff --git a/unms.go b/unms.go index b5f6f73..4a96415 100644 --- a/unms.go +++ b/unms.go @@ -148,7 +148,11 @@ func processUNMSAPIRouter() []node { // API CALL FOR DHCP LEASES log.Println("Getting DHCP Leases of ", d.Devices[i].Name, "from UNMS API") var dhcpleases UNMSdhcp - UnmsCallAPI("/devices/erouters/"+dev.Identification.ID+"/dhcp/leases", &dhcpleases) + if isOnline { + UnmsCallAPI("/devices/erouters/"+dev.Identification.ID+"/dhcp/leases", &dhcpleases) + } else { + log.Println("Router ist offline, skipping DHCP Leases") + } // Open connection to InfluxDB bp, err := client.NewBatchPoints(client.BatchPointsConfig{