mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-11873-paradas-planificadas-de-modulos-ponen-en-modo-quiet-agente-en-vez-de-modulos' into 'develop'
Ent 11873 paradas planificadas de modulos ponen en modo quiet agente en vez de modulos See merge request artica/pandorafms!6345
This commit is contained in:
commit
9e747e9952
@ -1558,7 +1558,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
|||||||
$all_modules = true;
|
$all_modules = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($all_common_modules === true) {
|
if ($all_common_modules === true || $all_modules === true) {
|
||||||
$module_names = explode(',', get_parameter('all_common_modules'));
|
$module_names = explode(',', get_parameter('all_common_modules'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1602,7 +1602,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
|||||||
foreach ($agents as $agent_id) {
|
foreach ($agents as $agent_id) {
|
||||||
$agent_id = (int) $agent_id;
|
$agent_id = (int) $agent_id;
|
||||||
// Check module belongs to the agent.
|
// Check module belongs to the agent.
|
||||||
if ($modules_selection_mode == 'all' && $all_modules === false) {
|
if ($modules_selection_mode == 'all' && ($all_modules === false || $all_modules === true)) {
|
||||||
$check = false;
|
$check = false;
|
||||||
foreach ($module_names as $module_name) {
|
foreach ($module_names as $module_name) {
|
||||||
$check_module = modules_get_agentmodule_id(
|
$check_module = modules_get_agentmodule_id(
|
||||||
@ -1666,7 +1666,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result !== false && (bool) $all_modules === false) {
|
if ($result !== false && ((bool) $all_modules === false || (bool) $all_modules === true)) {
|
||||||
foreach ($module_names as $module_name) {
|
foreach ($module_names as $module_name) {
|
||||||
$module = modules_get_agentmodule_id(
|
$module = modules_get_agentmodule_id(
|
||||||
$module_name,
|
$module_name,
|
||||||
|
@ -620,17 +620,6 @@ function planned_downtimes_stop($downtime)
|
|||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($agents as $agent) {
|
foreach ($agents as $agent) {
|
||||||
if ($agent['all_modules']) {
|
|
||||||
$result = db_process_sql_update(
|
|
||||||
'tagente',
|
|
||||||
['quiet' => 0],
|
|
||||||
['id_agente' => $agent['id_agent']]
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($result) {
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$modules = db_get_all_rows_filter(
|
$modules = db_get_all_rows_filter(
|
||||||
'tplanned_downtime_modules',
|
'tplanned_downtime_modules',
|
||||||
[
|
[
|
||||||
@ -660,7 +649,6 @@ function planned_downtimes_stop($downtime)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'disable_agents':
|
case 'disable_agents':
|
||||||
|
@ -2660,12 +2660,6 @@ sub pandora_planned_downtime_set_quiet_elements($$$) {
|
|||||||
WHERE id_downtime = ' . $downtime_id);
|
WHERE id_downtime = ' . $downtime_id);
|
||||||
|
|
||||||
foreach my $downtime_agent (@downtime_agents) {
|
foreach my $downtime_agent (@downtime_agents) {
|
||||||
if ($downtime_agent->{'all_modules'}) {
|
|
||||||
db_do ($dbh, 'UPDATE tagente
|
|
||||||
SET quiet = 1
|
|
||||||
WHERE id_agente = ?', $downtime_agent->{'id_agent'});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
my @downtime_modules = get_db_rows($dbh, 'SELECT *
|
my @downtime_modules = get_db_rows($dbh, 'SELECT *
|
||||||
FROM tplanned_downtime_modules
|
FROM tplanned_downtime_modules
|
||||||
WHERE id_agent = ' . $downtime_agent->{'id_agent'} . '
|
WHERE id_agent = ' . $downtime_agent->{'id_agent'} . '
|
||||||
@ -2685,7 +2679,6 @@ sub pandora_planned_downtime_set_quiet_elements($$$) {
|
|||||||
$downtime_module->{'id_agent_module'});
|
$downtime_module->{'id_agent_module'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user