diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 78157f52c1..53abe9a16c 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -739,8 +739,7 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data, server_id) - VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, - ceil((sysdate - to_date(\'19700101000000\',\'YYYYMMDDHH24MISS\')) * (' . SECONDS_1DAY . ')), + VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP, "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", %d)', $id_agent, $id_group, $event, $status, $id_user, @@ -761,8 +760,7 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data) VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()), - "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", - "%s", "%s")', + "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, @@ -777,24 +775,21 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, unknown_instructions, source, tags, custom_data) VALUES (%d, %d, "%s", NOW(), %d, ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s", - "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", - "%s")', + "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags, $custom_data); break; case "oracle": - $sql = sprintf (' - INSERT INTO ' . $table_events . ' (id_agente, id_grupo, evento, + $sql = sprintf (" + INSERT INTO " . $table_events . " (id_agente, id_grupo, evento, timestamp, estado, utimestamp, id_usuario, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data) - VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, - ceil((sysdate - to_date(\'19700101000000\',\'YYYYMMDDHH24MISS\')) * (' . SECONDS_1DAY . ')), - "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", - "%s", "%s")', + VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP, + '%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s')", $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions,