2014-01-27 Sergio Martin <sergio.martin@artica.es>

* include/functions_events.php: Fixed metaconsole event
	colors for incident #526



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9376 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2014-01-27 11:45:06 +00:00
parent 75543f9149
commit 3edba98c42
2 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2014-01-27 Sergio Martin <sergio.martin@artica.es>
* include/functions_events.php: Fixed metaconsole event
colors for incident #526
2014-01-27 Sergio Martin <sergio.martin@artica.es>
* include/functions_alerts.php: Fixed the group of the

View File

@ -132,17 +132,16 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids,
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT id_agente FROM tevento WHERE id_evento = MAX(te.id_evento)) id_agente,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM tevento WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
(SELECT owner_user FROM $table WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM $table WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT id_agente FROM $table WHERE id_evento = MAX(te.id_evento)) id_agente,
(SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . "
ORDER BY timestamp_rep DESC LIMIT " . $offset . "," . $pagination;
}
break;
case "postgresql":
if ($total) {
@ -156,11 +155,11 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
array_to_string(array_agg(DISTINCT id_evento), ',') AS similar_ids,
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT id_agente FROM tevento WHERE id_evento = MAX(te.id_evento)) id_agente,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM tevento WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
(SELECT owner_user FROM $table WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM $table WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT id_agente FROM $table WHERE id_evento = MAX(te.id_evento)) id_agente,
(SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule, id_evento, id_agente, id_usuario, id_grupo, estado, timestamp, utimestamp, event_type, id_alert_am, criticity, user_comment, tags, source, id_extra" . $groupby_extra . "
@ -186,9 +185,11 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
LISTAGG(user_comment, '') AS user_comment, MAX(utimestamp) AS timestamp_rep,
LISTAGG(id_evento, '') AS similar_ids,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity
(SELECT owner_user FROM $table WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM $table WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT id_agente FROM $table WHERE id_evento = MAX(te.id_evento)) id_agente,
(SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity,
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, to_char(evento), id_agentmodule" . $groupby_extra . ") b