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

fix(top counter): display too much resources #5703

Merged
merged 2 commits into from
Sep 29, 2017
Merged
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
15 changes: 6 additions & 9 deletions www/include/monitoring/status/TopCounter/xml/statusCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,18 @@
"SUM(CASE WHEN s.state = 3 AND (s.acknowledged = '1' OR s.scheduled_downtime_depth = '1') " .
" THEN 1 ELSE 0 END) AS UNKNOWN_ACK_DT, " .
"SUM(CASE WHEN s.state = 4 THEN 1 ELSE 0 END) AS PENDING_TOTAL " .
"FROM hosts h, services s, instances i " ;
if (!$obj->is_admin) {
$query_svc_status .= ", centreon_acl ";
}
$query_svc_status .= "" .
"FROM hosts h, services s, instances i " .
"WHERE i.deleted = 0 " .
"AND h.enabled = 1 " .
"AND s.enabled = 1 " .
"AND i.instance_id = h.instance_id " .
"AND h.host_id = s.host_id ".
"AND h.host_id = s.host_id " .
"AND (h.name NOT LIKE '_Module_%' OR h.name LIKE '_Module_Meta%') ";
if (!$obj->is_admin) {
$query_svc_status .= "AND s.host_id = centreon_acl.host_id ".
"AND s.service_id = centreon_acl.service_id " .
"AND centreon_acl.group_id IN (".$obj->grouplistStr.")";
$query_svc_status .= "AND s.service_id IN ( " .
"SELECT DISTINCT service_id " .
"FROM centreon_acl " .
"WHERE centreon_acl.group_id IN (" . $obj->grouplistStr . ")) ";
}
$DBRESULT = $obj->DBC->query($query_svc_status);
$svc_stat = array_map("myDecode", $DBRESULT->fetchRow());
Expand Down