mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Fixed the function 'events_create_event' for oracle databases
This commit is contained in:
parent
163fcd1e09
commit
23b199d7cd
@ -739,8 +739,7 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
|||||||
critical_instructions, warning_instructions,
|
critical_instructions, warning_instructions,
|
||||||
unknown_instructions, source, tags, custom_data,
|
unknown_instructions, source, tags, custom_data,
|
||||||
server_id)
|
server_id)
|
||||||
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d,
|
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
||||||
ceil((sysdate - to_date(\'19700101000000\',\'YYYYMMDDHH24MISS\')) * (' . SECONDS_1DAY . ')),
|
|
||||||
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
|
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
|
||||||
"%s", "%s", %d)',
|
"%s", "%s", %d)',
|
||||||
$id_agent, $id_group, $event, $status, $id_user,
|
$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,
|
critical_instructions, warning_instructions,
|
||||||
unknown_instructions, source, tags, custom_data)
|
unknown_instructions, source, tags, custom_data)
|
||||||
VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()),
|
VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()),
|
||||||
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
|
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")',
|
||||||
"%s", "%s")',
|
|
||||||
$id_agent, $id_group, $event, $status, $id_user,
|
$id_agent, $id_group, $event, $status, $id_user,
|
||||||
$event_type, $priority, $id_agent_module, $id_aam,
|
$event_type, $priority, $id_agent_module, $id_aam,
|
||||||
$critical_instructions, $warning_instructions,
|
$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)
|
unknown_instructions, source, tags, custom_data)
|
||||||
VALUES (%d, %d, "%s", NOW(), %d,
|
VALUES (%d, %d, "%s", NOW(), %d,
|
||||||
ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s",
|
ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s",
|
||||||
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s",
|
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")',
|
||||||
"%s")',
|
|
||||||
$id_agent, $id_group, $event, $status, $id_user,
|
$id_agent, $id_group, $event, $status, $id_user,
|
||||||
$event_type, $priority, $id_agent_module, $id_aam,
|
$event_type, $priority, $id_agent_module, $id_aam,
|
||||||
$critical_instructions, $warning_instructions,
|
$critical_instructions, $warning_instructions,
|
||||||
$unknown_instructions, $source, $tags, $custom_data);
|
$unknown_instructions, $source, $tags, $custom_data);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = sprintf ('
|
$sql = sprintf ("
|
||||||
INSERT INTO ' . $table_events . ' (id_agente, id_grupo, evento,
|
INSERT INTO " . $table_events . " (id_agente, id_grupo, evento,
|
||||||
timestamp, estado, utimestamp, id_usuario,
|
timestamp, estado, utimestamp, id_usuario,
|
||||||
event_type, criticity, id_agentmodule, id_alert_am,
|
event_type, criticity, id_agentmodule, id_alert_am,
|
||||||
critical_instructions, warning_instructions,
|
critical_instructions, warning_instructions,
|
||||||
unknown_instructions, source, tags, custom_data)
|
unknown_instructions, source, tags, custom_data)
|
||||||
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d,
|
VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
||||||
ceil((sysdate - to_date(\'19700101000000\',\'YYYYMMDDHH24MISS\')) * (' . SECONDS_1DAY . ')),
|
'%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,
|
$id_agent, $id_group, $event, $status, $id_user,
|
||||||
$event_type, $priority, $id_agent_module, $id_aam,
|
$event_type, $priority, $id_agent_module, $id_aam,
|
||||||
$critical_instructions, $warning_instructions,
|
$critical_instructions, $warning_instructions,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user