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

Commit

Permalink
Enhancement for deletion status and adding servicegroups and hostgrou…
Browse files Browse the repository at this point in the history
…ps types (#5433)
  • Loading branch information
Jean-Baptiste authored and kduret committed Jul 24, 2017
1 parent e3b805d commit 10ce6c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions www/include/configuration/configServers/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,17 @@ function checkChangeState($poller_id, $last_restart)
}

$query = "SELECT * FROM log_action WHERE action_log_date > $last_restart " .
"AND ((object_type = 'host' AND (action_type = 'd' OR object_id IN (SELECT host_host_id FROM " .
"AND ((object_type = 'host' AND ((action_type = 'd' AND object_id IN (SELECT host_id FROM hosts)) OR object_id IN (SELECT host_host_id FROM " .
$conf_centreon['db'] . ".ns_host_relation WHERE nagios_server_id = '$poller_id'))) " .
"OR (object_type = 'service' AND (action_type = 'd' OR object_id IN (SELECT service_service_id FROM " .
"OR (object_type = 'service' AND ((action_type = 'd' AND object_id IN (SELECT service_id FROM services)) OR object_id IN (SELECT service_service_id FROM " .
$conf_centreon['db'] . ".ns_host_relation nhr, " . $conf_centreon['db'] . ".host_service_relation hsr " .
"WHERE nagios_server_id = '$poller_id' AND hsr.host_host_id = nhr.host_host_id))))";
"WHERE nagios_server_id = '$poller_id' AND hsr.host_host_id = nhr.host_host_id)))" .
"OR (object_type = 'servicegroup' AND ((action_type = 'd' AND object_id IN (SELECT DISTINCT servicegroup_id FROM services_servicegroups)) OR object_id IN (SELECT DISTINCT servicegroup_sg_id FROM " .
$conf_centreon['db'] . ".servicegroup_relation sgr, " . $conf_centreon['db'] . ".ns_host_relation nhr " .
"WHERE sgr.host_host_id = nhr.host_host_id AND nhr.nagios_server_id = '$poller_id')))" .
"OR (object_type = 'hostgroup' AND ((action_type = 'd' AND object_id IN (SELECT DISTINCT hostgroup_id FROM hosts_hostgroups)) OR object_id IN (SELECT DISTINCT hr.hostgroup_hg_id FROM " .
$conf_centreon['db'] . ".hostgroup_relation hr, " . $conf_centreon['db'] . ".ns_host_relation nhr " .
"WHERE hr.host_host_id = nhr.host_host_id AND nhr.nagios_server_id = '$poller_id'))))";
$dbResult = $pearDBO->query($query);
if ($dbResult->rowCount()) {
return 1;
Expand Down
2 changes: 1 addition & 1 deletion www/include/configuration/configServers/listServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@

$tpl->assign(
"notice",
_("Only services and hosts are taken in account in order to calculate this status. " .
_("Only services, servicegroups, hosts and hostgroups are taken in account in order to calculate this status. " .
"If you modify a template, it won't tell you the configuration had changed.")
);

Expand Down

0 comments on commit 10ce6c2

Please sign in to comment.