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:
Ramon Novoa 2009-01-15 17:19:24 +00:00
parent e5aa8d34e7
commit 586f857ab2
2 changed files with 14 additions and 0 deletions

View File

@ -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>
* lib/PandoraFMS/DB.pm: Partially rewrote the alert core to support the

View File

@ -161,6 +161,7 @@ sub pandora_generate_alerts (%$$$$$$$$) {
## 2 Do not execute the alert, but increment its internal counter.
## 3 Cease the alert.
## 4 Recover the alert.
## 5 Reset internal counter (alert not fired, interval elapsed).
##########################################################################
sub pandora_evaluate_alert (%$%$$$) {
@ -211,6 +212,8 @@ sub pandora_evaluate_alert (%$%$$$) {
if ($alert_data->{'recovery_notify'} == 1) {
$status = 4;
}
} elsif (Date_Cmp ($date, $limit_date) >= 0) {
$status = 5;
}
# Check for valid data
@ -308,6 +311,13 @@ sub pandora_process_alert (%$$$$$%$$) {
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
my $date_db = &UnixDate("today","%s");