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:
parent
00038f7ebd
commit
f64cd6d8b7
|
@ -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>
|
2013-03-05 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/SNMPServer.pm: Added an option to start the snmptrapd
|
* lib/PandoraFMS/SNMPServer.pm: Added an option to start the snmptrapd
|
||||||
|
|
|
@ -564,8 +564,8 @@ sub pandora_process_alert ($$$$$$$$;$) {
|
||||||
last_fired = ?, internal_counter = ? ' . $new_interval . ' WHERE id = ?',
|
last_fired = ?, internal_counter = ? ' . $new_interval . ' WHERE id = ?',
|
||||||
$alert->{'times_fired'}, $utimestamp, $alert->{'internal_counter'}, $id);
|
$alert->{'times_fired'}, $utimestamp, $alert->{'internal_counter'}, $id);
|
||||||
|
|
||||||
# Update fired alert count
|
# Update fired alert count only in first fired time
|
||||||
if (defined ($agent)) {
|
if (defined ($agent) && $alert->{'times_fired'} == 1) {
|
||||||
db_do ($dbh, 'UPDATE tagente SET fired_count=fired_count+1 WHERE id_agente=?', $agent->{'id_agente'});
|
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)
|
AND ((fires_min = 0 AND fires_max = 0)
|
||||||
OR (? >= fires_min AND ? <= fires_max))',
|
OR (? >= fires_min AND ? <= fires_max))',
|
||||||
$alert->{'id'}, $alert->{'times_fired'}, $alert->{'times_fired'});
|
$alert->{'id'}, $alert->{'times_fired'}, $alert->{'times_fired'});
|
||||||
|
|
||||||
# Get default action
|
# Get default action
|
||||||
if ($#actions < 0) {
|
if ($#actions < 0) {
|
||||||
@actions = get_db_rows ($dbh, 'SELECT * FROM talert_actions, talert_commands
|
@actions = get_db_rows ($dbh, 'SELECT * FROM talert_actions, talert_commands
|
||||||
|
|
Loading…
Reference in New Issue