2012-02-08 Vanessa Gil <vanessa.gil@artica.es>

* pandoradb.sql
	  pandoradb.postgreSQL.sql
	  pandoradb.oracle.sql
	  extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql
	  extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql
	  extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Removed 'criticity_alert'
	to tevento table.
 
	 * godmode/events/custom_events.php: Modify fields selection to
	show events.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5522 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-02-08 17:21:16 +00:00
parent 3a0bf10eb3
commit 153adfce9f
8 changed files with 91 additions and 33 deletions

View File

@ -1,3 +1,15 @@
2012-02-08 Vanessa Gil <vanessa.gil@artica.es>
* pandoradb.sql
pandoradb.postgreSQL.sql
pandoradb.oracle.sql
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql: Removed 'criticity_alert'
to tevento table.
* godmode/events/custom_events.php: Modify fields selection to
show events.
2012-02-08 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/alerts_status.php: added a check for user ACL groups in

View File

@ -101,7 +101,7 @@ ON DELETE CASCADE;
-- -----------------------------------------------------
ALTER TABLE `tevento` ADD COLUMN (`source` tinytext NOT NULL DEFAULT '',
`id_extra` tinytext NOT NULL DEFAULT '', `criticity_alert` int(4) unsigned NOT NULL default '0');
`id_extra` tinytext NOT NULL DEFAULT '');
-- -----------------------------------------------------
-- Table `talert_snmp`

View File

@ -108,7 +108,6 @@ references tplanned_downtime (id);
alter table tevento add (source VARCHAR2(100) default '' NOT NULL);
alter table tevento add (id_extra VARCHAR2(100) default '' NOT NULL);
alter table tevento add (criticity_alert NUMBER(10, 0) default 0 NOT NULL);
-- -----------------------------------------------------
-- Table `talert_snmp`
@ -141,4 +140,4 @@ CREATE TABLE tevent_filter (
group_rep NUMBER(10, 0) default 0 NOT NULL,
tag VARCHAR2(600) default '' NOT NULL,
filter_only_alert NUMBER(10, 0) default -1 NOT NULL
);
);

View File

@ -93,7 +93,6 @@ REFERENCES "tplanned_downtime"("id");
ALTER TABLE "tevento" ADD COLUMN "source" text NULL default '';
ALTER TABLE "tevento" ADD COLUMN "id_extra" text NULL default '';
ALTER TABLE "tevento" ADD COLUMN "criticity" INTEGER NOT NULL default 0;
-- -----------------------------------------------------
-- Table `talert_snmp`

View File

@ -36,7 +36,7 @@ if ($update) {
$fields_selected = (array)get_parameter('fields_selected');
if ($fields_selected[0] == '') {
$event_fields = 'evento,id_agente,estado,timestamp';
$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $event_fields);
} else {
$event_fields = implode (',', $fields_selected);
@ -51,14 +51,65 @@ if ($update) {
}
$result_selected = array();
if ($fields_selected[0]!='') {
foreach ($fields_selected as $field_selected) {
$result_selected[$field_selected] = $field_selected;
switch ($field_selected) {
case 'id_evento':
$result = __('Event id');
break;
case 'evento':
$result = __('Event name');
break;
case 'id_agente':
$result = __('Agent name');
break;
case 'id_usuario':
$result = __('User');
break;
case 'id_grupo':
$result = __('Group');
break;
case 'estado':
$result = __('Status');
break;
case 'timestamp':
$result = __('Timestamp');
break;
case 'event_type':
$result = __('Event type');
break;
case 'id_agentmodule':
$result = __('Agent module');
break;
case 'id_alert_am':
$result = __('Alert');
break;
case 'criticity':
$result = __('Criticity id');
break;
case 'user_comment':
$result = __('Comment');
break;
case 'tags':
$result = __('Tags');
break;
case 'source':
$result = __('Source');
break;
case 'id_extra':
$result = __('Extra id');
break;
}
$result_selected[$field_selected] = $result;
}
}
$event = array();
echo '<h3>'.__('Show event fields').'</h3>';
$table->width = '90%';
$table->size = array();
@ -66,42 +117,42 @@ $table->size[0] = '20%';
$table->size[2] = '20%';
$table->data = array();
$table->data[0][0] = '<h3>'.__('Show event fields').'</h3>';
$fields_available = array();
$fields_available['id_evento'] = 'id_evento';
$fields_available['evento'] = 'evento';
$fields_available['id_agente'] = 'id_agente';
$fields_available['id_usuario'] = 'id_usuario';
$fields_available['id_grupo'] = 'id_grupo';
$fields_available['estado'] = 'estado';
$fields_available['timestamp'] = 'timestamp';
$fields_available['event_type'] = 'event_type';
$fields_available['id_agentmodule'] = 'id_agentmodule';
$fields_available['id_alert_am'] = 'id_alert_am';
$fields_available['criticity'] = 'criticity';
$fields_available['user_comment'] = 'user_comment';
$fields_available['tags'] = 'tags';
$fields_available['source'] = 'source';
$fields_available['id_extra'] = 'id_extra';
$fields_available['criticity_alert'] = 'criticity_alert';
$fields_available['id_evento'] = __('Event id');
$fields_available['evento'] = __('Event name');
$fields_available['id_agente'] = __('Agent name');
$fields_available['id_usuario'] = __('User');
$fields_available['id_grupo'] = __('Group');
$fields_available['estado'] = __('Status');
$fields_available['timestamp'] = __('Timestamp');
$fields_available['event_type'] = __('Event type');
$fields_available['id_agentmodule'] = __('Agent module');
$fields_available['id_alert_am'] = __('Alert');
$fields_available['criticity'] = __('Criticity');
$fields_available['user_comment'] = __('Comment');
$fields_available['tags'] = __('Tags');
$fields_available['source'] = __('Source');
$fields_available['id_extra'] = __('Extra id');
//remove fields already selected
foreach ($fields_available as $available) {
foreach ($fields_available as $key=>$available) {
foreach ($result_selected as $selected) {
if ($selected == $available) {
unset($fields_available[$selected]);
unset($fields_available[$key]);
}
}
}
$table->data[1][0] = '<b>' . __('Fields available').'</b>';
$table->data[1][1] = html_print_select ($fields_available, 'fields_available[]', true, '', __('None'), '', true, true, false);
$table->data[1][1] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false);
$table->data[1][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
$table->data[1][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete fields to select'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
$table->data[1][3] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][4] = html_print_select($result_selected, 'fields_selected[]', true, '', __('None'), '', true, true, false);
$table->data[1][4] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false);
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields">';
@ -122,7 +173,7 @@ $(document).ready (function () {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>){
id_field = $(value).attr('value');
$("select[name='fields_selected[]']").append($("<option selected='selected'></option>").html(field_name).attr("value", field_name));
$("select[name='fields_selected[]']").append($("<option selected='selected'></option>").html(field_name).attr("value", id_field));
$("#fields_available").find("option[value='" + id_field + "']").remove();
}
});
@ -133,7 +184,7 @@ $(document).ready (function () {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>){
id_field = $(value).attr('value');
$("select[name='fields_available[]']").append($("<option></option>").val(field_name).html('<i>' + field_name + '</i>'));
$("select[name='fields_available[]']").append($("<option></option>").val(field_name).html('<i>' + id_field + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();
}
});

View File

@ -513,7 +513,6 @@ CREATE TABLE tevento (
tags CLOB,
source VARCHAR2(100) default '' NOT NULL,
id_extra VARCHAR2(100) default '' NOT NULL,
criticity_alert NUMBER(10, 0) default 0 NOT NULL,
CONSTRAINT tevento_event_type_cons CHECK (event_type IN ('unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change'))
);
CREATE INDEX tevento_id_1_idx ON tevento(id_agente, id_evento);

View File

@ -404,8 +404,7 @@ CREATE TABLE "tevento" (
"user_comment" text NOT NULL,
"tags" text NOT NULL,
"source" text NOT NULL default '',
"id_extra" text NOT NULL default '',
"criticity_alert" INTEGER NOT NULL default 0
"id_extra" text NOT NULL default ''
);
CREATE INDEX "tevento_id_1_idx" ON "tevento"("id_agente", "id_evento");
CREATE INDEX "tevento_id_2_idx" ON "tevento"("utimestamp", "id_evento");

View File

@ -449,7 +449,6 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`tags` text NOT NULL,
`source` tinytext NOT NULL default '',
`id_extra` tinytext NOT NULL default '',
`criticity_alert` int(4) unsigned NOT NULL default '0',
PRIMARY KEY (`id_evento`),
KEY `indice_1` (`id_agente`,`id_evento`),
KEY `indice_2` (`utimestamp`,`id_evento`),