2013-02-05 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/Core.pm: Set ack utimestamp when create
	a event in validated status (normal status)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7580 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-02-05 08:39:25 +00:00
parent 53f63357f6
commit 31ea02f4ad
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2013-02-05 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm: Set ack utimestamp when create
a event in validated status (normal status)
2013-02-04 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm: Fix a broken query of my last

View File

@ -2386,12 +2386,15 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) {
$warning_instructions = '' unless defined ($warning_instructions);
$unknown_instructions = '' unless defined ($unknown_instructions);
# If the event is created with validated status, assign ack_utimestamp
my $ack_utimestamp = $event_status == 1 ? time() : 0;
my $utimestamp = time ();
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime ($utimestamp));
$id_agentmodule = 0 unless defined ($id_agentmodule);
db_do ($dbh, 'INSERT INTO tevento (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions);
db_do ($dbh, 'INSERT INTO tevento (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp);
}
##########################################################################
@ -3342,7 +3345,6 @@ sub pandora_process_event_replication ($) {
while(1) {
# Check the queue each N seconds
sleep ($replication_interval);
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]);
}
}