From 5b06851acbb9dcb20e057b5d184c608226c145ac Mon Sep 17 00:00:00 2001 From: Kevin Duret Date: Tue, 5 Nov 2019 16:03:20 +0100 Subject: [PATCH] fix(remote-server): export properly trap matching and hostgroups (#8054) Refs: MON-4436 --- www/class/config-generate-remote/Host.php | 2 ++ www/class/config-generate-remote/Relations/TrapsMatching.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/www/class/config-generate-remote/Host.php b/www/class/config-generate-remote/Host.php index eda729197c8..a1cdec444b6 100644 --- a/www/class/config-generate-remote/Host.php +++ b/www/class/config-generate-remote/Host.php @@ -49,6 +49,8 @@ private function getHostGroups(array &$host) $this->stmtHg = $this->backendInstance->db->prepare("SELECT hostgroup_hg_id FROM hostgroup_relation + INNER JOIN hostgroup ON hg_id = hostgroup_hg_id + AND hg_activate = '1' WHERE host_host_id = :host_id "); } diff --git a/www/class/config-generate-remote/Relations/TrapsMatching.php b/www/class/config-generate-remote/Relations/TrapsMatching.php index 932b9a0c70c..837e98715ca 100644 --- a/www/class/config-generate-remote/Relations/TrapsMatching.php +++ b/www/class/config-generate-remote/Relations/TrapsMatching.php @@ -22,6 +22,7 @@ use \PDO; use ConfigGenerateRemote\Abstracts\AbstractObject; +use ConfigGenerateRemote\ServiceCategory; class TrapsMatching extends AbstractObject { @@ -106,7 +107,7 @@ public function generateObject($trapId, $trapMatchCache) continue; } $this->generateObjectInFile($value, $value['tmo_id']); - serviceCategory::getInstance($this->dependencyInjector)->generateObject($value['severity_id']); + ServiceCategory::getInstance($this->dependencyInjector)->generateObject($value['severity_id']); } }