mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2009-01-15 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DB.pm: min_alerts now works as expected. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1348 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e5aa8d34e7
commit
586f857ab2
@ -1,3 +1,7 @@
|
|||||||
|
2009-01-15 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/DB.pm: min_alerts now works as expected.
|
||||||
|
|
||||||
2009-01-15 Ramon Novoa <rnovoa@artica.es>
|
2009-01-15 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/DB.pm: Partially rewrote the alert core to support the
|
* lib/PandoraFMS/DB.pm: Partially rewrote the alert core to support the
|
||||||
|
@ -161,6 +161,7 @@ sub pandora_generate_alerts (%$$$$$$$$) {
|
|||||||
## 2 Do not execute the alert, but increment its internal counter.
|
## 2 Do not execute the alert, but increment its internal counter.
|
||||||
## 3 Cease the alert.
|
## 3 Cease the alert.
|
||||||
## 4 Recover the alert.
|
## 4 Recover the alert.
|
||||||
|
## 5 Reset internal counter (alert not fired, interval elapsed).
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
sub pandora_evaluate_alert (%$%$$$) {
|
sub pandora_evaluate_alert (%$%$$$) {
|
||||||
@ -211,6 +212,8 @@ sub pandora_evaluate_alert (%$%$$$) {
|
|||||||
if ($alert_data->{'recovery_notify'} == 1) {
|
if ($alert_data->{'recovery_notify'} == 1) {
|
||||||
$status = 4;
|
$status = 4;
|
||||||
}
|
}
|
||||||
|
} elsif (Date_Cmp ($date, $limit_date) >= 0) {
|
||||||
|
$status = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check for valid data
|
# Check for valid data
|
||||||
@ -308,6 +311,13 @@ sub pandora_process_alert (%$$$$$%$$) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Reset internal counter
|
||||||
|
if ($rc == 5) {
|
||||||
|
db_do("UPDATE talert_template_modules SET internal_counter = 0 WHERE id = " .
|
||||||
|
$alert_data->{'id_template_module'}, $dbh);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
# Get current date
|
# Get current date
|
||||||
my $date_db = &UnixDate("today","%s");
|
my $date_db = &UnixDate("today","%s");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user