2013-03-06 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/Core.pm: Change the update count of fired alerts 
	condition to increase the count only when a alert is fired first time
	to avoid broke counts



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7792 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-03-06 11:50:51 +00:00
parent 00038f7ebd
commit f64cd6d8b7
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-03-06 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm: Change the update count of fired alerts
condition to increase the count only when a alert is fired first time
to avoid broke counts
2013-03-05 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm: Added an option to start the snmptrapd

View File

@ -564,8 +564,8 @@ sub pandora_process_alert ($$$$$$$$;$) {
last_fired = ?, internal_counter = ? ' . $new_interval . ' WHERE id = ?',
$alert->{'times_fired'}, $utimestamp, $alert->{'internal_counter'}, $id);
# Update fired alert count
if (defined ($agent)) {
# Update fired alert count only in first fired time
if (defined ($agent) && $alert->{'times_fired'} == 1) {
db_do ($dbh, 'UPDATE tagente SET fired_count=fired_count+1 WHERE id_agente=?', $agent->{'id_agente'});
}
@ -633,6 +633,7 @@ sub pandora_execute_alert ($$$$$$$$;$) {
AND ((fires_min = 0 AND fires_max = 0)
OR (? >= fires_min AND ? <= fires_max))',
$alert->{'id'}, $alert->{'times_fired'}, $alert->{'times_fired'});
# Get default action
if ($#actions < 0) {
@actions = get_db_rows ($dbh, 'SELECT * FROM talert_actions, talert_commands