Merge branch '2248-5730-Añadir-elementos-a-la-vista-de-eventos3' into 'develop'
fix bug in metaconsole view events See merge request artica/pandorafms!1638
This commit is contained in:
commit
6bd1768335
|
@ -71,7 +71,7 @@ if ($fields_selected[0]!='') {
|
||||||
$result = __('Event Name');
|
$result = __('Event Name');
|
||||||
break;
|
break;
|
||||||
case 'id_agente':
|
case 'id_agente':
|
||||||
$result = __('Agent name');
|
$result = __('Agent Name');
|
||||||
break;
|
break;
|
||||||
case 'id_usuario':
|
case 'id_usuario':
|
||||||
$result = __('User');
|
$result = __('User');
|
||||||
|
@ -124,9 +124,10 @@ if ($fields_selected[0]!='') {
|
||||||
case 'data':
|
case 'data':
|
||||||
$result = __('Data');
|
$result = __('Data');
|
||||||
break;
|
break;
|
||||||
case 'module_status':
|
case 'module_status':
|
||||||
$result = __('Module Status');
|
$result = __('Module Status');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
$result_selected[$field_selected] = $result;
|
$result_selected[$field_selected] = $result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -723,15 +723,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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,
|
||||||
server_id, id_extra)
|
server_id, id_extra, data, module_status)
|
||||||
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", %d, "%s")',
|
"%s", "%s", %d, "%s", %d, %d)',
|
||||||
$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,
|
||||||
$server_id, $id_extra);
|
$server_id, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = sprintf ('
|
$sql = sprintf ('
|
||||||
|
@ -740,16 +740,16 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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,
|
||||||
server_id, id_extra)
|
server_id, id_extra, data, module_status)
|
||||||
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", %d, "%s")',
|
"%s", %d, "%s", %d, %d)',
|
||||||
$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,
|
||||||
$server_id, $id_extra);
|
$server_id, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = sprintf ('
|
$sql = sprintf ('
|
||||||
|
@ -758,15 +758,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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,
|
||||||
server_id, id_extra)
|
server_id, id_extra, data, module_status)
|
||||||
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
||||||
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
|
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
|
||||||
"%s", "%s", %d, "%s")',
|
"%s", "%s", %d, "%s", %d, %d)',
|
||||||
$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,
|
||||||
$server_id, $id_extra);
|
$server_id, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -778,13 +778,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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, id_extra)
|
unknown_instructions, source, tags, custom_data, id_extra, data, module_status)
|
||||||
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", "%s")',
|
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s", %d, %d)',
|
||||||
$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, $id_extra);
|
$unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = sprintf ('
|
$sql = sprintf ('
|
||||||
|
@ -792,14 +792,14 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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, id_extra)
|
unknown_instructions, source, tags, custom_data, id_extra, data, module_status)
|
||||||
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", "%s")',
|
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s", %d, %d)',
|
||||||
$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, $id_extra);
|
$unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = sprintf ("
|
$sql = sprintf ("
|
||||||
|
@ -807,13 +807,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
|
||||||
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, id_extra)
|
unknown_instructions, source, tags, custom_data, id_extra, data, module_status)
|
||||||
VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
|
||||||
'%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
|
'%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)",
|
||||||
$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, $id_extra);
|
$unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3705,6 +3705,16 @@ function events_list_events_grouped_agents($sql) {
|
||||||
$table->align[$i] = 'left';
|
$table->align[$i] = 'left';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if (in_array('data', $show_fields)) {
|
||||||
|
$table->head[$i] = __('Data');
|
||||||
|
$table->align[$i] = 'left';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
if (in_array('module_status', $show_fields)) {
|
||||||
|
$table->head[$i] = __('Module status');
|
||||||
|
$table->align[$i] = 'left';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
if ($i != 0 && $allow_action) {
|
if ($i != 0 && $allow_action) {
|
||||||
$table->head[$i] = __('Action');
|
$table->head[$i] = __('Action');
|
||||||
$table->align[$i] = 'left';
|
$table->align[$i] = 'left';
|
||||||
|
@ -4104,6 +4114,20 @@ function events_list_events_grouped_agents($sql) {
|
||||||
$table->cellclass[count($table->data)][$i] = $myclass;
|
$table->cellclass[count($table->data)][$i] = $myclass;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if (in_array('data',$show_fields)) {
|
||||||
|
$data[$i] = $event["data"];
|
||||||
|
if($data[$i] %1 == 0)
|
||||||
|
$data[$i]= number_format($data[$i], 0);
|
||||||
|
else
|
||||||
|
$data[$i]= number_format($data[$i], 2);
|
||||||
|
$table->cellclass[count($table->data)][$i] = $myclass;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
if (in_array('module_status',$show_fields)) {
|
||||||
|
$data[$i] = modules_get_modules_status ($event["module_status"]);
|
||||||
|
$table->cellclass[count($table->data)][$i] = $myclass;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
if ($i != 0 && $allow_action) {
|
if ($i != 0 && $allow_action) {
|
||||||
//Actions
|
//Actions
|
||||||
|
|
Loading…
Reference in New Issue