This commit is contained in:
fbsanchez 2021-10-13 22:47:31 +02:00
parent d2f5a04583
commit 96250dcfa0
5 changed files with 21 additions and 2 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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);
if ($title === null) {
$title = modules_get_modules_status($status);
}
$output = '<div style="background: '.$color;
$output .= '" class="'.$class;

View File

@ -4071,12 +4071,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,

View File

@ -389,6 +389,15 @@ sub pandora_purgedb ($$) {
log_message ('PURGE', 'days_purge_old_data is set to 0. Old log data will not be deleted.');
}
# Delete old log data
log_message ('PURGE', "Deleting old network configuration manager data.");
if (defined($conf->{'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) {