From e17e97e033378af021b432b451940a943b5ec570 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 19 Dec 2012 17:02:25 +0000 Subject: [PATCH] 2012-12-19 Sergio Martin * lib/PandoraFMS/Core.pm: Added new function to update replicated events (enterprise feature) and fix some little bugs git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7311 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/Core.pm | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 07409a09bc..a45f543b8c 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2012-12-19 Sergio Martin + + * lib/PandoraFMS/Core.pm: Added new function to update + replicated events (enterprise feature) and fix some little + bugs + 2012-12-17 Sancho Lerena * util/pandora_db.pl: Added feature to delete diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index beb04ea2c3..ada23697b2 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -2992,7 +2992,8 @@ sub pandora_validate_event ($$$) { } logger($pa_config, "Validating events for id_agentmodule #$id_agentmodule", 10); - db_do ($dbh, 'UPDATE tevento SET estado = 1 WHERE estado = 0 AND id_agentmodule = '.$id_agentmodule); + my $now = time(); + db_do ($dbh, 'UPDATE tevento SET estado = 1, ack_utimestamp = ? WHERE estado = 0 AND id_agentmodule = '.$id_agentmodule, $now); } ########################################################################## @@ -3371,7 +3372,7 @@ sub pandora_process_event_replication ($) { } if($replication_interval <= 0) { - logger($pa_config, "Replication interval configuration is not a value greater than 0. Event replication thread is will be aborted.", 1); + logger($pa_config, "Replication interval configuration is not a value greater than 0. Event replication thread will be aborted.", 1); return; } @@ -3379,7 +3380,7 @@ sub pandora_process_event_replication ($) { my $dbh_metaconsole = enterprise_hook('get_metaconsole_dbh', [$pa_config, $dbh]); if($dbh_metaconsole eq '') { - logger($pa_config, "Metaconsole DB connection error. Event replication thread is will be aborted.", 1); + logger($pa_config, "Metaconsole DB connection error. Event replication thread will be aborted.", 1); return; } @@ -3392,7 +3393,7 @@ sub pandora_process_event_replication ($) { # If the server name is not found in metaconsole setup: abort if($metaconsole_server_id == -1) { - logger($pa_config, "The server name is not configured in metaconsole. Event replication thread is will be aborted.", 1); + logger($pa_config, "The server name is not configured in metaconsole. Event replication thread will be aborted.", 1); return; } @@ -3403,7 +3404,8 @@ sub pandora_process_event_replication ($) { while(1) { # Check the queue each N seconds sleep ($replication_interval); - enterprise_hook('pandora_replicate_events',[$pa_config, $dbh, $dbh_metaconsole, $metaconsole_server_id, $replication_mode]); + enterprise_hook('pandora_replicate_update_events',[$pa_config, $dbh, $dbh_metaconsole, $metaconsole_server_id]); + enterprise_hook('pandora_replicate_copy_events',[$pa_config, $dbh, $dbh_metaconsole, $metaconsole_server_id, $replication_mode]); } }