diff --git a/pandora_console/extras/mr/50.sql b/pandora_console/extras/mr/50.sql index f28fdaae07..57e3de353e 100644 --- a/pandora_console/extras/mr/50.sql +++ b/pandora_console/extras/mr/50.sql @@ -19,6 +19,10 @@ 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, @@ -90,4 +94,31 @@ CREATE TABLE IF NOT EXISTS `tncm_agent_data` ( 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 _enablepass_ exit'), + (2,1,'enable expect:Password:\s* _enablepass_ term length 0 capture:show running-config exit '), + (3,2,'enable expect:Password:\s* _enablepass_ term length 0 config terminal _applyconfigbackup_ exit '), + (4,3,'enable expect:Password:\s* _enablepass_ term length 0 capture:show version | i IOS Software exit '), + (5,5,'enable expect:Password:\s* _enablepass_ term length 0 config term end end exit '); + COMMIT; 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 38f84f85fe..59accb2096 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 @@ -4078,6 +4078,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` -- ----------------------------------------------------- @@ -4184,3 +4188,31 @@ CREATE TABLE IF NOT EXISTS `tncm_agent_data` ( `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 _enablepass_ exit'), + (2,1,'enable expect:Password:\s* _enablepass_ term length 0 capture:show running-config exit '), + (3,2,'enable expect:Password:\s* _enablepass_ term length 0 config terminal _applyconfigbackup_ exit '), + (4,3,'enable expect:Password:\s* _enablepass_ term length 0 capture:show version | i IOS Software exit '), + (5,5,'enable expect:Password:\s* _enablepass_ term length 0 config term end end exit '); diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index 44ef0e6a1e..3816d984a3 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -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,39 @@ if ($id_profile || $new_profile) { $vconsole_edit = (bool) $profile['vconsole_edit']; $vconsole_management = (bool) $profile['vconsole_management']; + // NCM. + $networ_config_view = (bool) $profile['network_config_view']; + $networ_config_edit = (bool) $profile['network_config_edit']; + $network_config_management = (bool) $profile['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 management: '.$network_config_management; + $info .= ' '.get_product_name().' Management: '.$pandora_management; enterprise_hook('audit_pandora_enterprise', [$id_audit, $info]); @@ -314,6 +345,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[] = '
'; + // Users $row = []; $row['name'] = __('Manage users'); diff --git a/pandora_console/godmode/users/profile_list.php b/pandora_console/godmode/users/profile_list.php index 87b0c9c35d..1ee700c989 100644 --- a/pandora_console/godmode/users/profile_list.php +++ b/pandora_console/godmode/users/profile_list.php @@ -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'] = ''.__('Op.').''; @@ -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) { diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 414b16919d..a1d09d9148 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -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); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index fe79e1420f..19249b1378 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2446,86 +2446,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; } } @@ -2559,7 +2547,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'", diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index b8d7d4926c..45c3b2508f 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -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', diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index a0b5e6dba9..0b7d4e4d41 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -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; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 9cc46c1e1d..b76ec61c37 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -2754,3 +2754,31 @@ 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 -host "_address_" -namespace "_namespace_wmi_" -user "_user_wmi_" -pass "_pass_wmi_" -wmiClass "_class_wmi_" -fieldsList "_field_wmi_1_,_field_wmi_2_" -queryFilter "DeviceID = '_DeviceID_'" -operation "((_f1_ - _f2_) * 100) / _f1_" -wmicPath /usr/bin/wmic\",\"value_operation\":\"((_Size_ - _FreeSpace_) * 100) / _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\":\"((_f1_ - _f2_) * 100) / _f1_\",\"_field7__wmi_field\":\"DeviceID = '_DeviceID_'\",\"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 = 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 _enablepass_ exit'), + (2,1,'enable expect:Password:\s* _enablepass_ term length 0 capture:show running-config exit '), + (3,2,'enable expect:Password:\s* _enablepass_ term length 0 config terminal _applyconfigbackup_ exit '), + (4,3,'enable expect:Password:\s* _enablepass_ term length 0 capture:show version | i IOS Software exit '), + (5,5,'enable expect:Password:\s* _enablepass_ term length 0 config term end end exit '); + diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 12b349cc49..ee042ffd36 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -693,6 +693,9 @@ syslog_max 65535 # 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 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 80082fbde7..4572dbabb8 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -563,7 +563,8 @@ sub pandora_load_config { $pa_config->{"alertserver_warn"} = 180; # 7.0 756 $pa_config->{'ncmserver'} = 0; # 7.0 758 - $pa_config->{'ncm_threads'} = 1; # 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){ @@ -1284,8 +1285,11 @@ sub pandora_load_config { elsif ($parametro =~ m/^ncmserver\s+([0-9]*)/i){ $pa_config->{'ncmserver'}= clean_blank($1); } - elsif ($parametro =~ m/^ncm_threads\s+([0-9]*)/i) { - $pa_config->{'ncm_threads'}= 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