parent
f88e318dce
commit
193c575e3a
|
@ -108,6 +108,7 @@ class PrefetchCache
|
||||||
{
|
{
|
||||||
if ($this->hostServiceBlacklist === null) {
|
if ($this->hostServiceBlacklist === null) {
|
||||||
$this->hostServiceBlacklist = new HostServiceBlacklist($this->db);
|
$this->hostServiceBlacklist = new HostServiceBlacklist($this->db);
|
||||||
|
$this->hostServiceBlacklist->preloadMappings();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->hostServiceBlacklist;
|
return $this->hostServiceBlacklist;
|
||||||
|
|
|
@ -413,7 +413,7 @@ class IcingaService extends IcingaObject
|
||||||
if (! empty($blacklist)) {
|
if (! empty($blacklist)) {
|
||||||
if (count($blacklist) === 1) {
|
if (count($blacklist) === 1) {
|
||||||
$output .= sprintf(
|
$output .= sprintf(
|
||||||
" ignore host.name == %s\n",
|
" ignore where host.name == %s\n",
|
||||||
c::renderString($blacklist[0])
|
c::renderString($blacklist[0])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -61,6 +61,10 @@ class HostServiceBlacklist
|
||||||
|
|
||||||
public function fetchMappingsForService(IcingaService $service)
|
public function fetchMappingsForService(IcingaService $service)
|
||||||
{
|
{
|
||||||
|
if (! $service->hasBeenLoadedFromDb()) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$db = $this->db->getDbAdapter();
|
$db = $this->db->getDbAdapter();
|
||||||
$query = $db->select()->from(['hsb' => $this->table], [
|
$query = $db->select()->from(['hsb' => $this->table], [
|
||||||
'host_name' => 'h.object_name',
|
'host_name' => 'h.object_name',
|
||||||
|
|
Loading…
Reference in New Issue