diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 9796646fce..51bc92da04 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -30,7 +30,8 @@ require_once __DIR__.'/Wizard.main.php'; require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_reports.php'; require_once $config['homedir'].'/include/functions_cron.php'; -enterprise_include('include/functions_tasklist.php'); +enterprise_include_once('include/functions_tasklist.php'); +enterprise_include_once('include/functions_cron.php'); /** * Defined as wizard to guide user to explore running tasks. @@ -237,7 +238,7 @@ class DiscoveryTaskList extends Wizard $id_console_task = (int) get_parameter('id_console_task'); if ($id_console_task !== null) { - enterprise_include('cron_task_run', $id_console_task, true); + enterprise_hook('cron_task_run', $id_console_task, true); // Trick to avoid double execution. header('Location: '.$this->url); } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index ae780a5470..7db13af428 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3486,4 +3486,31 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` ( `recursion` int(1) unsigned default '0', `group_search` int(10) unsigned default '0', PRIMARY KEY(`id`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `user_task` +-- --------------------------------------------------------------------- +CREATE TABLE `tuser_task` ( + `id` int(20) unsigned NOT NULL auto_increment, + `function_name` varchar(80) NOT NULL default '', + `parameters` text NOT NULL default '', + `name` varchar(60) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `user_task_scheduled` +-- --------------------------------------------------------------------- +CREATE TABLE `tuser_task_scheduled` ( + `id` int(20) unsigned NOT NULL auto_increment, + `id_usuario` varchar(60) NOT NULL default '0', + `id_user_task` int(20) unsigned NOT NULL default '0', + `args` TEXT NOT NULL, + `scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no', + `last_run` int(20) unsigned default '0', + `custom_data` int(10) NULL default '0', + `flag_delete` tinyint(1) UNSIGNED NOT NULL default 0, + `id_grupo` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 25bff0eb4d..52ba72bb62 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -31,6 +31,9 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal LOCK TABLES `tconfig` WRITE; INSERT INTO `tconfig` (`token`, `value`) VALUES +('cron_extension_installed','1'), +('cron_extension_sql_version','1'), +('cron_last_run','0'), ('language','en_GB'), ('block_size','20'), ('days_purge','45'),