Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Mon 4190 issue with multiple rs #7922

Merged
merged 2 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions www/class/config-generate-remote/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,16 @@ private function getPollerFromId(int $pollerId)
private function getPollersFromRemote(int $remoteId)
{
$stmt = $this->backendInstance->db->prepare(
"SELECT * FROM nagios_server
WHERE remote_id = :remote_id"
"SELECT ns1.*
FROM nagios_server AS ns1
WHERE ns1.remote_id = :remote_id
GROUP BY ns1.id
UNION
SELECT ns2.*
FROM nagios_server AS ns2
INNER JOIN rs_poller_relation AS rspr ON rspr.poller_server_id = ns2.id
AND rspr.remote_server_id = :remote_id
GROUP BY ns2.id"
);
$stmt->bindParam(':remote_id', $remoteId, PDO::PARAM_INT);
$stmt->execute();
Expand Down
2 changes: 1 addition & 1 deletion www/include/configuration/configServers/formServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
);
}
}
$dbResult->closeCursor();
$statement->closeCursor();
}
}

Expand Down