mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-07 05:59:35 -05:00
Apply public static getRestriction and applyMonitoringRestriction changes
Apply the public static getRestriction and applyMonitoringRestriction changes in the places were the corresponding methods are used.
This commit is contained in:
parent
d494cf3cee
commit
ce3bbde289
3 changed files with 8 additions and 7 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Businessprocess\Common;
|
||||
|
||||
use Icinga\Module\Businessprocess\IcingaDbBackend;
|
||||
use Icinga\Module\Businessprocess\MonitoringRestrictions;
|
||||
|
||||
trait EnumList
|
||||
{
|
||||
|
|
@ -14,7 +15,7 @@ trait EnumList
|
|||
$names = $this->backend
|
||||
->select()
|
||||
->from('hostStatus', ['hostname' => 'host_name'])
|
||||
->applyFilter($this->getRestriction('monitoring/filter/objects'))
|
||||
->applyFilter(MonitoringRestrictions::getRestriction('monitoring/filter/objects'))
|
||||
->order('host_name')
|
||||
->getQuery()
|
||||
->fetchColumn();
|
||||
|
|
@ -38,7 +39,7 @@ trait EnumList
|
|||
$names = $this->backend
|
||||
->select()
|
||||
->from('hostStatus', ['hostname' => 'host_name'])
|
||||
->applyFilter($this->getRestriction('monitoring/filter/objects'))
|
||||
->applyFilter(MonitoringRestrictions::getRestriction('monitoring/filter/objects'))
|
||||
->order('host_name')
|
||||
->getQuery()
|
||||
->fetchColumn();
|
||||
|
|
@ -64,7 +65,7 @@ trait EnumList
|
|||
->select()
|
||||
->from('serviceStatus', ['service' => 'service_description'])
|
||||
->where('host_name', $host)
|
||||
->applyFilter($this->getRestriction('monitoring/filter/objects'))
|
||||
->applyFilter(MonitoringRestrictions::getRestriction('monitoring/filter/objects'))
|
||||
->order('service_description')
|
||||
->getQuery()
|
||||
->fetchColumn();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class IcingaDbBackend
|
|||
$hosts = Host::on($this->conn)
|
||||
->orderBy('host.name');
|
||||
|
||||
$this->applyMonitoringRestriction($hosts);
|
||||
self::applyMonitoringRestriction($hosts);
|
||||
|
||||
return $hosts;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ class IcingaDbBackend
|
|||
->where(['service_host.name = ?' => $host])
|
||||
->orderBy('service.name');
|
||||
|
||||
$this->applyMonitoringRestriction($services);
|
||||
self::applyMonitoringRestriction($services);
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class IcingaDbState extends IcingaDbBackend
|
|||
$queryHost->getSelectBase()
|
||||
->where(['host.name IN (?)' => $hosts]);
|
||||
|
||||
$this->applyMonitoringRestriction($queryHost);
|
||||
IcingaDbBackend::applyMonitoringRestriction($queryHost);
|
||||
|
||||
if ($this->config->usesHardStates()) {
|
||||
$stateCol = 'state.hard_state';
|
||||
|
|
@ -96,7 +96,7 @@ class IcingaDbState extends IcingaDbBackend
|
|||
$queryService->getSelectBase()
|
||||
->where(['service_host.name IN (?)' => $hosts]);
|
||||
|
||||
$this->applyMonitoringRestriction($queryService);
|
||||
IcingaDbBackend::applyMonitoringRestriction($queryService);
|
||||
|
||||
$serviceStatusCols = array(
|
||||
'hostname' => 'host.name',
|
||||
|
|
|
|||
Loading…
Reference in a new issue