mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-5289-9247-Group-Alert-Report-bug' into 'develop'
fix bug in group alert report data visualization See merge request artica/pandorafms!3031
This commit is contained in:
commit
0e9e59efbb
@ -3679,7 +3679,7 @@ function agents_get_network_interfaces_array(
|
|||||||
/**
|
/**
|
||||||
* reporting alert get fired
|
* reporting alert get fired
|
||||||
*/
|
*/
|
||||||
function reporting_alert_get_fired($id_agent_module, $id_alert_template_module, $period, $datetime)
|
function reporting_alert_get_fired($id_agent_module, $id_alert_template_module, $period, $datetime, $return_empty=true)
|
||||||
{
|
{
|
||||||
$fired = [];
|
$fired = [];
|
||||||
$firedTimes = get_module_alert_fired(
|
$firedTimes = get_module_alert_fired(
|
||||||
@ -3709,7 +3709,11 @@ function reporting_alert_get_fired($id_agent_module, $id_alert_template_module,
|
|||||||
if ($fireTime['utimestamp'] > $datelimit && $fireTime['utimestamp'] <= $datetime) {
|
if ($fireTime['utimestamp'] > $datelimit && $fireTime['utimestamp'] <= $datetime) {
|
||||||
$fired[] = $fireTime['timestamp'];
|
$fired[] = $fireTime['timestamp'];
|
||||||
} else {
|
} else {
|
||||||
$fired[] = $empty;
|
if ($return_empty === true) {
|
||||||
|
$fired[] = $empty;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3821,10 +3825,15 @@ function reporting_alert_report_group($report, $content)
|
|||||||
foreach ($actions['custom'] as $action) {
|
foreach ($actions['custom'] as $action) {
|
||||||
$data_action[$naction]['name'] = $action['name'];
|
$data_action[$naction]['name'] = $action['name'];
|
||||||
$fired = $action['fired'];
|
$fired = $action['fired'];
|
||||||
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) {
|
|
||||||
$data_action[$naction]['fired'] = '----------------------------';
|
if ($fired == 0) {
|
||||||
} else {
|
$data_action[$naction]['fired'] = __('Not triggered');
|
||||||
$data_action[$naction]['fired'] = $fired;
|
} else if ($fired > 0) {
|
||||||
|
if ($fired > $datelimit && $fired < $datetime) {
|
||||||
|
$data_action[$naction]['fired'] = $fired;
|
||||||
|
} else {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$naction++;
|
$naction++;
|
||||||
@ -3833,10 +3842,15 @@ function reporting_alert_report_group($report, $content)
|
|||||||
foreach ($actions['default'] as $action) {
|
foreach ($actions['default'] as $action) {
|
||||||
$data_action[$naction]['name'] = $action['name'];
|
$data_action[$naction]['name'] = $action['name'];
|
||||||
$fired = $action['fired'];
|
$fired = $action['fired'];
|
||||||
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) {
|
|
||||||
$data_action[$naction]['fired'] = '----------------------------';
|
if ($fired == 0) {
|
||||||
} else {
|
$data_action[$naction]['fired'] = __('Not triggered');
|
||||||
$data_action[$naction]['fired'] = $fired;
|
} else if ($fired > 0) {
|
||||||
|
if ($fired > $datelimit && $fired < $datetime) {
|
||||||
|
$data_action[$naction]['fired'] = $fired;
|
||||||
|
} else {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$naction++;
|
$naction++;
|
||||||
@ -3845,10 +3859,15 @@ function reporting_alert_report_group($report, $content)
|
|||||||
foreach ($actions['unavailable'] as $action) {
|
foreach ($actions['unavailable'] as $action) {
|
||||||
$data_action[$naction]['name'] = $action['name'];
|
$data_action[$naction]['name'] = $action['name'];
|
||||||
$fired = $action['fired'];
|
$fired = $action['fired'];
|
||||||
if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)) {
|
|
||||||
$data_action[$naction]['fired'] = '----------------------------';
|
if ($fired == 0) {
|
||||||
} else {
|
$data_action[$naction]['fired'] = __('Not triggered');
|
||||||
$data_action[$naction]['fired'] = $fired;
|
} else if ($fired > 0) {
|
||||||
|
if ($fired > $datelimit && $fired < $datetime) {
|
||||||
|
$data_action[$naction]['fired'] = $fired;
|
||||||
|
} else {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$naction++;
|
$naction++;
|
||||||
@ -3862,7 +3881,8 @@ function reporting_alert_report_group($report, $content)
|
|||||||
$agent_module['id_agent_module'],
|
$agent_module['id_agent_module'],
|
||||||
$actions['id'],
|
$actions['id'],
|
||||||
(int) $content['period'],
|
(int) $content['period'],
|
||||||
(int) $report['datetime']
|
(int) $report['datetime'],
|
||||||
|
false
|
||||||
);
|
);
|
||||||
$module_actions['actions'] = $data_action;
|
$module_actions['actions'] = $data_action;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user