2013-01-31 Ramon Novoa <rnovoa@artica.es>

* extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
	  pandoradb.sql: Removed some indexes that caused deadlocks on high
	  load scenarios.

	* godmode/setup/setup_general.php,
	  include/functions_config.php: Added support for event storm
	  protection.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2013-01-31 18:05:22 +00:00
parent e61e6afbf0
commit 468a31e37e
5 changed files with 44 additions and 11 deletions

View File

@ -1,3 +1,13 @@
2013-01-31 Ramon Novoa <rnovoa@artica.es>
* extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
pandoradb.sql: Removed some indexes that caused deadlocks on high
load scenarios.
* godmode/setup/setup_general.php,
include/functions_config.php: Added support for event storm
protection.
2013-01-31 Miguel de Dios <miguel.dedios@artica.es> 2013-01-31 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js: fixed a * godmode/reporting/visual_console_builder.editor.js: fixed a

View File

@ -1062,3 +1062,20 @@ INSERT INTO `tnetwork_component_group` VALUES (48,'MacOS',0);
DROP TABLE IF EXISTS `talert_compound_actions`; DROP TABLE IF EXISTS `talert_compound_actions`;
DROP TABLE IF EXISTS `talert_compound_elements`; DROP TABLE IF EXISTS `talert_compound_elements`;
DROP TABLE IF EXISTS `talert_compound`; DROP TABLE IF EXISTS `talert_compound`;
-- ---------------------------------------------------------------------
-- Modify indexes
-- ---------------------------------------------------------------------
ALTER TABLE tagente_estado DROP INDEX idx_status;
ALTER TABLE tagente_estado DROP INDEX current_interval;
ALTER TABLE tagente_estado DROP INDEX last_execution_try;
ALTER TABLE tevento DROP INDEX indice_1;
ALTER TABLE tevento DROP INDEX criticity;
ALTER TABLE tevento DROP INDEX estado;
ALTER TABLE tevento ADD INDEX `idx_utimestamp` USING BTREE (`utimestamp`);
ALTER TABLE tserver DROP INDEX keepalive;
ALTER TABLE tserver DROP INDEX status;

View File

@ -225,6 +225,13 @@ $table->data[29][1] = __('Yes') . '&nbsp;&nbsp;&nbsp;' .
$table->data[29][1] .= __('No') . '&nbsp;&nbsp;&nbsp;' . $table->data[29][1] .= __('No') . '&nbsp;&nbsp;&nbsp;' .
html_print_radio_button ('referer_security', 0, '', $config["referer_security"], true); html_print_radio_button ('referer_security', 0, '', $config["referer_security"], true);
$table->data[30][0] = __('Event storm protection');
$table->data[30][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
$table->data[30][1] = __('Yes') . '&nbsp;&nbsp;&nbsp;' .
html_print_radio_button ('event_storm_protection', 1, '', $config["event_storm_protection"], true) .
'&nbsp;&nbsp;';
$table->data[30][1] .= __('No') . '&nbsp;&nbsp;&nbsp;' .
html_print_radio_button ('event_storm_protection', 0, '', $config["event_storm_protection"], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">'; echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';

View File

@ -129,6 +129,7 @@ function config_update_config () {
} }
config_update_value ('public_url', get_parameter('public_url')); config_update_value ('public_url', get_parameter('public_url'));
config_update_value ('referer_security', get_parameter('referer_security')); config_update_value ('referer_security', get_parameter('referer_security'));
config_update_value ('event_storm_protection', get_parameter('event_storm_protection'));
break; break;
case 'enterprise': case 'enterprise':
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
@ -845,7 +846,11 @@ function config_process_config () {
if (!isset($config['referer_security'])) { if (!isset($config['referer_security'])) {
config_update_value ('referer_security', 0); config_update_value ('referer_security', 0);
} }
if (!isset($config['event_storm_protection'])) {
config_update_value ('event_storm_protection', 0);
}
/* Finally, check if any value was overwritten in a form */ /* Finally, check if any value was overwritten in a form */
config_update_config(); config_update_config();
} }

View File

@ -157,10 +157,7 @@ CREATE TABLE `tagente_estado` (
PRIMARY KEY (`id_agente_estado`), PRIMARY KEY (`id_agente_estado`),
KEY `status_index_1` (`id_agente_modulo`), KEY `status_index_1` (`id_agente_modulo`),
KEY `idx_agente` (`id_agente`), KEY `idx_agente` (`id_agente`),
KEY `idx_status` (`estado`), KEY `running_by` (`running_by`)
KEY `current_interval` (`current_interval`),
KEY `running_by` (`running_by`),
KEY `last_execution_try` (`last_execution_try`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Probably last_execution_try index is not useful and loads more than benefits -- Probably last_execution_try index is not useful and loads more than benefits
@ -496,10 +493,9 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`owner_user` VARCHAR(100) NOT NULL DEFAULT '', `owner_user` VARCHAR(100) NOT NULL DEFAULT '',
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0', `ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_evento`), PRIMARY KEY (`id_evento`),
KEY `indice_1` (`id_agente`,`id_evento`), KEY `idx_agente` (`id_agente`),
KEY `idx_agentmodule` (`id_agentmodule`), KEY `idx_agentmodule` (`id_agentmodule`),
INDEX criticity (`criticity`), KEY `idx_utimestamp` USING BTREE (`utimestamp`)
INDEX estado (`estado`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Criticity: 0 - Maintance (grey) -- Criticity: 0 - Maintance (grey)
-- Criticity: 1 - Informational (blue) -- Criticity: 1 - Informational (blue)
@ -793,9 +789,7 @@ CREATE TABLE IF NOT EXISTS `tserver` (
`my_modules` int(11) NOT NULL default 0, `my_modules` int(11) NOT NULL default 0,
`stat_utimestamp` bigint(20) NOT NULL default '0', `stat_utimestamp` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id_server`), PRIMARY KEY (`id_server`),
KEY `name` (`name`), KEY `name` (`name`)
KEY `keepalive` (`keepalive`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- server types: -- server types:
-- 0 data -- 0 data