mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge branch 'ent-6373-10641-eventos-de-going-to-normal-cada-5-minutos' into 'develop'
FF keep counters fix See merge request artica/pandorafms!3489
This commit is contained in:
commit
9f4397a760
@ -1880,29 +1880,17 @@ sub pandora_process_module ($$$$$$$$$;$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($status == $new_status) {
|
# Increase counters.
|
||||||
# If the status is equal to the previous status reset the counters.
|
$ff_critical++ if ($new_status == 1);
|
||||||
$ff_normal = 0;
|
$ff_warning++ if ($new_status == 2);
|
||||||
$ff_critical = 0;
|
$ff_normal++ if ($new_status == 0);
|
||||||
$ff_warning = 0;
|
|
||||||
} else {
|
|
||||||
# Sequential critical and normal status are needed
|
|
||||||
# if don't, reset counters.
|
|
||||||
if ($last_known_status == 1 && $new_status != 1) {
|
|
||||||
$ff_critical = 0;
|
|
||||||
} elsif ($last_known_status == 0 && $new_status != 0) {
|
|
||||||
$ff_normal = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Increase counters.
|
# Generate event for 'going_normal' only if status is previously different from
|
||||||
$ff_critical++ if ($new_status == 1);
|
# Normal.
|
||||||
$ff_warning++ if ($new_status == 2);
|
if ( ($new_status != $status && ($new_status == 0 && $ff_normal > $min_ff_event))
|
||||||
$ff_normal++ if ($new_status == 0);
|
|| ($new_status == 1 && $ff_critical > $min_ff_event)
|
||||||
}
|
|| ($new_status == 2 && $ff_warning > $min_ff_event)
|
||||||
|
) {
|
||||||
if ( ($new_status == 0 && $ff_normal >= $min_ff_event)
|
|
||||||
|| ($new_status == 1 && $ff_critical >= $min_ff_event)
|
|
||||||
|| ($new_status == 2 && $ff_warning >= $min_ff_event)) {
|
|
||||||
# Change status generate event.
|
# Change status generate event.
|
||||||
generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh);
|
generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh);
|
||||||
$status = $new_status;
|
$status = $new_status;
|
||||||
@ -1918,11 +1906,19 @@ sub pandora_process_module ($$$$$$$$$;$) {
|
|||||||
safe_mode($pa_config, $agent, $module, $new_status, $known_status, $dbh);
|
safe_mode($pa_config, $agent, $module, $new_status, $known_status, $dbh);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reset counters because change status.
|
# After launch an event, counters are reset.
|
||||||
$ff_normal = 0;
|
$ff_normal = 0;
|
||||||
$ff_critical = 0;
|
$ff_critical = 0;
|
||||||
$ff_warning = 0;
|
$ff_warning = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if($new_status == 0 && $ff_normal > $min_ff_event) {
|
||||||
|
# Reached normal FF but status have not changed, reset counters.
|
||||||
|
$ff_normal = 0;
|
||||||
|
$ff_critical = 0;
|
||||||
|
$ff_warning = 0;
|
||||||
|
}
|
||||||
|
|
||||||
# Active ff interval
|
# Active ff interval
|
||||||
if ($module->{'module_ff_interval'} != 0) {
|
if ($module->{'module_ff_interval'} != 0) {
|
||||||
$current_interval = $module->{'module_ff_interval'};
|
$current_interval = $module->{'module_ff_interval'};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user