2014-05-31 Junichi Satoh <junichi@rworks.jp>

* godmode/agentes/configurar_agente.php,
	godmode/agentes/module_manager_editor.php,
	godmode/agentes/module_manager_editor_common.php,
	pandoradb.sql, pandoradb.oracle.sql, pandoradb.postgreSQL.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: Improved
	'FF threshold' to be able to define timeout.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2014-05-31 13:36:53 +00:00
parent 7dbe6f2a85
commit 6dfd8974d8
10 changed files with 62 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2014-05-31 Junichi Satoh <junichi@rworks.jp>
* godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_common.php,
pandoradb.sql, pandoradb.oracle.sql, pandoradb.postgreSQL.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: Improved
'FF threshold' to be able to define timeout.
2014-05-30 Miguel de Dios <miguel.dedios@artica.es>
* operation/events/sound_events.php: fixed the break image.

View File

@ -54,6 +54,8 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_normal` int(4) unsigned de
ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_warning` int(4) unsigned default '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `min_ff_event_critical` int(4) unsigned default '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `each_ff` tinyint(1) unsigned default '0';
/* 2014/05/31 */
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_timeout` int(4) unsigned default '0';
/* 2014/03/18 */
-- ---------------------------------------------------------------------
@ -218,3 +220,9 @@ ALTER TABLE `tnews` ADD COLUMN `id_group` int(10) NOT NULL default 0;
ALTER TABLE `tnews` ADD COLUMN `modal` tinyint(1) DEFAULT 0;
ALTER TABLE `tnews` ADD COLUMN `expire` tinyint(1) DEFAULT 0;
ALTER TABLE `tnews` ADD COLUMN `expire_timestamp` DATETIME NOT NULL DEFAULT 0;
/* 2014/05/31 */
-- ---------------------------------------------------------------------
-- Table `tagente_estado`
-- ---------------------------------------------------------------------
ALTER TABLE `tagente_estado` ADD COLUMN `ff_start_utimestamp` bigint(20) default 0;

View File

@ -46,6 +46,8 @@ ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_normal INTEGER default 0;
ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_warning INTEGER default 0;
ALTER TABLE tagente_modulo ADD COLUMN min_ff_event_critical INTEGER default 0;
ALTER TABLE tagente_modulo ADD COLUMN each_ff NUMBER(1, 0) default 0;
/* 2014/05/31 */
ALTER TABLE tagente_modulo ADD COLUMN ff_timeout INTEGER unsigned default 0;
/* 2014/03/18 */
-- ----------------------------------------------------------------------
@ -202,3 +204,9 @@ ALTER TABLE tnews ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL;
ALTER TABLE tnews ADD COLUMN modal NUMBER(5, 0) default 0 NOT NULL;
ALTER TABLE tnews ADD COLUMN expire NUMBER(5, 0) default 0 NOT NULL;
ALTER TABLE tnews ADD COLUMN expire_timestamp TIMESTAMP default NULL;
/* 2014/05/31 */
-- ---------------------------------------------------------------------
-- Table `tagente_estado`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_estado ADD COLUMN ff_start_utimestamp NUMBER(10, 0) default 0;

View File

@ -47,6 +47,8 @@ ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_normal" INTEGER default 0;
ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_warning" INTEGER default 0;
ALTER TABLE "tagente_modulo" ADD COLUMN "min_ff_event_critical" INTEGER default 0;
ALTER TABLE "tagente_modulo" ADD COLUMN "each_ff" SMALLINT default 0;
/* 2014/05/31 */
ALTER TABLE "tagente_modulo" ADD COLUMN "ff_timeout" INTEGER unsigned default 0;
/* 2014/03/18 */
-- ----------------------------------------------------------------------
@ -176,3 +178,9 @@ ALTER TABLE "tnews" ADD COLUMN "id_group" INTEGER NOT NULL default 0;
ALTER TABLE "tnews" ADD COLUMN "modal" SMALLINT DEFAULT 0;
ALTER TABLE "tnews" ADD COLUMN "expire" SMALLINT DEFAULT 0;
ALTER TABLE "tnews" ADD COLUMN "expire_timestamp" TIMESTAMP without time zone default '1970-01-01 00:00:00';
/* 2014/05/31 */
-- ---------------------------------------------------------------------
-- Table `tagente_estado`
-- ---------------------------------------------------------------------
ALTER TABLE "tagente_estado" ADD COLUMN "ff_start_utimestamp" BIGINT default 0;

View File

@ -919,6 +919,7 @@ if ($update_module || $create_module) {
$ff_event_warning = (int) get_parameter ('ff_event_warning');
$ff_event_critical = (int) get_parameter ('ff_event_critical');
$each_ff = (int) get_parameter ('each_ff');
$ff_timeout = (int) get_parameter ('ff_timeout');
$unit = (string) get_parameter('unit');
$id_tag = (array) get_parameter('id_tag_selected');
$serialize_ops = (string) get_parameter('serialize_ops');
@ -1008,6 +1009,7 @@ if ($update_module) {
'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout,
'unit' => $unit,
'macros' => $macros,
'quiet' => $quiet_module,
@ -1145,6 +1147,7 @@ if ($create_module) {
'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout,
'unit' => $unit,
'macros' => $macros,
'quiet' => $quiet_module,

View File

@ -207,6 +207,7 @@ if ($id_agent_module) {
$ff_event_warning = $module['min_ff_event_warning'];
$ff_event_critical = $module['min_ff_event_critical'];
$each_ff = $module['each_ff'];
$ff_timeout = $module['ff_timeout'];
// Select tag info.
$id_tag = tags_get_module_tags ($id_agent_module);
@ -311,6 +312,8 @@ else {
$wday = '*';
$ff_interval = 0;
$ff_timeout = 0;
$module_macros = array ();
}

View File

@ -308,9 +308,9 @@ $table_advanced->colspan[1][1] = 2;
$table_advanced->data[1][1] = html_print_input_text ('custom_id', $custom_id,
'', 20, 65, true);
$table_advanced->data[1][3] = __('FF interval');
$table_advanced->data[1][4] = html_print_input_text ('module_ff_interval', $ff_interval,
'', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->data[1][3] = __('Unit');
$table_advanced->data[1][4] = html_print_input_text ('unit', $unit,
'', 20, 65, true);
// In the data modules, the interval is not in seconds. It is a factor
// to be multiplied for the agent interval
@ -388,10 +388,14 @@ $table_advanced->data[4][3] = __('Throw unknown events');
$table_advanced->data[4][4] = html_print_checkbox('throw_unknown_events',
1, $throw_unknown_events_check, true);
$table_advanced->data[5][0] = __('Unit');
$table_advanced->data[5][1] = html_print_input_text ('unit', $unit,
'', 20, 65, true);
$table_advanced->colspan[5][1] = 4;
$table_advanced->data[5][0] = __('FF interval');
$table_advanced->data[5][1] = html_print_input_text ('module_ff_interval', $ff_interval,
'', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->colspan[5][1] = 2;
$table_advanced->data[5][3] = __('FF timeout');
$table_advanced->data[5][4] = html_print_input_text ('ff_timeout', $ff_timeout,
'', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Timeout in secs from start of flip flop counting. If this value is exceeded, FF counter is reset. Set to 0 for no timeout.'), true);
/* Tags */
// This var comes from module_manager_editor.php or policy_modules.php

View File

@ -163,7 +163,8 @@ CREATE TABLE tagente_estado (
status_changes NUMBER(10, 0) default 0,
last_status NUMBER(10, 0) default 0,
last_known_status NUMBER(10, 0) default 0,
last_error NUMBER(10, 0) default 0
last_error NUMBER(10, 0) default 0,
ff_start_utimestamp NUMBER(10, 0) default 0
);
CREATE INDEX tagente_estado_id_agente_idx ON tagente_estado(id_agente);
CREATE INDEX tagente_estado_estado_idx ON tagente_estado(estado);
@ -252,7 +253,8 @@ CREATE TABLE tagente_modulo (
min_ff_event_normal INTEGER default 0,
min_ff_event_warning INTEGER default 0,
min_ff_event_critical INTEGER default 0,
each_ff NUMBER(1, 0) default 0
each_ff NUMBER(1, 0) default 0,
ff_timeout INTEGER unsigned default 0
CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','nowizard'))
);

View File

@ -156,7 +156,8 @@ CREATE TABLE "tagente_estado" (
"status_changes" INTEGER default 0,
"last_status" INTEGER default 0,
"last_known_status" INTEGER default 0,
"last_error" INTEGER default 0
"last_error" INTEGER default 0,
"ff_start_utimestamp" BIGINT default 0
);
CREATE INDEX "tagente_estado_id_agente_modulo_idx" ON "tagente_estado"("id_agente_modulo");
CREATE INDEX "tagente_estado_id_agente_idx" ON "tagente_estado"("id_agente");
@ -241,7 +242,8 @@ CREATE TABLE "tagente_modulo" (
"min_ff_event_normal" INTEGER default 0,
"min_ff_event_warning" INTEGER default 0,
"min_ff_event_critical" INTEGER default 0,
"each_ff" SMALLINT default 0
"each_ff" SMALLINT default 0,
"ff_timeout" INTEGER unsigned default 0
);
CREATE INDEX "tagente_modulo_id_agente_idx" ON "tagente_modulo"("id_agente");
CREATE INDEX "tagente_modulo_id_tipo_modulo_idx" ON "tagente_modulo"("id_tipo_modulo");

View File

@ -154,6 +154,7 @@ CREATE TABLE `tagente_estado` (
`last_status` tinyint(4) default 0,
`last_known_status` tinyint(4) default 0,
`last_error` int(4) NOT NULL default '0',
`ff_start_utimestamp` bigint(20) default 0,
PRIMARY KEY (`id_agente_estado`),
KEY `status_index_1` (`id_agente_modulo`),
KEY `idx_agente` (`id_agente`),
@ -238,6 +239,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`min_ff_event_warning` int(4) unsigned default '0',
`min_ff_event_critical` int(4) unsigned default '0',
`each_ff` tinyint(1) unsigned default '0',
`ff_timeout` int(4) unsigned default '0',
PRIMARY KEY (`id_agente_modulo`),
KEY `main_idx` (`id_agente_modulo`,`id_agente`),
KEY `tam_agente` (`id_agente`),