2013-01-11 Sergio Martin <sergio.martin@artica.es>

* pandoradb_data.sql
	include/functions_ui.php
	include/functions.php
	include/functions_agents.php
	pandoradb.sql
	pandoradb.postgreSQL.sql
	pandoradb.oracle.sql
	operation/agentes/alerts_status.php
	pandoradb.data.postgreSQL.sql
	pandoradb.data.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
	godmode/agentes/module_manager_editor.php
	godmode/users/profile_list.php
	godmode/users/configure_profile.php
	godmode/modules/manage_network_components_form.php
	godmode/modules/manage_network_components_form_common.php
	godmode/modules/manage_network_components.php: Clean deprecated compound
	alerts code, added new Agent disable flag into profiles, clean wizard mode
	combo from components in normal console (not metaconsole)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7437 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-01-11 13:18:27 +00:00
parent eafeeea7e8
commit e623e950d8
20 changed files with 160 additions and 235 deletions

View File

@ -1,3 +1,27 @@
2013-01-11 Sergio Martin <sergio.martin@artica.es>
* pandoradb_data.sql
include/functions_ui.php
include/functions.php
include/functions_agents.php
pandoradb.sql
pandoradb.postgreSQL.sql
pandoradb.oracle.sql
operation/agentes/alerts_status.php
pandoradb.data.postgreSQL.sql
pandoradb.data.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
godmode/agentes/module_manager_editor.php
godmode/users/profile_list.php
godmode/users/configure_profile.php
godmode/modules/manage_network_components_form.php
godmode/modules/manage_network_components_form_common.php
godmode/modules/manage_network_components.php: Clean deprecated compound
alerts code, added new Agent disable flag into profiles, clean wizard mode
combo from components in normal console (not metaconsole)
2013-01-11 Dario Rodriguez <dario.rodriguez@artica.es>
* pandoradb.data.postgreSQL.sql

View File

@ -175,8 +175,7 @@ UPDATE `tagente_modulo` SET max_retries=plugin_pass WHERE id_modulo=7;
------------------------------------------------------------------------
ALTER TABLE `tnetwork_component` CHANGE COLUMN `post_process` `post_process` double(18,5) default NULL;
ALTER TABLE `tnetwork_component` ADD COLUMN `unit` TEXT NOT NULL AFTER `post_process`;
ALTER TABLE `tnetwork_component` ADD COLUMN `wizard_level` enum('basic','advanced','custom','nowizard') default 'nowizard';
ALTER TABLE `tnetwork_component` ADD COLUMN `only_metaconsole` tinyint(1) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `wizard_level` enum('basic','advanced','nowizard') default 'nowizard';
ALTER TABLE `tnetwork_component` ADD COLUMN `macros` text;
ALTER TABLE `tnetwork_component` ADD COLUMN `critical_instructions` TEXT NOT NULL default '';
ALTER TABLE `tnetwork_component` ADD COLUMN `warning_instructions` TEXT NOT NULL default '';
@ -416,12 +415,13 @@ ALTER TABLE `tperfil` ADD COLUMN `report_management` tinyint(3) NOT NULL default
ALTER TABLE `tperfil` ADD COLUMN `event_view` tinyint(3) NOT NULL default '0';
ALTER TABLE `tperfil` ADD COLUMN `event_edit` tinyint(3) NOT NULL default '0';
ALTER TABLE `tperfil` ADD COLUMN `event_management` tinyint(3) NOT NULL default '0';
ALTER TABLE `tperfil` ADD COLUMN `agent_disable` tinyint(3) NOT NULL default '0';
UPDATE tperfil SET `report_view`= 1, `event_view`= 1 WHERE id_perfil = 1 AND name = "Operator&#x20;&#40;Read&#41;";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `event_view`= 1, `event_edit`= 1 WHERE id_perfil = 2 AND name = "Operator&#x20;&#40;Write&#41;";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1 WHERE id_perfil = 3 AND name = "Chief&#x20;Operator";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1, `event_management`= 1 WHERE id_perfil = 4 AND name = "Group&#x20;coordinator";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1, `event_management`= 1 WHERE id_perfil = 5 AND name = "Pandora&#x20;Administrator";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1, `agent_disable`= 1 WHERE id_perfil = 3 AND name = "Chief&#x20;Operator";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1, `event_management`= 1, `agent_disable`= 1 WHERE id_perfil = 4 AND name = "Group&#x20;coordinator";
UPDATE tperfil SET `report_view`= 1, `report_edit`= 1, `report_management`= 1, `event_view`= 1, `event_edit`= 1, `event_management`= 1, `agent_disable`= 1 WHERE id_perfil = 5 AND name = "Pandora&#x20;Administrator";
-- ---------------------------------------------------------------------
-- Table `tusuario_perfil`
@ -431,4 +431,4 @@ ALTER TABLE `tusuario_perfil` ADD COLUMN `tags` TEXT NOT NULL;
-- ---------------------------------------------------------------------
-- Table `ttag`
-- ---------------------------------------------------------------------
ALTER TABLE `ttag` ADD COLUMN `email` text NULL;
ALTER TABLE `ttag` ADD COLUMN `email` text NULL;

View File

@ -301,8 +301,7 @@ WHERE token='prominent_time';
-- Table tnetwork_component
-- -----------------------------------------------------
ALTER TABLE tnetwork_component ADD (wizard_level VARCHAR2(100) default 'nowizard' NOT NULL);
ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
ALTER TABLE tnetwork_component ADD (only_metaconsole NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','nowizard'));
ALTER TABLE tnetwork_component ADD (macros CLOB default '');
@ -310,7 +309,7 @@ ALTER TABLE tnetwork_component ADD (macros CLOB default '');
-- Table tagente_modulo
-- -----------------------------------------------------
ALTER TABLE tagente_modulo ADD (wizard_level VARCHAR2(100) default 'nowizard' NOT NULL);
ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','nowizard'));
ALTER TABLE tagente_modulo ADD (macros CLOB default '');
ALTER TABLE tagente_modulo ADD (quiet NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tagente_modulo ADD (cron_interval VARCHAR2(100) DEFAULT '');
@ -446,12 +445,13 @@ ALTER TABLE tperfil ADD (report_management NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tperfil ADD (event_view NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tperfil ADD (event_edit NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tperfil ADD (event_management NUMBER(5, 0) default 0 NOT NULL);
ALTER TABLE tperfil ADD (agent_disable NUMBER(5, 0) default 0 NOT NULL);
UPDATE tperfil SET report_view= 1, event_view= 1 WHERE id_perfil = 1 AND name = 'Operator&#x20;&#40;Read&#41;';
UPDATE tperfil SET report_view= 1, report_edit= 1, event_view= 1, event_edit= 1 WHERE id_perfil = 2 AND name = 'Operator&#x20;&#40;Write&#41;';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1 WHERE id_perfil = 3 AND name = 'Chief&#x20;Operator';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1, event_management= 1 WHERE id_perfil = 4 AND name = 'Group&#x20;coordinator';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1, event_management= 1 WHERE id_perfil = 5 AND name = 'Pandora&#x20;Administrator';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1, agent_disable= 1 WHERE id_perfil = 3 AND name = 'Chief&#x20;Operator';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1, event_management= 1, agent_disable= 1 WHERE id_perfil = 4 AND name = 'Group&#x20;coordinator';
UPDATE tperfil SET report_view= 1, report_edit= 1, report_management= 1, event_view= 1, event_edit= 1, event_management= 1, agent_disable= 1 WHERE id_perfil = 5 AND name = 'Pandora&#x20;Administrator';
-- ---------------------------------------------------------------------
-- Table `tusuario_perfil`
@ -461,4 +461,4 @@ ALTER TABLE tusuario_perfil ADD (tags CLOB NOT NULL default '');
-- ---------------------------------------------------------------------
-- Table `ttag`
-- ---------------------------------------------------------------------
ALTER TABLE ttag ADD (email CLOB NULL);
ALTER TABLE ttag ADD (email CLOB NULL);

View File

@ -316,9 +316,8 @@ WHERE "token"='prominent_time';
-- Table "tnetwork_component"
-- -----------------------------------------------------
CREATE TYPE type_tnetwork_component_wizard_level AS ENUM ('basic','advanced','custom','nowizard');
CREATE TYPE type_tnetwork_component_wizard_level AS ENUM ('basic','advanced','nowizard');
ALTER TABLE "tnetwork_component" ADD COLUMN "wizard_level" type_tnetwork_component_wizard_level default 'nowizard';
ALTER TABLE "tnetwork_component" ADD COLUMN "only_metaconsole" INTEGER default '0';
ALTER TABLE "tnetwork_component" ADD COLUMN "macros" TEXT default '';
-- -----------------------------------------------------
@ -437,12 +436,13 @@ ALTER TABLE "tperfil" ADD COLUMN "report_management" SMALLINT NOT NULL default 0
ALTER TABLE "tperfil" ADD COLUMN "event_view" SMALLINT NOT NULL default 0;
ALTER TABLE "tperfil" ADD COLUMN "event_edit" SMALLINT NOT NULL default 0;
ALTER TABLE "tperfil" ADD COLUMN "event_management" SMALLINT NOT NULL default 0;
ALTER TABLE "tperfil" ADD COLUMN "agent_disable" SMALLINT NOT NULL default 0;
UPDATE tperfil SET "report_view"= 1, "event_view"= 1 WHERE id_perfil = 1 AND name = 'Operator&#x20;&#40;Read&#41;';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "event_view"= 1, "event_edit"= 1 WHERE id_perfil = 2 AND name = 'Operator&#x20;&#40;Write&#41;';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1 WHERE id_perfil = 3 AND name = 'Chief&#x20;Operator';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1, "event_management"= 1 WHERE id_perfil = 4 AND name = 'Group&#x20;coordinator';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1, "event_management"= 1 WHERE id_perfil = 5 AND name = 'Pandora&#x20;Administrator';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1, "agent_disable"= 1 WHERE id_perfil = 3 AND name = 'Chief&#x20;Operator';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1, "event_management"= 1, "agent_disable"= 1 WHERE id_perfil = 4 AND name = 'Group&#x20;coordinator';
UPDATE tperfil SET "report_view"= 1, "report_edit"= 1, "report_management"= 1, "event_view"= 1, "event_edit"= 1, "event_management"= 1, "agent_disable"= 1 WHERE id_perfil = 5 AND name = 'Pandora&#x20;Administrator';
-- ---------------------------------------------------------------------
-- Table `tusuario_perfil`

View File

@ -40,8 +40,7 @@ if (is_ajax ()) {
$components = network_components_get_network_components ($id_module_component,
array ('id_group' => $id_module_group,
'only_metaconsole' => 0,
'order' => 'name ASC'),
'order' => 'name ASC'),
array ('id_nc', 'name'));
echo json_encode ($components);
@ -53,8 +52,7 @@ if (is_ajax ()) {
$id_module_group = (int) get_parameter ('id_module_component_group');
$localComponents = local_components_get_local_components(
array('id_network_component_group' => $id_module_group,
'only_metaconsole' => 0),
array('id_network_component_group' => $id_module_group),
array('id', 'name'));
echo json_encode($localComponents);

View File

@ -84,7 +84,6 @@ $post_process = (float) get_parameter('post_process');
$unit = (string) get_parameter('unit');
$id = (int) get_parameter ('id');
$wizard_level = get_parameter ('wizard_level');
$only_metaconsole = (int) get_parameter ('only_metaconsole');
$critical_instructions = (string) get_parameter('critical_instructions');
$warning_instructions = (string) get_parameter('warning_instructions');
$unknown_instructions = (string) get_parameter('unknown_instructions');
@ -188,7 +187,6 @@ if ($create_component) {
'post_process' => $post_process,
'unit' => $unit,
'wizard_level' => $wizard_level,
'only_metaconsole' => $only_metaconsole,
'macros' => $macros,
'critical_instructions' => $critical_instructions,
'warning_instructions' => $warning_instructions,
@ -269,7 +267,6 @@ if ($update_component) {
'post_process' => $post_process,
'unit' => $unit,
'wizard_level' => $wizard_level,
'only_metaconsole' => $only_metaconsole,
'macros' => $macros,
'critical_instructions' => $critical_instructions,
'warning_instructions' => $warning_instructions,

View File

@ -110,7 +110,6 @@ if (isset ($id)) {
$post_process = $component["post_process"];
$unit = $component["unit"];
$wizard_level = $component["wizard_level"];
$only_metaconsole = $component["only_metaconsole"];
$critical_instructions = $component["critical_instructions"];
$warning_instructions = $component["warning_instructions"];
$unknown_instructions = $component["unknown_instructions"];
@ -158,7 +157,6 @@ if (isset ($id)) {
$post_process = 0;
$unit = '';
$wizard_level = 'nowizard';
$only_metaconsole = 0;
$critical_instructions = '';
$warning_instructions = '';
$unknown_instructions = '';

View File

@ -51,15 +51,17 @@ $table->data = array ();
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text ('name', $name, '', 55, 255, true);
if(enterprise_installed()) {
$table->data[0][2] = __('Wizard level');
$wizard_levels = array('nowizard' => __('No wizard'),
'basic' => __('Basic'),
'advanced' => __('Advanced'),
//'custom' => __('Custom'),
);
$table->data[0][3] = html_print_select($wizard_levels,'wizard_level',$wizard_level,'','',-1,true, false, false);
$table->data[0][3] .= html_print_checkbox('only_metaconsole',1,(int)$only_metaconsole,true).__('Only for metaconsole');
if(enterprise_installed()) {
if(defined('METACONSOLE')) {
$table->data[0][2] = __('Wizard level');
$wizard_levels = array('basic' => __('Basic'),
'advanced' => __('Advanced'));
$table->data[0][3] = html_print_select($wizard_levels,'wizard_level',$wizard_level,'','',-1,true, false, false);
}
else {
$table->data[0][2] = '';
$table->data[0][3] = html_print_input_hidden('wizard_level', 'nowizard', true);
}
}
$table->data[1][0] = __('Type') . ' ' . ui_print_help_icon ('module_type', true, ui_get_full_url(false, false, false, false));

View File

@ -78,6 +78,7 @@ if ($id_profile || $new_profile) {
$event_view = 0;
$event_edit = 0;
$event_management = 0;
$agent_disable = 0;
$page_title = __('Create profile');
}
@ -114,6 +115,7 @@ if ($id_profile || $new_profile) {
$event_view = (bool) $profile["event_view"];
$event_edit = (bool) $profile["event_edit"];
$event_management = (bool) $profile["event_management"];
$agent_disable = (bool) $profile["agent_disable"];
$id_audit = db_pandora_audit("User management",
"Edit profile ". $name);
@ -126,6 +128,7 @@ if ($id_profile || $new_profile) {
' Report view: ' . $report_view . ' Report edit: ' . $report_edit .
' Report management: ' . $report_management . ' Event view: ' . $event_view .
' Event edit: ' . $event_edit . ' Event management: ' . $event_management .
' Agent disable: ' . $agent_disable .
' Pandora Management: ' . $pandora_management;
enterprise_hook('audit_pandora_enterprise', array($id_audit, $info));
@ -152,28 +155,30 @@ if ($id_profile || $new_profile) {
$table->data[4][1] = html_print_checkbox ('agent_view', 1, $agent_view, true);
$table->data[5][0] = __('Edit agents');
$table->data[5][1] = html_print_checkbox ('agent_edit', 1, $agent_edit, true);
$table->data[6][0] = __('Edit alerts');
$table->data[6][1] = html_print_checkbox ('alert_edit', 1, $alert_edit, true);
$table->data[7][0] = __('Manage users');
$table->data[7][1] = html_print_checkbox ('user_management', 1, $user_management, true);
$table->data[8][0] = __('Manage Database');
$table->data[8][1] = html_print_checkbox ('db_management', 1, $db_management, true);
$table->data[9][0] = __('Manage alerts');
$table->data[9][1] = html_print_checkbox ('alert_management', 1, $alert_management, true);
$table->data[10][0] = __('View reports');
$table->data[10][1] = html_print_checkbox ('report_view', 1, $report_view, true);
$table->data[11][0] = __('Edit reports');
$table->data[11][1] = html_print_checkbox ('report_edit', 1, $report_edit, true);
$table->data[12][0] = __('Manage reports');
$table->data[12][1] = html_print_checkbox ('report_management', 1, $report_management, true);
$table->data[13][0] = __('View events');
$table->data[13][1] = html_print_checkbox ('event_view', 1, $event_view, true);
$table->data[14][0] = __('Edit events');
$table->data[14][1] = html_print_checkbox ('event_edit', 1, $event_edit, true);
$table->data[15][0] = __('Manage events');
$table->data[15][1] = html_print_checkbox ('event_management', 1, $event_management, true);
$table->data[16][0] = __('Pandora management');
$table->data[16][1] = html_print_checkbox ('pandora_management', 1, $pandora_management, true);
$table->data[6][0] = __('Disable agents');
$table->data[6][1] = html_print_checkbox ('agent_disable', 1, $agent_disable, true);
$table->data[7][0] = __('Edit alerts');
$table->data[7][1] = html_print_checkbox ('alert_edit', 1, $alert_edit, true);
$table->data[8][0] = __('Manage users');
$table->data[8][1] = html_print_checkbox ('user_management', 1, $user_management, true);
$table->data[9][0] = __('Manage Database');
$table->data[9][1] = html_print_checkbox ('db_management', 1, $db_management, true);
$table->data[10][0] = __('Manage alerts');
$table->data[10][1] = html_print_checkbox ('alert_management', 1, $alert_management, true);
$table->data[11][0] = __('View reports');
$table->data[11][1] = html_print_checkbox ('report_view', 1, $report_view, true);
$table->data[12][0] = __('Edit reports');
$table->data[12][1] = html_print_checkbox ('report_edit', 1, $report_edit, true);
$table->data[13][0] = __('Manage reports');
$table->data[13][1] = html_print_checkbox ('report_management', 1, $report_management, true);
$table->data[14][0] = __('View events');
$table->data[14][1] = html_print_checkbox ('event_view', 1, $event_view, true);
$table->data[15][0] = __('Edit events');
$table->data[15][1] = html_print_checkbox ('event_edit', 1, $event_edit, true);
$table->data[16][0] = __('Manage events');
$table->data[16][1] = html_print_checkbox ('event_management', 1, $event_management, true);
$table->data[17][0] = __('Pandora management');
$table->data[17][1] = html_print_checkbox ('pandora_management', 1, $pandora_management, true);
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&pure='.$pure.'">';

View File

@ -103,6 +103,7 @@ if($create_profile || $update_profile) {
$event_view = (bool) get_parameter ("event_view");
$event_edit = (bool) get_parameter ("event_edit");
$event_management = (bool) get_parameter ("event_management");
$agent_disable = (bool) get_parameter ("agent_disable");
$values = array(
'name' => $name,
@ -121,7 +122,8 @@ if($create_profile || $update_profile) {
'report_management' => $report_management,
'event_view' => $event_view,
'event_edit' => $event_edit,
'event_management' => $event_management);
'event_management' => $event_management,
'agent_disable' => $agent_disable);
}
// Update profile
@ -137,6 +139,7 @@ if ($update_profile) {
' Report view: ' . $report_view . ' Report edit: ' . $report_edit .
' Report management: ' . $report_management . ' Event view: ' . $event_view .
' Event edit: ' . $event_edit . ' Event management: ' . $event_management .
' Agent disable: ' . $agent_disable .
' Pandora Management: ' . $pandora_management;
db_pandora_audit("User management",
"Update profile ". $name, false, false, $info);
@ -169,6 +172,7 @@ if ($create_profile) {
' Report view: ' . $report_view . ' Report edit: ' . $report_edit .
' Report management: ' . $report_management . ' Event view: ' . $event_view .
' Event edit: ' . $event_edit . ' Event management: ' . $event_management .
' Agent disable: ' . $agent_disable .
' Pandora Management: ' . $pandora_management;
db_pandora_audit("User management",
"Created profile ". $name, false, false, $info);
@ -200,18 +204,19 @@ $table->head[2] = "IW" . ui_print_help_tip (__('System incidents writing'), true
$table->head[3] = "IM" . ui_print_help_tip (__('System incidents management'), true);
$table->head[4] = "AR" . ui_print_help_tip (__('Agents reading'), true);
$table->head[5] = "AW" . ui_print_help_tip (__('Agents management'), true);
$table->head[6] = "LW" . ui_print_help_tip (__('Alerts editing'), true);
$table->head[7] = "UM" . ui_print_help_tip (__('Users management'), true);
$table->head[8] = "DM" . ui_print_help_tip (__('Database management'), true);
$table->head[9] = "LM" . ui_print_help_tip (__('Alerts management'), true);
$table->head[10] = "RR" . ui_print_help_tip (__('Reports reading'), true);
$table->head[11] = "RW" . ui_print_help_tip (__('Reports writing'), true);
$table->head[12] = "RM" . ui_print_help_tip (__('Reports management'), true);
$table->head[13] = "ER" . ui_print_help_tip (__('Events reading'), true);
$table->head[14] = "EW" . ui_print_help_tip (__('Events writing'), true);
$table->head[15] = "EM" . ui_print_help_tip (__('Events management'), true);
$table->head[16] = "PM" . ui_print_help_tip (__('Systems management'), true);
$table->head[17] = '<span title="Operations">' . __('Op.') . '</span>';
$table->head[6] = "AD" . ui_print_help_tip (__('Agents disable'), true);
$table->head[7] = "LW" . ui_print_help_tip (__('Alerts editing'), true);
$table->head[8] = "UM" . ui_print_help_tip (__('Users management'), true);
$table->head[9] = "DM" . ui_print_help_tip (__('Database management'), true);
$table->head[10] = "LM" . ui_print_help_tip (__('Alerts management'), true);
$table->head[11] = "RR" . ui_print_help_tip (__('Reports reading'), true);
$table->head[12] = "RW" . ui_print_help_tip (__('Reports writing'), true);
$table->head[13] = "RM" . ui_print_help_tip (__('Reports management'), true);
$table->head[14] = "ER" . ui_print_help_tip (__('Events reading'), true);
$table->head[15] = "EW" . ui_print_help_tip (__('Events writing'), true);
$table->head[16] = "EM" . ui_print_help_tip (__('Events management'), true);
$table->head[17] = "PM" . ui_print_help_tip (__('Systems management'), true);
$table->head[18] = '<span title="Operations">' . __('Op.') . '</span>';
$table->align = array_fill (1, 11, "center");
$table->size = array_fill (1, 10, 40);
@ -230,19 +235,20 @@ foreach ($profiles as $profile) {
$data[3] = ($profile["incident_management"] ? $img : '');
$data[4] = ($profile["agent_view"] ? $img : '');
$data[5] = ($profile["agent_edit"] ? $img : '');
$data[6] = ($profile["alert_edit"] ? $img : '');
$data[7] = ($profile["user_management"] ? $img : '');
$data[8] = ($profile["db_management"] ? $img : '');
$data[9] = ($profile["alert_management"] ? $img : '');
$data[10] = ($profile["report_view"] ? $img : '');
$data[11] = ($profile["report_edit"] ? $img : '');
$data[12] = ($profile["report_management"] ? $img : '');
$data[13] = ($profile["event_view"] ? $img : '');
$data[14] = ($profile["event_edit"] ? $img : '');
$data[15] = ($profile["event_management"] ? $img : '');
$data[16] = ($profile["pandora_management"] ? $img : '');
$data[17] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'. html_print_image('images/config.png', true, array('title' => __('Edit'))) .'</b></a>';
$data[17] .= '&nbsp;&nbsp;<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
$data[6] = ($profile["agent_disable"] ? $img : '');
$data[7] = ($profile["alert_edit"] ? $img : '');
$data[8] = ($profile["user_management"] ? $img : '');
$data[9] = ($profile["db_management"] ? $img : '');
$data[10] = ($profile["alert_management"] ? $img : '');
$data[11] = ($profile["report_view"] ? $img : '');
$data[12] = ($profile["report_edit"] ? $img : '');
$data[13] = ($profile["report_management"] ? $img : '');
$data[14] = ($profile["event_view"] ? $img : '');
$data[15] = ($profile["event_edit"] ? $img : '');
$data[16] = ($profile["event_management"] ? $img : '');
$data[17] = ($profile["pandora_management"] ? $img : '');
$data[18] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'. html_print_image('images/config.png', true, array('title' => __('Edit'))) .'</b></a>';
$data[18] .= '&nbsp;&nbsp;<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
array_push ($table->data, $data);
}

View File

@ -1552,6 +1552,9 @@ function get_acl_column($access) {
case "AW":
return "agent_edit";
break;
case "AD":
return "agent_disable";
break;
case "LW":
return "alert_edit";
break;

View File

@ -258,81 +258,6 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
}
}
/**
* Get all the combined alerts of an agent.
*
* @param int $id_agent Agent id
* @param string Special filter. Can be: "notfired", "fired" or "disabled".
* @param array Extra filter options in an indexed array. See
* db_format_array_where_clause_sql()
*
* @return array An array with all combined alerts defined for an agent.
*/
function agents_get_alerts_compound ($id_agent = false, $filter = '', $options = false, $idGroup = false, $count = false, $where = '') {
switch ($filter) {
case "notfired":
$filter = ' AND times_fired = 0 AND disabled = 0';
break;
case "fired":
$filter = ' AND times_fired > 0 AND disabled = 0';
break;
case "disabled":
$filter = ' AND disabled = 1';
break;
case 'all_enabled':
$filter = ' AND disabled = 0';
break;
default:
$filter = '';
break;
}
if (is_array ($options)) {
$filter .= db_format_array_where_clause_sql ($options);
}
if (($id_agent !== false) && ($idGroup !== false)) {
if ($idGroup != 0) { //All group
$subQuery = 'SELECT id_agente
FROM tagente WHERE id_grupo = ' . $idGroup;
}
else {
$subQuery = 'SELECT id_agente FROM tagente';
}
}
else if ($id_agent == false) {
$subQuery = 'SELECT id_agente
FROM tagente WHERE disabled = 0';
}
else {
$id_agent = (array) $id_agent;
$subQuery = implode (',', $id_agent);
}
$selectText = '*';
if ($count !== false) {
$selectText = 'COUNT(id) AS count';
}
$sql = sprintf ("SELECT %s
FROM talert_compound
WHERE id_agent IN (%s) %s %s",
$selectText, $subQuery, $where, $filter);
$alerts = db_get_all_rows_sql ($sql);
if ($alerts === false)
return array ();
if ($count !== false) {
return $alerts[0]['count'];
}
else {
return $alerts;
}
}
/**
* Get a list of agents.
*
@ -545,10 +470,9 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
* @return array An array with all alerts defined for an agent.
*/
function agents_get_alerts ($id_agent = false, $filter = false, $options = false) {
$combined_alerts = agents_get_alerts_compound ($id_agent, $filter, $options);
$simple_alerts = agents_get_alerts_simple ($id_agent, $filter, $options);
return array ('simple' => $simple_alerts, 'compounds' => $combined_alerts);
return array ('simple' => $simple_alerts);
}
/**

View File

@ -828,12 +828,25 @@ function ui_format_alert_row ($alert, $compound = false, $agent = true, $url = '
$data[$index['status']] = ui_print_status_image($status, $title, true);
if (check_acl ($config["id_user"], $id_group, "LW") == 1) {
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$data[$index['validate']] = '';
//~ if (check_acl ($config["id_user"], $id_group, "AD")) {
//~ if ($alert['disabled']) {
//~ $data[$index['validate']] .= html_print_input_image ('enable', 'images/lightbulb_off.png', 1, '', true);
//~ $data[$index['validate']] .= html_print_input_hidden ('enable_alert', 1, true);
//~ }
//~ else {
//~ $data[$index['validate']] .= html_print_input_image ('disable', 'images/lightbulb.png', 1, '', true);
//~ $data[$index['validate']] .= html_print_input_hidden ('disable_alert', 1, true);
//~ }
//~ }
if ($compound) {
$data[$index['validate']] = html_print_checkbox ("validate_compound[]", $alert["id"], false, true);
$data[$index['validate']] .= html_print_checkbox ("validate_compound[]", $alert["id"], false, true);
}
else {
$data[$index['validate']] = html_print_checkbox ("validate[]", $alert["id"], false, true);
$data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true);
}
}

View File

@ -41,7 +41,6 @@ $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php')
$filter = get_parameter ("filter", "all_enabled");
$filter_standby = get_parameter ("filter_standby", "all");
$offset_simple = (int) get_parameter_get ("offset_simple", 0);
$offset_combined = (int) get_parameter_get("offset_combined", 0);
$id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups)
$free_search = get_parameter("free_search", '');
@ -121,11 +120,7 @@ if ($free_search != '') {
'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE nombre LIKE "%' . $free_search . '%") OR ' .
'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (SELECT id_agente FROM tagente WHERE nombre LIKE "%' . $free_search . '%"))' .
')';
$whereAlertCombined = 'AND (' .
'name LIKE "%' . $free_search . '%" OR ' .
'id IN (SELECT id_alert_compound FROM talert_compound_elements WHERE id_alert_template_module IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE "%' . $free_search . '%"))) ' .
')';
break;
case "postgresql":
case "oracle":
@ -137,16 +132,11 @@ if ($free_search != '') {
'id_agent_module IN (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (SELECT id_agente FROM tagente WHERE nombre LIKE \'%' . $free_search . '%\'))' .
')';
$whereAlertCombined = 'AND (' .
'name LIKE "%' . $free_search . '%" OR ' .
'id IN (SELECT id_alert_compound FROM talert_compound_elements WHERE id_alert_template_module IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action IN (SELECT id FROM talert_actions WHERE name LIKE \'%' . $free_search . '%\'))) ' .
')';
break;
}
}
else {
$whereAlertSimple = '';
$whereAlertCombined = '';
}
$sortField = get_parameter('sort_field');
@ -241,7 +231,6 @@ else {
$alerts = array();
$options_simple = array('offset' => $offset_simple, 'limit' => $config['block_size'], 'order' => $order);
$options_combined = array('limit' => $config["block_size"], 'offset' => $offset_combined);
$filter_alert = array();
if($filter_standby == 'standby_on') {
@ -262,9 +251,6 @@ $alerts['alerts_simple'] = agents_get_alerts_simple ($agents,
$countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert,
false, $whereAlertSimple, false, false, $idGroup, true);
$alerts['alerts_combined'] = agents_get_alerts_compound($agents, $filter, $options_combined, $idGroup, false, $whereAlertCombined);
$countAlertsCombined = agents_get_alerts_compound($agents, $filter, false, $idGroup, true, $whereAlertCombined);
if ($tab != null) {
$url = $url.'&tab='.$tab;
}
@ -298,8 +284,8 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[6] = __('Action');
$table->head[7] = __('Last fired');
$table->head[8] = __('Status');
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
$table->head[9] = __('Validate');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM") || check_acl ($config["id_user"], $id_group, "AD")) {
$table->head[9] = __('Actions');
}
$table->align[8] = 'center';
$table->align[9] = 'center';
@ -318,8 +304,8 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[5] = __('Action');
$table->head[6] = __('Last fired');
$table->head[7] = __('Status');
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
$table->head[8] = __('Validate');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM") || check_acl ($config["id_user"], $id_group, "AD")) {
$table->head[8] = __('Actions');
}
$table->align[7] = 'center';
$table->align[8] = 'center';
@ -343,8 +329,8 @@ else
$table->head[5] = __('Action');
$table->head[6] = __('Last fired');
$table->head[7] = __('Status');
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
$table->head[8] = __('Validate');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM") || check_acl ($config["id_user"], $id_group, "AD")) {
$table->head[8] = __('Actions');
}
$table->align[7] = 'center';
$table->align[8] = 'center';
@ -361,17 +347,14 @@ else
$table->head[4] = __('Action');
$table->head[5] = __('Last fired');
$table->head[6] = __('Status');
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
$table->head[7] = __('Validate');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM") || check_acl ($config["id_user"], $id_group, "AD")) {
$table->head[7] = __('Actions');
}
$table->align[6] = 'center';
$table->align[7] = 'center';
}
}
$table->title = __('Single alerts');
$table->titlestyle = "background-color:#799E48;";
$table->data = array ();
$rowPair = true;
@ -393,38 +376,10 @@ if (!empty ($table->data)) {
html_print_table ($table);
}
else {
echo '<div class="nf">'.__('No simple alerts found').'</div>';
echo '<div class="nf">'.__('No alerts found').'</div>';
}
$table->title = __('Compound alerts');
$table->titlestyle = "background-color:#799E48;";
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[0] = '';
$table->head[1] = '';
$table->head[2] = '';
$table->head[3] = __('Agent');
$table->head[4] = __('Description');
}
else
{
$table->head[0] = '';
$table->head[1] = '';
$table->head[2] = __('Agent');
$table->head[3] = __('Description');
}
$table->data = array ();
foreach ($alerts['alerts_combined'] as $alert) {
array_push ($table->data, ui_format_alert_row ($alert, true, $print_agent));
}
if (!empty ($table->data)) {
ui_pagination ($countAlertsCombined, $url, $offset_combined, 0, false, 'offset_combined');
html_print_table ($table);
}
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) {
if (count($alerts['alerts_simple']) > 0 || count($alerts['alerts_combined']) > 0) {
echo '<div class="action-buttons" style="width: '.$table->width.';">';
html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub upd"', false);

View File

@ -315,11 +315,11 @@ END;;
--
BEGIN
LOCK TABLE tperfil IN EXCLUSIVE MODE;
INSERT INTO tperfil VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0);
INSERT INTO tperfil VALUES (2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0);
INSERT INTO tperfil VALUES (3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0);
INSERT INTO tperfil VALUES (4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1);
INSERT INTO tperfil VALUES (5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
INSERT INTO tperfil VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0);
INSERT INTO tperfil VALUES (2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0);
INSERT INTO tperfil VALUES (3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1);
INSERT INTO tperfil VALUES (4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1);
INSERT INTO tperfil VALUES (5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
COMMIT;
END;;

View File

@ -286,7 +286,7 @@ SELECT setval('tusuario_perfil_id_up_seq', (SELECT (SELECT MAX(id_up) FROM tusua
--
-- Dumping data for table "tperfil"
--
INSERT INTO "tperfil" VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0),(2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0),(3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0),(4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1),(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
INSERT INTO "tperfil" VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0),(2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0),(3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1),(4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1),(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
SELECT setval('tperfil_id_perfil_seq', (SELECT (SELECT MAX(id_perfil) FROM tperfil)));
--

View File

@ -748,7 +748,6 @@ CREATE TABLE tnetwork_component (
post_process BINARY_DOUBLE default 0.
unit CLOB default '',
wizard_level VARCHAR2(100) default 'nowizard' NOT NULL,
only_metaconsole NUMBER(5, 0) default 0 NOT NULL,
macros CLOB default '',
critical_instructions VARCHAR2(255) default '',
warning_instructions VARCHAR2(255) default '',
@ -757,7 +756,7 @@ CREATE TABLE tnetwork_component (
warning_inverse NUMBER(1, 0) default 0 NOT NULL,
id_category NUMBER(10, 0) default 0 NOT NULL,
tags CLOB,
CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'))
CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','nowizard'))
);
CREATE SEQUENCE tnetwork_component_s INCREMENT BY 1 START WITH 1;
@ -818,7 +817,8 @@ CREATE TABLE tperfil (
report_management NUMBER(5, 0) default 0 NOT NULL,
event_view NUMBER(5, 0) default 0 NOT NULL,
event_edit NUMBER(5, 0) default 0 NOT NULL,
event_management NUMBER(5, 0) default 0 NOT NULL
event_management NUMBER(5, 0) default 0 NOT NULL,
agent_disable NUMBER(5, 0) default 0 NOT NULL
);
CREATE SEQUENCE tperfil_s INCREMENT BY 1 START WITH 1;

View File

@ -583,7 +583,7 @@ CREATE TABLE "tmodule_group" (
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
CREATE TYPE type_tlocal_component_wizard_level AS ENUM ('basic','advanced','custom','nowizard');
CREATE TYPE type_tlocal_component_wizard_level AS ENUM ('basic','advanced','nowizard');
CREATE TABLE "tnetwork_component" (
"id_nc" SERIAL NOT NULL PRIMARY KEY,
"name" varchar(80) NOT NULL,
@ -622,7 +622,6 @@ CREATE TABLE "tnetwork_component" (
"post_process" DOUBLE PRECISION default 0,
"unit" TEXT default '',
"wizard_level" type_tlocal_component_wizard_level default 'nowizard',
"only_metaconsole" INTEGER default '0',
"macros" TEXT default '',
"critical_instructions" TEXT default '',
"warning_instructions" TEXT default '',
@ -700,7 +699,8 @@ CREATE TABLE "tperfil" (
"report_management" SMALLINT NOT NULL default 0,
"event_view" SMALLINT NOT NULL default 0,
"event_edit" SMALLINT NOT NULL default 0,
"event_management" SMALLINT NOT NULL default 0
"event_management" SMALLINT NOT NULL default 0,
"agent_disable" SMALLINT NOT NULL default 0
);
-- ---------------------------------------------------------------------

View File

@ -698,8 +698,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
`custom_integer_2` int(10) default 0,
`post_process` double(18,5) default 0,
`unit` text,
`wizard_level` enum('basic','advanced','custom','nowizard') default 'nowizard',
`only_metaconsole` tinyint(1) unsigned default '0',
`wizard_level` enum('basic','advanced','nowizard') default 'nowizard',
`macros` text,
`critical_instructions` text NOT NULL default '',
`warning_instructions` text NOT NULL default '',
@ -782,6 +781,7 @@ CREATE TABLE IF NOT EXISTS `tperfil` (
`event_view` tinyint(3) NOT NULL default '0',
`event_edit` tinyint(3) NOT NULL default '0',
`event_management` tinyint(3) NOT NULL default '0',
`agent_disable` tinyint(3) NOT NULL default '0',
PRIMARY KEY (`id_perfil`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -288,7 +288,7 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, `
-- Dumping data for table `tperfil`
--
INSERT INTO `tperfil` VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0),(2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0),(3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0),(4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1),(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
INSERT INTO `tperfil` VALUES (1,'Operator&#x20;&#40;Read&#41;',0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0),(2,'Operator&#x20;&#40;Write&#41;',1,1,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0),(3,'Chief&#x20;Operator',1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,1),(4,'Group&#x20;coordinator',1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1),(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
--
-- Dumping data for table `tnews`