mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
WIP NCM
This commit is contained in:
parent
d2f5a04583
commit
96250dcfa0
@ -49,12 +49,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
|
|||||||
`model` text,
|
`model` text,
|
||||||
`protocol` int unsigned not null default 0,
|
`protocol` int unsigned not null default 0,
|
||||||
`cred_key` varchar(100),
|
`cred_key` varchar(100),
|
||||||
|
`port` int(4) unsigned default 22,
|
||||||
`status` int(4) NOT NULL default 5,
|
`status` int(4) NOT NULL default 5,
|
||||||
`updated_at` bigint(20) NOT NULL default 0,
|
`updated_at` bigint(20) NOT NULL default 0,
|
||||||
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
||||||
`id_template` bigint(20) unsigned,
|
`id_template` bigint(20) unsigned,
|
||||||
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
||||||
`execute` int(2) UNSIGNED NOT NULL default 0,
|
`execute` int(2) UNSIGNED NOT NULL default 0,
|
||||||
|
`last_error` text,
|
||||||
PRIMARY KEY (`id_agent`),
|
PRIMARY KEY (`id_agent`),
|
||||||
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
|
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,
|
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
|
||||||
|
@ -4135,12 +4135,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
|
|||||||
`model` text,
|
`model` text,
|
||||||
`protocol` int unsigned not null default 0,
|
`protocol` int unsigned not null default 0,
|
||||||
`cred_key` varchar(100),
|
`cred_key` varchar(100),
|
||||||
|
`port` int(4) unsigned default 22,
|
||||||
`status` int(4) NOT NULL default 5,
|
`status` int(4) NOT NULL default 5,
|
||||||
`updated_at` bigint(20) NOT NULL default 0,
|
`updated_at` bigint(20) NOT NULL default 0,
|
||||||
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
||||||
`id_template` bigint(20) unsigned,
|
`id_template` bigint(20) unsigned,
|
||||||
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
||||||
`execute` int(2) UNSIGNED NOT NULL default 0,
|
`execute` int(2) UNSIGNED NOT NULL default 0,
|
||||||
|
`last_error` text,
|
||||||
PRIMARY KEY (`id_agent`),
|
PRIMARY KEY (`id_agent`),
|
||||||
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
|
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,
|
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
|
||||||
|
@ -2731,16 +2731,20 @@ function ui_print_status_image(
|
|||||||
* @param integer $status Module status.
|
* @param integer $status Module status.
|
||||||
* @param boolean $return True or false.
|
* @param boolean $return True or false.
|
||||||
* @param string $class Custom class or use defined.
|
* @param string $class Custom class or use defined.
|
||||||
|
* @param string $title Custom title or inherit from module status.
|
||||||
*
|
*
|
||||||
* @return string HTML code for shape.
|
* @return string HTML code for shape.
|
||||||
*/
|
*/
|
||||||
function ui_print_module_status(
|
function ui_print_module_status(
|
||||||
$status,
|
$status,
|
||||||
$return=false,
|
$return=false,
|
||||||
$class='status_rounded_rectangles'
|
$class='status_rounded_rectangles',
|
||||||
|
$title=null
|
||||||
) {
|
) {
|
||||||
$color = modules_get_color_status($status, true);
|
$color = modules_get_color_status($status, true);
|
||||||
$title = modules_get_modules_status($status);
|
if ($title === null) {
|
||||||
|
$title = modules_get_modules_status($status);
|
||||||
|
}
|
||||||
|
|
||||||
$output = '<div style="background: '.$color;
|
$output = '<div style="background: '.$color;
|
||||||
$output .= '" class="'.$class;
|
$output .= '" class="'.$class;
|
||||||
|
@ -4071,12 +4071,14 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
|
|||||||
`model` text,
|
`model` text,
|
||||||
`protocol` int unsigned not null default 0,
|
`protocol` int unsigned not null default 0,
|
||||||
`cred_key` varchar(100),
|
`cred_key` varchar(100),
|
||||||
|
`port` int(4) unsigned default 22,
|
||||||
`status` int(4) NOT NULL default 5,
|
`status` int(4) NOT NULL default 5,
|
||||||
`updated_at` bigint(20) NOT NULL default 0,
|
`updated_at` bigint(20) NOT NULL default 0,
|
||||||
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
|
||||||
`id_template` bigint(20) unsigned,
|
`id_template` bigint(20) unsigned,
|
||||||
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
`execute_type` int(2) UNSIGNED NOT NULL default 0,
|
||||||
`execute` int(2) UNSIGNED NOT NULL default 0,
|
`execute` int(2) UNSIGNED NOT NULL default 0,
|
||||||
|
`last_error` text,
|
||||||
PRIMARY KEY (`id_agent`),
|
PRIMARY KEY (`id_agent`),
|
||||||
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
|
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,
|
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
|
||||||
|
@ -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.');
|
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
|
# Delete old special days
|
||||||
log_message ('PURGE', "Deleting old special days.");
|
log_message ('PURGE', "Deleting old special days.");
|
||||||
if ($conf->{'_num_past_special_days'} > 0) {
|
if ($conf->{'_num_past_special_days'} > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user