Merge branch 'ent-7060-gestion-basica-de-configuracion-de-equipos-de-red' into 'develop'

NCM

See merge request artica/pandorafms!4434
This commit is contained in:
Daniel Rodriguez 2021-10-26 08:21:01 +00:00
commit e2ae42dd89
35 changed files with 775 additions and 117 deletions

View File

@ -20,4 +20,108 @@ INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period,
INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0;
DELETE FROM `treport_content` WHERE type = 'histogram_data';
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_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,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT IGNORE INTO `tncm_model` VALUES (1,1,'7200');
INSERT IGNORE INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT IGNORE INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
COMMIT;

View File

@ -4079,6 +4079,10 @@ ALTER TABLE `tperfil` DROP COLUMN `incident_view`;
ALTER TABLE `tperfil` DROP COLUMN `incident_edit`;
ALTER TABLE `tperfil` DROP COLUMN `incident_management`;
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
-- -----------------------------------------------------
-- Table `talert_execution_queue`
-- -----------------------------------------------------
@ -4092,4 +4096,126 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
-- ----------------------------------------------------------------------
-- Table `tncm_vendor`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_model`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_script`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template_scripts`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_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,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent_data`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT INTO `tncm_model` VALUES (1,1,'7200');
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);

View File

@ -46,11 +46,11 @@ ui_require_css_file('first_task');
ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]);
?>
<div class="new_task_cluster">
<div class="image_task_cluster">
<div class="new_task">
<div class="image_task">
<?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
</div>
<div class="text_task_cluster">
<div class="text_task">
<h3> <?php echo __('Create Cluster'); ?></h3>
<p id="description_task">
<?php

View File

@ -485,6 +485,13 @@ if ($id_agente) {
$collectiontab = '';
}
// NetworkConfigManager tab.
$ncm_tab = enterprise_hook('networkconfigmanager_tab');
if ($ncm_tab === ENTERPRISE_NOT_HOOK) {
$ncm_tab = '';
}
// Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
'images/group.png',
@ -616,6 +623,7 @@ if ($id_agente) {
'main' => $maintab,
'remote_configuration' => $remote_configuration_tab,
'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab,
'template' => $templatetab,
'inventory' => $inventorytab,
@ -631,6 +639,7 @@ if ($id_agente) {
'separator' => '',
'main' => $maintab,
'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab,
'template' => $templatetab,
'inventory' => $inventorytab,
@ -699,6 +708,11 @@ if ($id_agente) {
$tab_name = 'Collection';
break;
case 'ncm':
$tab_description = '- '.__('Network config manager');
$tab_name = 'Network config manager';
break;
case 'inventory':
$tab_description = '- '.__('Inventory');
$help_header = 'inventory_tab';
@ -2313,6 +2327,10 @@ switch ($tab) {
include 'agent_incidents.php';
break;
case 'ncm':
enterprise_hook('ncm_agent_tab', [$id_agente]);
break;
case 'remote_configuration':
enterprise_include('godmode/agentes/agent_disk_conf_editor.php');
break;

View File

@ -175,6 +175,10 @@ if (check_acl($config['id_user'], 0, 'AW')) {
enterprise_hook('agents_submenu');
}
if (check_acl($config['id_user'], 0, 'NW')) {
enterprise_hook('agents_ncm_submenu');
}
if (check_acl($config['id_user'], 0, 'AW')) {
$sub['gmassive']['text'] = __('Bulk operations');
$sub['gmassive']['id'] = 'Bulk operations';

View File

@ -123,6 +123,11 @@ if ($id_profile || $new_profile) {
$vconsole_edit = 0;
$vconsole_management = 0;
// NCM.
$network_config_view = 0;
$network_config_edit = 0;
$network_config_management = 0;
$page_title = __('Create profile');
} else {
$profile = db_get_row('tperfil', 'id_perfil', $id_profile);
@ -181,13 +186,41 @@ if ($id_profile || $new_profile) {
$vconsole_edit = (bool) $profile['vconsole_edit'];
$vconsole_management = (bool) $profile['vconsole_management'];
// NCM.
$network_config_management = (bool) $profile['network_config_management'];
$network_config_view = (bool) $profile['network_config_view'] || $network_config_management;
$network_config_edit = (bool) $profile['network_config_edit'] || $network_config_management;
$id_audit = db_pandora_audit(
'User management',
'Edit profile '.io_safe_output($name)
);
enterprise_include_once('include/functions_audit.php');
$info = 'Name: '.$name.' Agent view: '.$agent_view.' Agent edit: '.$agent_edit.' Agent disable: '.$agent_disable.' Alert edit: '.$alert_edit.' Alert management: '.$alert_management.' User management: '.$user_management.' DB management: '.$db_management.' Event view: '.$event_view.' Event edit: '.$event_edit.' Event management: '.$event_management.' Report view: '.$report_view.' Report edit: '.$report_edit.' Report management: '.$report_management.' Network map view: '.$map_view.' Network map edit: '.$map_edit.' Network map management: '.$map_management.' Visual console view: '.$vconsole_view.' Visual console edit: '.$vconsole_edit.' Visual console management: '.$vconsole_management.' '.get_product_name().' Management: '.$pandora_management;
$info = 'Name: '.$name;
$info .= ' Agent view: '.$agent_view;
$info .= ' Agent edit: '.$agent_edit;
$info .= ' Agent disable: '.$agent_disable;
$info .= ' Alert edit: '.$alert_edit;
$info .= ' Alert management: '.$alert_management;
$info .= ' User management: '.$user_management;
$info .= ' DB management: '.$db_management;
$info .= ' Event view: '.$event_view;
$info .= ' Event edit: '.$event_edit;
$info .= ' Event management: '.$event_management;
$info .= ' Report view: '.$report_view;
$info .= ' Report edit: '.$report_edit;
$info .= ' Report management: '.$report_management;
$info .= ' Network map view: '.$map_view;
$info .= ' Network map edit: '.$map_edit;
$info .= ' Network map management: '.$map_management;
$info .= ' Visual console view: '.$vconsole_view;
$info .= ' Visual console edit: '.$vconsole_edit;
$info .= ' Visual console management: '.$vconsole_management;
$info .= ' Network config view: '.$network_config_view;
$info .= ' Network config write: '.$network_config_write;
$info .= ' Network config management: '.$network_config_management;
$info .= ' '.get_product_name().' Management: '.$pandora_management;
enterprise_hook('audit_pandora_enterprise', [$id_audit, $info]);
@ -314,6 +347,21 @@ if ($id_profile || $new_profile) {
$disable_option = '';
}
// NCM
$row = [];
$row['name'] = __('View NCM data');
$row['input'] = html_print_checkbox('network_config_view', 1, $network_config_view, true);
$table->data['VR'] = $row;
$row = [];
$row['name'] = __('Operate NCM');
$row['input'] = html_print_checkbox('network_config_edit', 1, $network_config_edit, true, false, 'autoclick_profile_users(\'network_config_edit\', \'network_config_view\', \'false\')');
$table->data['VW'] = $row;
$row = [];
$row['name'] = __('Manage NCM');
$row['input'] = html_print_checkbox('network_config_management', 1, $network_config_management, true, false, 'autoclick_profile_users(\'network_config_management\', \'network_config_view\', \'network_config_edit\')');
$table->data['VM'] = $row;
$table->data[] = '<hr>';
// Users
$row = [];
$row['name'] = __('Manage users');

View File

@ -178,28 +178,36 @@ if ($is_management_allowed === true && ($create_profile === true || $update_prof
$vconsole_edit = (bool) get_parameter('vconsole_edit');
$vconsole_management = (bool) get_parameter('vconsole_management');
// NCM.
$network_config_view = (bool) get_parameter('network_config_view');
$network_config_edit = (bool) get_parameter('network_config_edit');
$network_config_management = (bool) get_parameter('network_config_management');
$values = [
'name' => $name,
'agent_view' => $agent_view,
'agent_edit' => $agent_edit,
'agent_disable' => $agent_disable,
'alert_edit' => $alert_edit,
'alert_management' => $alert_management,
'user_management' => $user_management,
'db_management' => $db_management,
'event_view' => $event_view,
'event_edit' => $event_edit,
'event_management' => $event_management,
'report_view' => $report_view,
'report_edit' => $report_edit,
'report_management' => $report_management,
'map_view' => $map_view,
'map_edit' => $map_edit,
'map_management' => $map_management,
'vconsole_view' => $vconsole_view,
'vconsole_edit' => $vconsole_edit,
'vconsole_management' => $vconsole_management,
'pandora_management' => $pandora_management,
'name' => $name,
'agent_view' => $agent_view,
'agent_edit' => $agent_edit,
'agent_disable' => $agent_disable,
'alert_edit' => $alert_edit,
'alert_management' => $alert_management,
'user_management' => $user_management,
'db_management' => $db_management,
'event_view' => $event_view,
'event_edit' => $event_edit,
'event_management' => $event_management,
'report_view' => $report_view,
'report_edit' => $report_edit,
'report_management' => $report_management,
'map_view' => $map_view,
'map_edit' => $map_edit,
'map_management' => $map_management,
'vconsole_view' => $vconsole_view,
'vconsole_edit' => $vconsole_edit,
'vconsole_management' => $vconsole_management,
'network_config_view' => $network_config_view,
'network_config_edit' => $network_config_edit,
'network_config_management' => $network_config_management,
'pandora_management' => $pandora_management,
];
}
@ -228,6 +236,9 @@ if ($is_management_allowed === true && $update_profile === true) {
"Visual console view":"'.$vconsole_view.'",
"Visual console edit":"'.$vconsole_edit.'",
"Visual console management":"'.$vconsole_management.'",
"NCM view":"'.$network_config_view.'",
"NCM edit":"'.$network_config_edit.'",
"NCM management":"'.$network_config_management.'",
"'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit(
@ -276,6 +287,9 @@ if ($is_management_allowed === true && $create_profile === true) {
"Visual console view":"'.$vconsole_view.'",
"Visual console edit":"'.$vconsole_edit.'",
"Visual console management":"'.$vconsole_management.'",
"NCM view":"'.$network_config_view.'",
"NCM edit":"'.$network_config_edit.'",
"NCM management":"'.$network_config_management.'",
"'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit(
@ -327,6 +341,9 @@ $table->head['MM'] = 'MM';
$table->head['VR'] = 'VR';
$table->head['VW'] = 'VW';
$table->head['VM'] = 'VM';
$table->head['NR'] = 'NR';
$table->head['NW'] = 'NW';
$table->head['NM'] = 'NM';
$table->head['PM'] = 'PM';
if ($is_management_allowed === true) {
$table->head['operations'] = '<span title="Operations">'.__('Op.').'</span>';
@ -354,6 +371,9 @@ $table->size['MM'] = '10px';
$table->size['VR'] = '10px';
$table->size['VW'] = '10px';
$table->size['VM'] = '10px';
$table->size['NR'] = '10px';
$table->size['NW'] = '10px';
$table->size['NM'] = '10px';
$table->size['PM'] = '10px';
if ($is_management_allowed === true) {
$table->size['operations'] = '5%';
@ -401,6 +421,9 @@ foreach ($profiles as $profile) {
$data['VR'] = (empty($profile['vconsole_view']) === false) ? $img : '';
$data['VW'] = (empty($profile['vconsole_edit']) === false) ? $img : '';
$data['VM'] = (empty($profile['vconsole_management']) === false) ? $img : '';
$data['NR'] = (empty($profile['network_config_view']) === false) ? $img : '';
$data['NW'] = (empty($profile['network_config_edit']) === false) ? $img : '';
$data['NM'] = (empty($profile['network_config_management']) === false) ? $img : '';
$data['PM'] = (empty($profile['pandora_management']) === false) ? $img : '';
$table->cellclass[]['operations'] = 'action_buttons';
if ($is_management_allowed === true) {

View File

@ -248,7 +248,11 @@ class CredentialStore extends Wizard
);
} else {
$groups = [ $filter['filter_id_group'] ];
$childrens = groups_get_children($id_group, null, true);
$childrens = groups_get_children(
$filter['filter_id_group'],
null,
true
);
if (!empty($childrens)) {
foreach ($childrens as $child) {
$groups[] = (int) $child['id_grupo'];
@ -353,6 +357,10 @@ class CredentialStore extends Wizard
$return = db_get_all_rows_sql($sql);
if ($return === false) {
$return = [];
}
// Filter out those items of group all that cannot be edited by user.
$return = array_filter(
$return,

View File

@ -425,6 +425,7 @@ define('SERVER_TYPE_SYSLOG', 18);
define('SERVER_TYPE_AUTOPROVISION', 19);
define('SERVER_TYPE_MIGRATION', 20);
define('SERVER_TYPE_ALERT', 21);
define('SERVER_TYPE_NCM', 23);
// REPORTS.
define('REPORT_TOP_N_MAX', 1);

View File

@ -766,7 +766,7 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
if ($value === null) {
$not = (($negative === true) ? 'NOT' : '');
$query .= sprintf('%s IS %s NULL', $field, $negative);
$query .= sprintf('%s IS %s NULL', $field, $not);
} else if (is_int($value) || is_bool($value)) {
$not = (($negative === true) ? '!' : '');
$query .= sprintf('%s %s= %d', $field, $not, $value);
@ -883,7 +883,7 @@ function mysql_db_get_row_sql($sql, $search_history_db=false, $cache=true)
*
* @return mixed Array of the row or false in case of error.
*/
function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false)
function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{
if (empty($fields)) {
$fields = '*';
@ -905,7 +905,7 @@ function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AN
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql, $historydb);
return db_get_row_sql($sql, $historydb, $cache);
}

View File

@ -1041,7 +1041,7 @@ function oracle_db_get_row_sql($sql, $search_history_db=false, $cache=true)
*
* @return mixed Array of the row or false in case of error.
*/
function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='AND')
function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $history_db=false, $cache=true)
{
if (empty($fields)) {
$fields = '*';
@ -1063,7 +1063,7 @@ function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='A
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql);
return db_get_row_sql($sql, $history_db, $cache);
}

View File

@ -750,7 +750,7 @@ function postgresql_db_get_row_sql($sql, $search_history_db=false, $cache=true)
*
* @return mixed Array of the row or false in case of error.
*/
function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND')
function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{
if (empty($fields)) {
$fields = '*';
@ -772,7 +772,7 @@ function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_joi
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql);
return db_get_row_sql($sql, $historydb, $cache);
}

View File

@ -2452,86 +2452,74 @@ function get_acl_column($access)
case 'AR':
return 'agent_view';
break;
case 'AW':
return 'agent_edit';
break;
case 'AD':
return 'agent_disable';
break;
case 'LW':
return 'alert_edit';
break;
case 'LM':
return 'alert_management';
break;
case 'PM':
return 'pandora_management';
break;
case 'DM':
return 'db_management';
break;
case 'UM':
return 'user_management';
break;
case 'RR':
return 'report_view';
break;
case 'RW':
return 'report_edit';
break;
case 'RM':
return 'report_management';
break;
case 'ER':
return 'event_view';
break;
case 'EW':
return 'event_edit';
break;
case 'EM':
return 'event_management';
break;
case 'MR':
return 'map_view';
break;
case 'MW':
return 'map_edit';
break;
case 'MM':
return 'map_management';
break;
case 'VR':
return 'vconsole_view';
break;
case 'VW':
return 'vconsole_edit';
break;
case 'VM':
return 'vconsole_management';
break;
case 'NR':
return 'network_config_view';
case 'NW':
return 'network_config_edit';
case 'NM':
return 'network_config_management';
default:
return '';
break;
}
}
@ -2565,7 +2553,10 @@ function get_users_acl($id_user)
sum(tperfil.map_management) as map_management,
sum(tperfil.vconsole_view) as vconsole_view,
sum(tperfil.vconsole_edit) as vconsole_edit,
sum(tperfil.vconsole_management) as vconsole_management
sum(tperfil.vconsole_management) as vconsole_management,
sum(tperfil.network_config_view) as network_config_view,
sum(tperfil.network_config_edit) as network_config_edit,
sum(tperfil.network_config_management) as network_config_management
FROM tusuario_perfil, tperfil
WHERE tusuario_perfil.id_perfil = tperfil.id_perfil
AND tusuario_perfil.id_usuario = '%s'",

View File

@ -518,24 +518,25 @@ function db_get_row($table, $field_search, $condition, $fields=false, $cache=tru
* @param mixed Fields of the table to retrieve. Can be an array or a coma
* separated string. All fields are retrieved by default
* @param string Condition to join the filters (AND, OR).
* @param boolean $cache Use cache or not.
*
* @return mixed Array of the row or false in case of error.
*/
function db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false)
function db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{
global $config;
switch ($config['dbtype']) {
case 'mysql':
return mysql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb);
return mysql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break;
case 'postgresql':
return postgresql_db_get_row_filter($table, $filter, $fields, $where_join);
return postgresql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break;
case 'oracle':
return oracle_db_get_row_filter($table, $filter, $fields, $where_join);
return oracle_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break;
}

View File

@ -2521,7 +2521,8 @@ function html_print_input_text(
$formTo='',
$onKeyUp='',
$disabled=false,
$list=''
$list='',
$placeholder=null
) {
if ($maxlength == 0) {
$maxlength = 255;
@ -2566,6 +2567,10 @@ function html_print_input_text(
$attr['list'] = $list;
}
if ($list !== null) {
$attr['placeholder'] = $placeholder;
}
return html_print_input_text_extended(
$name,
$value,
@ -4548,7 +4553,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['form']) === true) ? $data['form'] : ''),
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['list']) === true) ? $data['list'] : '')
((isset($data['list']) === true) ? $data['list'] : ''),
((isset($data['placeholder']) === true) ? $data['placeholder'] : '')
);
break;

View File

@ -800,6 +800,19 @@ function servers_get_info($id_server=-1)
$id_modulo = 0;
break;
case SERVER_TYPE_NCM:
$server['img'] = html_print_image(
'images/book_edit.png',
true,
[
'title' => __('NCM server'),
'class' => 'invert_filter',
]
);
$server['type'] = 'ncm';
$id_modulo = 0;
break;
case SERVER_TYPE_AUTOPROVISION:
$server['img'] = html_print_image(
'images/autoprovision.png',

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

File diff suppressed because one or more lines are too long

View File

@ -36,6 +36,13 @@ namespace PandoraFMS;
abstract class Entity
{
/**
* Load from DB or new one.
*
* @var boolean
*/
protected $existsInDB;
/**
* Entity fields (from table).
*
@ -88,6 +95,7 @@ abstract class Entity
$obj->{$k}($v);
}
$obj->existsInDB = true;
return $obj;
}
@ -98,13 +106,15 @@ abstract class Entity
* @param string $table Table.
* @param array|null $filters Filters, for instance ['id' => $id].
* @param string|null $enterprise_class Enterprise class name.
* @param boolean $cache Use cache or not.
*
* @throws \Exception On error.
*/
public function __construct(
string $table,
?array $filters=null,
?string $enterprise_class=null
?string $enterprise_class=null,
bool $cache=true
) {
if (empty($table) === true) {
throw new \Exception(
@ -116,7 +126,14 @@ abstract class Entity
if (is_array($filters) === true) {
// New one.
$data = \db_get_row_filter($this->table, $filters);
$data = \db_get_row_filter(
$this->table,
$filters,
false,
'AND',
false,
$cache
);
if ($data === false) {
throw new \Exception(
@ -128,6 +145,9 @@ abstract class Entity
foreach ($data as $k => $v) {
$this->fields[$k] = $v;
}
// Mark as existing object.
$this->existsInDB = true;
} else {
// Empty one.
$data = \db_get_all_rows_sql(
@ -140,6 +160,9 @@ abstract class Entity
foreach ($data as $row) {
$this->fields[$row['Field']] = null;
}
// Mark as virtual object.
$this->existsInDB = false;
}
if (\enterprise_installed() === true

View File

@ -29,14 +29,16 @@
// Begin.
namespace PandoraFMS;
use HTML;
global $config;
require_once $config['homedir'].'/include/class/HTML.class.php';
/**
* View class.
* View class. Extends HTML to allow print forms and inputs.
*/
class View
class View extends HTML
{

View File

@ -181,3 +181,12 @@ a#qr_code_agent_view {
#safe_mode_module {
margin-top: 0.6em;
}
.no-borders {
border: 0 !important;
}
.no-borders .white_table_graph_header {
border: 0;
padding-left: 0;
}

View File

@ -0,0 +1 @@
.d2h-d-none{display:none}.d2h-wrapper{text-align:left}.d2h-file-header{background-color:#f7f7f7;border-bottom:1px solid #d8d8d8;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;height:35px;padding:5px 10px}.d2h-file-header,.d2h-file-stats{display:-webkit-box;display:-ms-flexbox;display:flex}.d2h-file-stats{font-size:14px;margin-left:auto}.d2h-lines-added{border:1px solid #b4e2b4;border-radius:5px 0 0 5px;color:#399839;padding:2px;text-align:right;vertical-align:middle}.d2h-lines-deleted{border:1px solid #e9aeae;border-radius:0 5px 5px 0;color:#c33;margin-left:1px;padding:2px;text-align:left;vertical-align:middle}.d2h-file-name-wrapper{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:15px;width:100%}.d2h-file-name{overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.d2h-file-wrapper{border:1px solid #ddd;border-radius:3px;margin-bottom:1em}.d2h-file-collapse{-webkit-box-pack:end;-ms-flex-pack:end;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ddd;border-radius:3px;cursor:pointer;display:none;font-size:12px;justify-content:flex-end;padding:4px 8px}.d2h-file-collapse.d2h-selected{background-color:#c8e1ff}.d2h-file-collapse-input{margin:0 4px 0 0}.d2h-diff-table{border-collapse:collapse;font-family:Menlo,Consolas,monospace;font-size:13px;width:100%}.d2h-files-diff{width:100%}.d2h-file-diff{overflow-y:hidden}.d2h-file-side-diff{display:inline-block;margin-bottom:-8px;margin-right:-4px;overflow-x:scroll;overflow-y:hidden;width:50%}.d2h-code-line{padding:0 8em}.d2h-code-line,.d2h-code-side-line{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.d2h-code-side-line{padding:0 4.5em}.d2h-code-line-ctn{word-wrap:normal;background:none;display:inline-block;padding:0;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;vertical-align:middle;white-space:pre;width:100%}.d2h-code-line del,.d2h-code-side-line del{background-color:#ffb6ba}.d2h-code-line del,.d2h-code-line ins,.d2h-code-side-line del,.d2h-code-side-line ins{border-radius:.2em;display:inline-block;margin-top:-1px;text-decoration:none;vertical-align:middle}.d2h-code-line ins,.d2h-code-side-line ins{background-color:#97f295;text-align:left}.d2h-code-line-prefix{word-wrap:normal;background:none;display:inline;padding:0;white-space:pre}.line-num1{float:left}.line-num1,.line-num2{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;padding:0 .5em;text-overflow:ellipsis;width:3.5em}.line-num2{float:right}.d2h-code-linenumber{background-color:#fff;border:solid #eee;border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.3);cursor:pointer;display:inline-block;position:absolute;text-align:right;width:7.5em}.d2h-code-linenumber:after{content:"\200b"}.d2h-code-side-linenumber{background-color:#fff;border:solid #eee;border-width:0 1px;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0,0,0,.3);cursor:pointer;display:inline-block;overflow:hidden;padding:0 .5em;position:absolute;text-align:right;text-overflow:ellipsis;width:4em}.d2h-code-side-linenumber:after{content:"\200b"}.d2h-code-side-emptyplaceholder,.d2h-emptyplaceholder{background-color:#f1f1f1;border-color:#e1e1e1}.d2h-code-line-prefix,.d2h-code-linenumber,.d2h-code-side-linenumber,.d2h-emptyplaceholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d2h-code-linenumber,.d2h-code-side-linenumber{direction:rtl}.d2h-del{background-color:#fee8e9;border-color:#e9aeae}.d2h-ins{background-color:#dfd;border-color:#b4e2b4}.d2h-info{background-color:#f8fafd;border-color:#d5e4f2;color:rgba(0,0,0,.3)}.d2h-file-diff .d2h-del.d2h-change{background-color:#fdf2d0}.d2h-file-diff .d2h-ins.d2h-change{background-color:#ded}.d2h-file-list-wrapper{margin-bottom:10px}.d2h-file-list-wrapper a{color:#3572b0;text-decoration:none}.d2h-file-list-wrapper a:visited{color:#3572b0}.d2h-file-list-header{text-align:left}.d2h-file-list-title{font-weight:700}.d2h-file-list-line{display:-webkit-box;display:-ms-flexbox;display:flex;text-align:left}.d2h-file-list{display:block;list-style:none;margin:0;padding:0}.d2h-file-list>li{border-bottom:1px solid #ddd;margin:0;padding:5px 10px}.d2h-file-list>li:last-child{border-bottom:none}.d2h-file-switch{cursor:pointer;display:none;font-size:10px}.d2h-icon{fill:currentColor;margin-right:10px;vertical-align:middle}.d2h-deleted{color:#c33}.d2h-added{color:#399839}.d2h-changed{color:#d0b44c}.d2h-moved{color:#3572b0}.d2h-tag{background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:10px;margin-left:5px;padding:0 2px}.d2h-deleted-tag{border:1px solid #c33}.d2h-added-tag{border:1px solid #399839}.d2h-changed-tag{border:1px solid #d0b44c}.d2h-moved-tag{border:1px solid #3572b0}

View File

@ -1,25 +1,28 @@
.new_task p,
.new_task b,
.new_task div {
font-size: 1.05em;
}
.new_task p,
.new_task div {
font-weight: inherit;
}
.new_task {
margin-top: 30px;
min-width: 600px;
width: 100%;
left: 20px;
height: 300px;
height: auto;
background-color: #ececec;
border-radius: 3px 3px 3px 3px;
}
div.new_task_cluster {
margin-top: 30px;
left: 20px;
width: 60%;
border-radius: 3px 3px 3px 3px;
}
div.new_task_cluster,
div.new_task_cluster > div {
background-color: #ececec;
clear: both;
display: flex;
flex-direction: row;
padding-top: 1em;
padding-bottom: 5em;
align-items: center;
align-content: center;
}
.title_task {
@ -33,39 +36,20 @@ div.new_task_cluster > div {
}
.image_task {
width: 20%;
min-width: 175px;
height: 100%;
float: left;
}
.image_task_cluster {
width: 20%;
height: 100%;
float: left;
margin-left: 50px;
margin-top: 50px;
margin: auto 35px;
}
.image_task > img {
margin-top: 35%;
margin-left: 15%;
position: relative;
}
.text_task {
flex: 1 1 auto;
width: 70%;
float: left;
height: 100%;
padding-right: 25px;
}
.text_task_cluster {
width: 70%;
height: 100%;
padding-right: 25px;
margin-left: 270px;
padding-top: 10px;
}
.text_task > p {
margin-top: 4%;
}
.button_task {
margin-top: 10px;
@ -76,12 +60,10 @@ div.new_task_cluster > div {
border: none;
}
#description_task {
font-size: 12px;
line-height: 1.8em;
}
#fuerte {
font-size: 12px;
}
.flex-row-baseline * {

View File

@ -0,0 +1,10 @@
span.select2.select2-container.select2-container--default {
max-width: 175px !important;
width: 175px !important;
}
.edit_discovery_input b {
display: flex;
flex-direction: row;
align-items: center;
}

View File

@ -688,6 +688,12 @@ select:-internal-list-box {
align-items: baseline;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.flex-row-vcenter {
display: flex;
flex-direction: row;
@ -746,6 +752,12 @@ select:-internal-list-box {
.padding-right-2-imp {
padding-right: 2em !important;
}
.padding-left-2 {
padding-left: 2em;
}
.padding-left-2-imp {
padding-left: 2em !important;
}
.margin-soft {
margin: 0.3em 1em;
}

View File

@ -1533,6 +1533,11 @@ if ($url_route_analyzer) {
}
}
$ncm_tab = enterprise_hook('networkconfigmanager_console_tab');
if ($ncm_tab === ENTERPRISE_NOT_HOOK) {
$ncm_tab = '';
}
// GIS tab.
$gistab = [];
if ($config['activate_gis']) {
@ -1770,6 +1775,7 @@ $onheader = [
'wux_console' => $wux_console_tab,
'url_route_analyzer' => $url_route_analyzer_tab,
'sap_view' => $saptab,
'ncm_view' => $ncm_tab,
'external_tools' => $external_tools,
];
@ -1941,6 +1947,10 @@ switch ($tab) {
$tab_name = 'SAP View';
break;
case 'ncm':
$tab_name = 'Network configuration';
break;
case 'external_tools':
$tab_name = 'External Tools';
break;
@ -2069,6 +2079,10 @@ switch ($tab) {
include 'general/sap_view.php';
break;
case 'ncm':
enterprise_hook('ncm_agent_tab', [$id_agente, false]);
break;
case 'external_tools':
include 'external_tools.php';
break;

View File

@ -1082,6 +1082,9 @@ CREATE TABLE IF NOT EXISTS `tperfil` (
`vconsole_view` tinyint(1) NOT NULL DEFAULT 0,
`vconsole_edit` tinyint(1) NOT NULL DEFAULT 0,
`vconsole_management` tinyint(1) NOT NULL DEFAULT 0,
`network_config_view`tinyint(1) NOT NULL DEFAULT 0,
`network_config_edit`tinyint(1) NOT NULL DEFAULT 0,
`network_config_management`tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id_perfil`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -4029,3 +4032,95 @@ CREATE TABLE IF NOT EXISTS `tsync_queue` (
`error` MEDIUMTEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_vendor`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_model`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_script`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template_scripts`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_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,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent_data`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -364,7 +364,12 @@ INSERT INTO `tusuario_perfil` (`id_up`, `id_usuario`, `id_perfil`, `id_grupo`, `
-- Dumping data for table `tperfil`
--
INSERT INTO `tperfil` VALUES (1,'Operator&#x20;&#40;Read&#41;',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0),(2,'Operator&#x20;&#40;Write&#41;',1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0),(3,'Chief&#x20;Operator',1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1),(4,'Group&#x20;coordinator',1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1),(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
INSERT INTO `tperfil` VALUES
(1,'Operator&#x20;&#40;Read&#41;',1,0,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0),
(2,'Operator&#x20;&#40;Write&#41;',1,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,0,0),
(3,'Chief&#x20;Operator',1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0),
(4,'Group&#x20;coordinator',1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0),
(5,'Pandora&#x20;Administrator',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
--
-- Dumping data for table `tnews`
@ -2754,3 +2759,32 @@ SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"Size\",\"extra_field_2\":\"FreeSpace\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_wmi_module&#x20;-host&#x20;&quot;_address_&quot;&#x20;-namespace&#x20;&quot;_namespace_wmi_&quot;&#x20;-user&#x20;&quot;_user_wmi_&quot;&#x20;-pass&#x20;&quot;_pass_wmi_&quot;&#x20;-wmiClass&#x20;&quot;_class_wmi_&quot;&#x20;-fieldsList&#x20;&quot;_field_wmi_1_,_field_wmi_2_&quot;&#x20;-queryFilter&#x20;&quot;DeviceID&#x20;=&#x20;&#039;_DeviceID_&#039;&quot;&#x20;-operation&#x20;&quot;&#40;&#40;_f1_&#x20;-&#x20;_f2_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_f1_&quot;&#x20;-wmicPath&#x20;/usr/bin/wmic\",\"value_operation\":\"&#40;&#40;_Size_&#x20;-&#x20;_FreeSpace_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_Size_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__wmi_field\":\"_namespace_wmi_\",\"_field1__wmi_field\":\"_address_\",\"_field4__wmi_field\":\"_pass_wmi_\",\"_field3__wmi_field\":\"_user_wmi_\",\"_field6__wmi_field\":\"_field_wmi_1_,_field_wmi_2_\",\"_field5__wmi_field\":\"_class_wmi_\",\"_field8__wmi_field\":\"&#40;&#40;_f1_&#x20;-&#x20;_f2_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_f1_\",\"_field7__wmi_field\":\"DeviceID&#x20;=&#x20;&#039;_DeviceID_&#039;\",\"field0_wmi_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',2,2,'','',1,'','Win32_LogicalDisk','DeviceID','','{\"scan\":\"DriveType&#x20;=&#x20;3\",\"execution\":\"\",\"field\":\"\",\"key_string\":\"\"}',1);
INSERT IGNORE INTO `tpen` VALUES (171,'dlink','D-Link Systems, Inc.'),(14988,'mikrotik','MikroTik'),(6486,'alcatel','Alcatel-Lucent Enterprise'),(41112,'ubiquiti','Ubiquiti Networks, Inc.'),(207,'telesis','Allied Telesis, Inc.'),(10002,'frogfoot','Frogfoot Networks'),(2,'ibm','IBM'),(4,'unix','Unix'),(63,'apple','Apple Computer, Inc.'),(674,'dell','Dell Inc.'),(111,'oracle','Oracle'),(116,'hitachi','Hitachi, Ltd.'),(173,'netlink','Netlink'),(188,'ascom','Ascom'),(6574,'synology','Synology Inc.'),(3861,'fujitsu','Fujitsu Network Communications, Inc.'),(53526,'dell','Dell ATC'),(52627,'apple','Apple Inc'),(19464,'hitachi','Hitachi Communication Technologies, Ltd.'),(13062,'ascom','Ascom');
INSERT INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT INTO `tncm_model` VALUES (1,1,'7200');
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);

View File

@ -42,30 +42,75 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
@ -75,28 +120,47 @@ class ClassLoader
return array();
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-var array<string, string>
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
@ -111,9 +175,11 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
@ -156,11 +222,13 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@ -204,8 +272,10 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
@ -220,10 +290,12 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
@ -243,6 +315,8 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
@ -265,6 +339,8 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@ -285,6 +361,8 @@ class ClassLoader
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
@ -305,6 +383,8 @@ class ClassLoader
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
@ -324,6 +404,8 @@ class ClassLoader
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
@ -403,6 +485,11 @@ class ClassLoader
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@ -474,6 +561,10 @@ class ClassLoader
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{

View File

@ -330,6 +330,8 @@ return array(
'PandoraFMS\\Enterprise\\Metaconsole\\SyncQueue' => $baseDir . '/enterprise/include/lib/Metaconsole/SyncQueue.php',
'PandoraFMS\\Enterprise\\Metaconsole\\SyncQueueItem' => $baseDir . '/enterprise/include/lib/Metaconsole/SyncQueueItem.php',
'PandoraFMS\\Enterprise\\Metaconsole\\Synchronizer' => $baseDir . '/enterprise/include/lib/Metaconsole/Synchronizer.php',
'PandoraFMS\\Enterprise\\NetworkManager' => $baseDir . '/enterprise/include/lib/NetworkManager.php',
'PandoraFMS\\Enterprise\\NetworkManager\\NetworkAgent' => $baseDir . '/enterprise/include/lib/NetworkManager/NetworkAgent.php',
'PandoraFMS\\Enterprise\\Policy' => $baseDir . '/enterprise/include/lib/Policy.php',
'PandoraFMS\\Enterprise\\Policy\\Inventory' => $baseDir . '/enterprise/include/lib/Policy/Inventory.php',
'PandoraFMS\\Enterprise\\Policy\\Module' => $baseDir . '/enterprise/include/lib/Policy/Module.php',

View File

@ -404,6 +404,8 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa
'PandoraFMS\\Enterprise\\Metaconsole\\SyncQueue' => __DIR__ . '/../..' . '/enterprise/include/lib/Metaconsole/SyncQueue.php',
'PandoraFMS\\Enterprise\\Metaconsole\\SyncQueueItem' => __DIR__ . '/../..' . '/enterprise/include/lib/Metaconsole/SyncQueueItem.php',
'PandoraFMS\\Enterprise\\Metaconsole\\Synchronizer' => __DIR__ . '/../..' . '/enterprise/include/lib/Metaconsole/Synchronizer.php',
'PandoraFMS\\Enterprise\\NetworkManager' => __DIR__ . '/../..' . '/enterprise/include/lib/NetworkManager.php',
'PandoraFMS\\Enterprise\\NetworkManager\\NetworkAgent' => __DIR__ . '/../..' . '/enterprise/include/lib/NetworkManager/NetworkAgent.php',
'PandoraFMS\\Enterprise\\Policy' => __DIR__ . '/../..' . '/enterprise/include/lib/Policy.php',
'PandoraFMS\\Enterprise\\Policy\\Inventory' => __DIR__ . '/../..' . '/enterprise/include/lib/Policy/Inventory.php',
'PandoraFMS\\Enterprise\\Policy\\Module' => __DIR__ . '/../..' . '/enterprise/include/lib/Policy/Module.php',

View File

@ -687,6 +687,15 @@ syslog_max 65535
# Address
# sync_address
# Network manager configuration server (PANDORA FMS ENTERPRISE ONLY).
#ncmserver 1
# Threads for NCM server (PANDORA FMS ENTERPRISE ONLY).
ncmserver_threads 1
# NCM utility to avoid Net::SSH::Expect issues in multi-threaded environments.
ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension
# Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY).
ha_interval 30

View File

@ -562,6 +562,10 @@ sub pandora_load_config {
$pa_config->{"alertserver_threads"} = 1; # 7.0 756
$pa_config->{"alertserver_warn"} = 180; # 7.0 756
$pa_config->{'ncmserver'} = 0; # 7.0 758
$pa_config->{'ncmserver_threads'} = 1; # 7.0 758
$pa_config->{'ncm_ssh_utility'} = '/usr/share/pandora_server/util/ncm_ssh_extension'; # 7.0 758
# Check for UID0
if ($pa_config->{"quiet"} != 0){
if ($> == 0){
@ -1278,6 +1282,15 @@ sub pandora_load_config {
elsif ($parametro =~ m/^alertserver_warn\s+([0-9]*)/i) {
$pa_config->{'alertserver_warn'}= clean_blank($1);
}
elsif ($parametro =~ m/^ncmserver\s+([0-9]*)/i){
$pa_config->{'ncmserver'}= clean_blank($1);
}
elsif ($parametro =~ m/^ncmserver_threads\s+([0-9]*)/i) {
$pa_config->{'ncmserver_threads'}= clean_blank($1);
}
elsif ($parametro =~ m/^ncm_ssh_utility\s+(.*)/i) {
$pa_config->{'ncm_ssh_utility'}= clean_blank($1);
}
# Pandora HA extra
elsif ($parametro =~ m/^ha_file\s(.*)/i) {

View File

@ -77,6 +77,7 @@ our @EXPORT = qw(
WUXSERVER
PROVISIONINGSERVER
MIGRATIONSERVER
NCMSERVER
METACONSOLE_LICENSE
OFFLINE_LICENSE
DISCOVERY_HOSTDEVICES
@ -191,6 +192,7 @@ use constant SYSLOGSERVER => 18;
use constant PROVISIONINGSERVER => 19;
use constant MIGRATIONSERVER => 20;
use constant ALERTSERVER => 21;
use constant NCMSERVER => 23;
# Module status
use constant MODULE_NORMAL => 0;

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) {