From 96250dcfa0f04b49a9a9108fd1eaf9e43094bf60 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 13 Oct 2021 22:47:31 +0200 Subject: [PATCH] WIP NCM --- pandora_console/extras/mr/50.sql | 2 ++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ pandora_console/include/functions_ui.php | 8 ++++++-- pandora_console/pandoradb.sql | 2 ++ pandora_server/util/pandora_db.pl | 9 +++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/mr/50.sql b/pandora_console/extras/mr/50.sql index bf4f649516..f22b699c9f 100644 --- a/pandora_console/extras/mr/50.sql +++ b/pandora_console/extras/mr/50.sql @@ -49,12 +49,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `model` text, `protocol` int unsigned not null default 0, `cred_key` varchar(100), + `port` int(4) unsigned default 22, `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, `config_backup_id` bigint(20) UNSIGNED DEFAULT NULL, `id_template` bigint(20) unsigned, `execute_type` int(2) UNSIGNED NOT NULL default 0, `execute` int(2) UNSIGNED NOT NULL default 0, + `last_error` text, PRIMARY KEY (`id_agent`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL, diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 4bb197557b..42a1ccd41c 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -4135,12 +4135,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` ( `model` text, `protocol` int unsigned not null default 0, `cred_key` varchar(100), + `port` int(4) unsigned default 22, `status` int(4) NOT NULL default 5, `updated_at` bigint(20) NOT NULL default 0, `config_backup_id` bigint(20) UNSIGNED DEFAULT NULL, `id_template` bigint(20) unsigned, `execute_type` int(2) UNSIGNED NOT NULL default 0, `execute` int(2) UNSIGNED NOT NULL default 0, + `last_error` text, PRIMARY KEY (`id_agent`), FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL, diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a9759730ea..bb4193a9b7 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2731,16 +2731,20 @@ function ui_print_status_image( * @param integer $status Module status. * @param boolean $return True or false. * @param string $class Custom class or use defined. + * @param string $title Custom title or inherit from module status. * * @return string HTML code for shape. */ function ui_print_module_status( $status, $return=false, - $class='status_rounded_rectangles' + $class='status_rounded_rectangles', + $title=null ) { $color = modules_get_color_status($status, true); - $title = modules_get_modules_status($status); + if ($title === null) { + $title = modules_get_modules_status($status); + } $output = '
{'days_purge_ncm'}) && $conf->{'days_purge_ncm'} > 0) { + log_message ('PURGE', 'Deleting NCM data older than ' . $conf->{'days_purge_ncm'} . ' days.'); + enterprise_hook ('pandora_purge_ncm', [$dbh, \&log_message, $conf->{'days_purge_ncm'}, $conf->{'_history_db_step'}, $conf->{'_history_db_delay'}]); + } else { + log_message ('PURGE', 'days_purge_ncm is set to 0. Old network configuration manager data will not be deleted.'); + } + # Delete old special days log_message ('PURGE', "Deleting old special days."); if ($conf->{'_num_past_special_days'} > 0) {