Don't run poller validations when there are no devices (#16088)

* Don't run poller validations when there are no devices

* Missing import
This commit is contained in:
Tony Murray
2024-06-04 14:55:24 -05:00
committed by GitHub
parent 390baa73fb
commit 0cdb58fab9
2 changed files with 4 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
namespace LibreNMS\Validations\Poller;
use App\Models\Device;
use App\Models\Poller;
use App\Models\PollerCluster;
use LibreNMS\ValidationResult;
@@ -54,6 +55,6 @@ class CheckActivePoller implements \LibreNMS\Interfaces\Validation
*/
public function enabled(): bool
{
return true;
return Device::exists();
}
}

View File

@@ -25,6 +25,7 @@
namespace LibreNMS\Validations\Poller;
use App\Models\Device;
use App\Models\Poller;
use App\Models\PollerCluster;
use LibreNMS\ValidationResult;
@@ -48,7 +49,7 @@ class CheckDispatcherService implements \LibreNMS\Interfaces\Validation
*/
public function enabled(): bool
{
return true;
return Device::exists();
}
private function checkDispatchService(): ValidationResult