Module status cleanups (#15461)

* Module status helper

* Correct reference

* Rename function to make it more explicit

* Same for exists checks, normalize argument names

* Use new functions
This commit is contained in:
Tony Murray
2023-10-16 05:03:32 -07:00
committed by GitHub
parent abf4fa0004
commit fb59cfec1c
16 changed files with 60 additions and 52 deletions

View File

@@ -46,7 +46,7 @@ class Slas implements Module
public function shouldDiscover(OS $os, ModuleStatus $status): bool
{
return $status->isEnabled() && ! $os->getDevice()->snmp_disable && $os->getDevice()->status && $os instanceof SlaDiscovery;
return $status->isEnabledAndDeviceUp($os->getDevice()) && $os instanceof SlaDiscovery;
}
/**
@@ -66,7 +66,7 @@ class Slas implements Module
public function shouldPoll(OS $os, ModuleStatus $status): bool
{
return $status->isEnabled() && ! $os->getDevice()->snmp_disable && $os->getDevice()->status && $os instanceof SlaPolling;
return $status->isEnabledAndDeviceUp($os->getDevice()) && $os instanceof SlaPolling;
}
/**