mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Fixed SNMP alerts. All matched alerts with same position will be trown
This commit is contained in:
parent
e4361bd860
commit
42dc2048b1
@ -3092,11 +3092,18 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
|||||||
|
|
||||||
# Get all SNMP alerts
|
# Get all SNMP alerts
|
||||||
my @snmp_alerts = get_db_rows ($dbh, 'SELECT * FROM talert_snmp ORDER BY position ASC');
|
my @snmp_alerts = get_db_rows ($dbh, 'SELECT * FROM talert_snmp ORDER BY position ASC');
|
||||||
|
my $fired_position;
|
||||||
|
|
||||||
# Find those that apply to the given SNMP trap
|
# Find those that apply to the given SNMP trap
|
||||||
foreach my $alert (@snmp_alerts) {
|
foreach my $alert (@snmp_alerts) {
|
||||||
|
|
||||||
my $alert_data = '';
|
my $alert_data = '';
|
||||||
|
|
||||||
|
# Check if one alert has been thrown. If there is another with same position, tries to throw it.
|
||||||
|
if (defined($fired_position)) {
|
||||||
|
last if ($fired_position != $alert->{'position'});
|
||||||
|
}
|
||||||
|
|
||||||
my ($times_fired, $internal_counter, $alert_type) =
|
my ($times_fired, $internal_counter, $alert_type) =
|
||||||
($alert->{'times_fired'}, $alert->{'internal_counter'}, $alert->{'alert_type'});
|
($alert->{'times_fired'}, $alert->{'internal_counter'}, $alert->{'alert_type'});
|
||||||
|
|
||||||
@ -3373,8 +3380,8 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Do not execute more than one alert per trap
|
$fired_position = $alert->{'position'};
|
||||||
last;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user