diff --git a/CHANGELOG.md b/CHANGELOG.md index b835687d..70f1851c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # 版本发布日志 +## 2.2407.2-20240712 + +- 修复 网元版本安装MME写入host文件ip错误 +- 修复 支持kvdb依赖包安装,默认带的adb改为kvdb +- 修复 网元版本安装命令终止符判断#$ +- 更新 CNType0表示禁止接入NA +- 修复 文件复制到本地时创建文件目录避免路径错误 + ## 2.2407.1-20240704 - 修复 网元版本安装MME修改S6A地址为MME_IP diff --git a/captrace/makefile b/captrace/makefile index f14a807d..d1cd8cb9 100644 --- a/captrace/makefile +++ b/captrace/makefile @@ -1,7 +1,7 @@ # Makefile for rest agent project PROJECT = OMC -VERSION = 2.2407.1 +VERSION = 2.2407.2 PLATFORM = amd64 ARMPLATFORM = aarch64 BUILDDIR = ../../build diff --git a/config/param/upf_param_config.yaml b/config/param/upf_param_config.yaml index 6164d36b..b5fc23ee 100644 --- a/config/param/upf_param_config.yaml +++ b/config/param/upf_param_config.yaml @@ -311,6 +311,27 @@ upf: filter: '' display: "RX TX Queue Num" comment: "" + - name: "useSocket" + type: "int" + value: "0" + access: "read-write" + filter: '0~1' + display: "Use Socket" + comment: "data rx&tx use C socket" + - name: "enableTap" + type: "int" + value: "0" + access: "read-write" + filter: '0~1' + display: "Enable Tap" + comment: "Enable 5G ethernet LAN" + - name: "enableQer" + type: "int" + value: "0" + access: "read-write" + filter: '0~1' + display: "Enable Qer" + comment: "Enable PFCP Qer Control" dataForwarderUpfd: display: "Data Forwarder Upfd" list: diff --git a/crontask/makefile b/crontask/makefile index 2896e72b..c18cd4ae 100644 --- a/crontask/makefile +++ b/crontask/makefile @@ -1,7 +1,7 @@ # Makefile for OMC-OMC-crontask project PROJECT = OMC -VERSION = 2.2407.1 +VERSION = 2.2407.2 LIBDIR = be.ems/lib BINNAME = crontask diff --git a/database/common/mml_command.sql b/database/common/mml_command.sql index f95f7440..3612490c 100644 --- a/database/common/mml_command.sql +++ b/database/common/mml_command.sql @@ -43,7 +43,7 @@ INSERT INTO `mml_command` VALUES (1594, 'OMC', 'neManagement', 'Network Element INSERT INTO `mml_command` VALUES (1595, 'OMC', 'neManagement', 'Network Element Management', 'add', 'neinfo', 'Add Network Element', '[{\"alias\":\"ne_type\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"netype\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"neid\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"rm_uid\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"Resource management UID\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"rmuid\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"ip\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"IP address\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"ip\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"port\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"Port\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"port\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"ne_name\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"NE name\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"nename\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"pv_flag\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"PV flag\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"pvflag\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active'); INSERT INTO `mml_command` VALUES (1596, 'OMC', 'neManagement', 'Network Element Management', 'mod', 'neinfo', 'Modify Network Element', '[{\"alias\":\"ne_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"netype\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"neid\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"rm_uid\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"Resource management UID\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"rmuid\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ip\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"IP address\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"ip\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"port\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"Port\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"port\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ne_name\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"NE name\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"nename\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"pv_flag\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"PV flag\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"pvflag\",\"optional\":\"true\",\"type\":\"string\"}]', 'Active'); INSERT INTO `mml_command` VALUES (1597, 'OMC', 'neManagement', 'Network Element Management', 'del', 'neinfo', 'Delete Network Element', '[{\"alias\":\"ne_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"name\":\"netype\",\"optional\":\"false\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"name\":\"neid\",\"optional\":\"false\",\"type\":\"string\"}]', 'Active'); -INSERT INTO `mml_command` VALUES (1598, 'OMC', 'neConfigManagement', 'NE Config Parameter Management', 'dsp', 'neconfig', 'Display NE Config Parameter', '[{\"alias\":\"ne_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"netype\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"neid\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"top_tag\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Parameter tag\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"tag\",\"optional\":\"true\",\"type\":\"string\"}]', 'Active'); +INSERT INTO `mml_command` VALUES (1598, 'OMC', 'neConfigManagement', 'NE Config Parameter Management', 'dsp', 'neconfig', 'Display NE Config Parameter', '[{\"alias\":\"ne_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"netype\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"neid\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"top_tag\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Parameter tag\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"tag\",\"optional\":\"true\",\"type\":\"string\"}]', 'Inactive'); INSERT INTO `mml_command` VALUES (1599, 'OMC', 'faultManagement', 'Fault Management', 'dsp', 'alarm', 'Display Alarm Information', '[{\"alias\":\"ne_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"netype\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ne_id\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE UID\",\"filter\":\"\",\"loc\":\"true\",\"name\":\"neid\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"ne_name\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"NE name\",\"filter\":\"\",\"name\":\"nename\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"alarm_code\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Alarm code\",\"filter\":\"\",\"name\":\"alarmcode\",\"optional\":\"true\",\"type\":\"int\"},{\"alias\":\"orig_severity\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Original severity\",\"filter\":\"{\\\"Critical\\\":\\\"Critical\\\",\\\"Major\\\":\\\"Major\\\",\\\"Minor\\\":\\\"Minor\\\",\\\"Warning\\\":\\\"Warning\\\",\\\"Event\\\":\\\"Event\\\"}\",\"name\":\"origseverity\",\"optional\":\"true\",\"type\":\"enum\"},{\"alias\":\"pv_flag\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"PV flag\",\"filter\":\"\",\"name\":\"pvflag\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"event_time\\u003e\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Alarm event start time\",\"filter\":\"\",\"name\":\"starttime\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"event_time\\u003c\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Alarm event end time\",\"filter\":\"\",\"name\":\"endtime\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"alarm_type\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Alarm type\",\"filter\":\"{\\\"CommunicationAlarm\\\":\\\"CommunicationAlarm\\\",\\\"EquipmentAlarm\\\":\\\"EquipmentAlarm\\\",\\\"ProcessingFailure\\\":\\\"ProcessingFailure\\\",\\\"EnvironmentalAlarm\\\":\\\"EnvironmentalAlarm\\\",\\\"QualityOfServiceAlarm\\\":\\\"QualityOfServiceAlarm\\\"}\",\"name\":\"alarmtype\",\"optional\":\"true\",\"type\":\"enum\"},{\"alias\":\"alarm_status\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Alarm status\",\"filter\":\"\",\"name\":\"alarmstatus\",\"optional\":\"true\",\"type\":\"int\"}]', 'Active'); INSERT INTO `mml_command` VALUES (1600, 'OMC', 'systemCommand', 'Linux System Command', 'run', 'shell', 'Run Shell Command', '[{\"alias\":\"cmd\",\"apostr\":\"true\",\"comment\":\"\",\"display\":\"Shell command\",\"filter\":\"\",\"loc\":\"false\",\"name\":\"cmd\",\"optional\":\"false\",\"type\":\"string\"}]', 'Inactive'); INSERT INTO `mml_command` VALUES (1601, 'OMC', 'licenseManagement', 'License Management', 'dsp', 'licenseinfo', 'Display NE License Information', '[{\"alias\":\"neType\",\"apostr\":\"false\",\"comment\":\"\",\"display\":\"NE type\",\"filter\":\"\",\"name\":\"netype\",\"optional\":\"true\",\"type\":\"string\"},{\"alias\":\"neId\",\"comment\":\"\",\"display\":\"NE ID\",\"filter\":\"\",\"name\":\"neid\",\"optional\":\"true\",\"type\":\"string\"}]', 'Inactive'); diff --git a/database/common/param_config.sql b/database/common/param_config.sql index 6d4ef7e3..74f90968 100644 --- a/database/common/param_config.sql +++ b/database/common/param_config.sql @@ -83,12 +83,13 @@ INSERT INTO `param_config` VALUES (1661, 'MME', '', 'sgw', 'SGW List', '', '{\"a INSERT INTO `param_config` VALUES (1662, 'MME', '', 'pgw', 'PGW List', '', '{\"array\":[{\"access\":\"read\",\"comment\":\"0~15\",\"display\":\"Index\",\"filter\":\"0~15\",\"name\":\"index\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"^[0-9]{5,6}$\",\"display\":\"PLMN ID\",\"filter\":\"^[0-9]{5,6}$\",\"name\":\"plmnId\",\"type\":\"regex\",\"value\":\"00101\"},{\"access\":\"read-write\",\"comment\":\"0~128\",\"display\":\"APN\",\"filter\":\"0~128\",\"name\":\"apn\",\"type\":\"string\",\"value\":\"internet\"},{\"access\":\"read-write\",\"comment\":\"0~64\",\"display\":\"PGW IP\",\"filter\":\"0~64\",\"name\":\"pgwIp\",\"type\":\"string\",\"value\":\"192.168.1.181\"}]}'); INSERT INTO `param_config` VALUES (1663, 'MME', '', 'amf', 'AMF List', '', '{\"array\":[{\"access\":\"read\",\"comment\":\"0~15\",\"display\":\"Index\",\"filter\":\"0~15\",\"name\":\"index\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"^[0-9]{5,6}$\",\"display\":\"PLMN ID\",\"filter\":\"^[0-9]{5,6}$\",\"name\":\"plmnId\",\"type\":\"regex\",\"value\":\"00101\"},{\"access\":\"read-write\",\"comment\":\"0~16777215\",\"display\":\"TAC\",\"filter\":\"0~16777215\",\"name\":\"tac\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"0~255\",\"display\":\"Region ID\",\"filter\":\"0~255\",\"name\":\"regionId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"0~1023\",\"display\":\"Set ID\",\"filter\":\"0~1023\",\"name\":\"setId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"0~63\",\"display\":\"Pointer\",\"filter\":\"0~63\",\"name\":\"pointer\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"0~64\",\"display\":\"AMF IP\",\"filter\":\"0~64\",\"name\":\"amfIp\",\"type\":\"string\",\"value\":\"172.16.5.120\"}]}'); +-- UPF 更新时间2024/07/15 14:30 INSERT INTO `param_config` VALUES (1681, 'UPF', '', 'general', 'General', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Config File Directory\",\"filter\":\"\",\"name\":\"configFileDirectory\",\"type\":\"string\",\"value\":\"/usr/local/etc/upf/\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"EXE File Directory\",\"filter\":\"\",\"name\":\"exeFileDirectory\",\"type\":\"string\",\"value\":\"/usr/local/bin/\"},{\"access\":\"read-write\",\"comment\":\"1~255\",\"display\":\"System ID\",\"filter\":\"\",\"name\":\"systemId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"1~8\",\"display\":\"Data Forwarder Number\",\"filter\":\"1~8\",\"name\":\"dataForwarderNum\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Common Statistic Interval\",\"filter\":\"\",\"name\":\"commonStatisticInterval\",\"type\":\"int\",\"value\":\"60\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"User Statistic Interval\",\"filter\":\"\",\"name\":\"userStatisticInterval\",\"type\":\"int\",\"value\":\"60\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"RX N3 OverLoad Threshold Mbps\",\"filter\":\"\",\"name\":\"rxN3OverLoadThresholdMbps\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"RX N6 OverLoad Threshold Mbps\",\"filter\":\"\",\"name\":\"rxN6OverLoadThresholdMbps\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"0~255\",\"display\":\"Checksum Offload\",\"filter\":\"0~255\",\"name\":\"checksumOffload\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Max Downlink Buffer Num\",\"filter\":\"\",\"name\":\"maxDownlinkBufferNum\",\"type\":\"int\",\"value\":\"50\"}]}'); INSERT INTO `param_config` VALUES (1682, 'UPF', '', 'logger', 'Logger', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Log File Full Path\",\"filter\":\"\",\"name\":\"logFileFullPath\",\"type\":\"string\",\"value\":\"/var/log/upf.log\"},{\"access\":\"read-write\",\"comment\":\"error|warning|info|debug\",\"display\":\"Log Level\",\"filter\":\"\",\"name\":\"logLevel\",\"type\":\"string\",\"value\":\"error\"},{\"access\":\"read-write\",\"comment\":\"error|warning|info|debug\",\"display\":\"Upfd Log Level\",\"filter\":\"\",\"name\":\"upfdLogLevel\",\"type\":\"string\",\"value\":\"error\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Upfd Log Transfer\",\"filter\":\"\",\"name\":\"upfdLogTransfer\",\"type\":\"bool\",\"value\":\"false\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Report Caller\",\"filter\":\"\",\"name\":\"reportCaller\",\"type\":\"bool\",\"value\":\"false\"}]}'); INSERT INTO `param_config` VALUES (1683, 'UPF', '', 'pfcp', 'PFCP', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"ipv4|ipv6|ipv46\",\"display\":\"IP Type\",\"filter\":\"\",\"name\":\"ipType\",\"type\":\"string\",\"value\":\"ipv4\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Local IPv4\",\"filter\":\"\",\"name\":\"localIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Local IPv6\",\"filter\":\"\",\"name\":\"localIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"1~65535\",\"display\":\"Local UDP Port\",\"filter\":\"1~65535\",\"name\":\"localUdpPort\",\"type\":\"int\",\"value\":\"8805\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"SMF IPv4\",\"filter\":\"\",\"name\":\"smfIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"SMF IPv6\",\"filter\":\"\",\"name\":\"smfIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"1~65535\",\"display\":\"SMF UDP Port\",\"filter\":\"1~65535\",\"name\":\"smfUdpPort\",\"type\":\"int\",\"value\":\"8805\"},{\"access\":\"read-write\",\"comment\":\"1~255\",\"display\":\"Retry Interval\",\"filter\":\"1~255\",\"name\":\"retryInterval\",\"type\":\"int\",\"value\":\"2\"},{\"access\":\"read-write\",\"comment\":\"0~255\",\"display\":\"Max Retry\",\"filter\":\"0~255\",\"name\":\"maxRetry\",\"type\":\"int\",\"value\":\"3\"},{\"access\":\"read-write\",\"comment\":\"1~255\",\"display\":\"Heartbeat Interval\",\"filter\":\"1~255\",\"name\":\"heartbeatInterval\",\"type\":\"int\",\"value\":\"15\"}]}'); INSERT INTO `param_config` VALUES (1684, 'UPF', '', 'telnet', 'Telnet', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Enabled\",\"filter\":\"\",\"name\":\"enabled\",\"type\":\"bool\",\"value\":\"false\"},{\"access\":\"read-write\",\"comment\":\"ipv4|ipv6|ipv46\",\"display\":\"IP Type\",\"filter\":\"\",\"name\":\"ipType\",\"type\":\"string\",\"value\":\"ipv4\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Local IPv4\",\"filter\":\"\",\"name\":\"localIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Local IPv6\",\"filter\":\"\",\"name\":\"localIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"1~65535\",\"display\":\"Local Port\",\"filter\":\"1~65535\",\"name\":\"localPort\",\"type\":\"int\",\"value\":\"4100\"}]}'); INSERT INTO `param_config` VALUES (1685, 'UPF', '', 'redisDb', 'Redis DB', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Enabled\",\"filter\":\"\",\"name\":\"enabled\",\"type\":\"bool\",\"value\":\"false\"},{\"access\":\"read-write\",\"comment\":\"tcp|udp\",\"display\":\"Net Type\",\"filter\":\"\",\"name\":\"netType\",\"type\":\"string\",\"value\":\"tcp\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Server Address\",\"filter\":\"\",\"name\":\"serverAddr\",\"type\":\"string\",\"value\":\"0.0.0.0:0\"}]}'); -INSERT INTO `param_config` VALUES (1686, 'UPF', '', 'dataForwarderCommon', 'Data Forwarder Common', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"upfd|tun\",\"display\":\"Type\",\"filter\":\"\",\"name\":\"type\",\"type\":\"string\",\"value\":\"upfd\"},{\"access\":\"read-only\",\"comment\":\"1~8\",\"display\":\"Instance ID\",\"filter\":\"1~8\",\"name\":\"instanceId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"1~255\",\"display\":\"Main CPU\",\"filter\":\"1~255\",\"name\":\"mainCpu\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"2,3,4,5 or 2-5\",\"display\":\"CPU Workers\",\"filter\":\"\",\"name\":\"cpuWorkers\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"data forwarder already run or not\",\"display\":\"Is Run\",\"filter\":\"0~1\",\"name\":\"isRun\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"Hot Standby work or not\",\"display\":\"Is Hot Standby\",\"filter\":\"0~1\",\"name\":\"isHotStandby\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"The value from which TEID is allocated\",\"display\":\"TEID Start\",\"filter\":\"\",\"name\":\"teidStart\",\"type\":\"int\",\"value\":\"16777216\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"N3 Heartbeat Interval\",\"filter\":\"\",\"name\":\"n3HeartbeatInterval\",\"type\":\"int\",\"value\":\"30\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"RX TX Queue Num\",\"filter\":\"\",\"name\":\"rxTxQueueNum\",\"type\":\"int\",\"value\":\"1\"}]}'); +INSERT INTO `param_config` VALUES (1686, 'UPF', '', 'dataForwarderCommon', 'Data Forwarder Common', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"upfd|tun\",\"display\":\"Type\",\"filter\":\"\",\"name\":\"type\",\"type\":\"string\",\"value\":\"upfd\"},{\"access\":\"read-only\",\"comment\":\"1~8\",\"display\":\"Instance ID\",\"filter\":\"1~8\",\"name\":\"instanceId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"1~255\",\"display\":\"Main CPU\",\"filter\":\"1~255\",\"name\":\"mainCpu\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"2,3,4,5 or 2-5\",\"display\":\"CPU Workers\",\"filter\":\"\",\"name\":\"cpuWorkers\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"data forwarder already run or not\",\"display\":\"Is Run\",\"filter\":\"0~1\",\"name\":\"isRun\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"Hot Standby work or not\",\"display\":\"Is Hot Standby\",\"filter\":\"0~1\",\"name\":\"isHotStandby\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"The value from which TEID is allocated\",\"display\":\"TEID Start\",\"filter\":\"\",\"name\":\"teidStart\",\"type\":\"int\",\"value\":\"16777216\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"N3 Heartbeat Interval\",\"filter\":\"\",\"name\":\"n3HeartbeatInterval\",\"type\":\"int\",\"value\":\"30\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"RX TX Queue Num\",\"filter\":\"\",\"name\":\"rxTxQueueNum\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"data rx\\u0026tx use C socket\",\"display\":\"Use Socket\",\"filter\":\"0~1\",\"name\":\"useSocket\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"Enable 5G ethernet LAN\",\"display\":\"Enable Tap\",\"filter\":\"0~1\",\"name\":\"enableTap\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"Enable PFCP Qer Control\",\"display\":\"Enable Qer\",\"filter\":\"0~1\",\"name\":\"enableQer\",\"type\":\"int\",\"value\":\"0\"}]}'); INSERT INTO `param_config` VALUES (1687, 'UPF', '', 'dataForwarderUpfd', 'Data Forwarder Upfd', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"Currently only support vfio-pci\",\"display\":\"UIO Driver\",\"filter\":\"\",\"name\":\"uioDriver\",\"type\":\"string\",\"value\":\"vfio-pci\"},{\"access\":\"read-write\",\"comment\":\"The format must be IP:Port\",\"display\":\"Telnet Address IP:Port\",\"filter\":\"\",\"name\":\"commandlineListen\",\"type\":\"string\",\"value\":\"localhost:5002\"},{\"access\":\"read-write\",\"comment\":\"the unit is GB\",\"display\":\"Heap Size GB\",\"filter\":\"1~8\",\"name\":\"heapSizeGB\",\"type\":\"int\",\"value\":\"2\"},{\"access\":\"read-write\",\"comment\":\"the unit is MB\",\"display\":\"State Seg Size MB\",\"filter\":\"64~512\",\"name\":\"stateSegSizeMB\",\"type\":\"int\",\"value\":\"256\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK No PCI\",\"filter\":\"0~1\",\"name\":\"dpdkNoPci\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Mem Channel Num\",\"filter\":\"0~128\",\"name\":\"memChannelNum\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Session Base Va\",\"filter\":\"\",\"name\":\"sessionBaseVa\",\"type\":\"string\",\"value\":\"0x2000000000\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Buffers Per Numa\",\"filter\":\"\",\"name\":\"buffersPerNuma\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"N3 RSS Hash\",\"filter\":\"\",\"name\":\"n3RssHash\",\"type\":\"string\",\"value\":\"\"}]}'); INSERT INTO `param_config` VALUES (1688, 'UPF', '', 'dataInterfaceList', 'Data Interface List', '', '{\"array\":[{\"access\":\"read-only\",\"comment\":\"1~32\",\"display\":\"Index\",\"filter\":\"1~32\",\"name\":\"index\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"N3|N6|N9|N19\",\"display\":\"Interface Type\",\"filter\":\"\",\"name\":\"interfaceType\",\"type\":\"string\",\"value\":\"N3\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Interface ID\",\"filter\":\"1~32\",\"name\":\"interfaceId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"host|vmxnet3|dpdk|socket|uds\",\"display\":\"Driver Type\",\"filter\":\"\",\"name\":\"driverType\",\"type\":\"string\",\"value\":\"host\"},{\"access\":\"read-write\",\"comment\":\"ipv4|ipv6|ipv4v6\",\"display\":\"IP Type\",\"filter\":\"\",\"name\":\"ipType\",\"type\":\"string\",\"value\":\"ipv4\"},{\"access\":\"read-write\",\"array\":[{\"access\":\"read-only\",\"comment\":\"1~8\",\"display\":\"Index\",\"filter\":\"1~8\",\"name\":\"index\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"IPv4\",\"display\":\"IPv4\",\"filter\":\"\",\"name\":\"ipv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv4 Mask\",\"filter\":\"\",\"name\":\"ipv4Mask\",\"type\":\"string\",\"value\":\"0.0.0.0\"}],\"comment\":\"\",\"display\":\"IPv4 Address List\",\"filter\":\"0~8\",\"name\":\"ipv4AddrList\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"array\":[{\"access\":\"read-only\",\"comment\":\"1~8\",\"display\":\"Index\",\"filter\":\"1~8\",\"name\":\"index\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv6\",\"filter\":\"\",\"name\":\"ipv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv6 Prefix\",\"filter\":\"\",\"name\":\"ipv6Prefix\",\"type\":\"int\",\"value\":\"64\"}],\"comment\":\"\",\"display\":\"IPv6 Address List\",\"filter\":\"0~8\",\"name\":\"ipv6AddrList\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"MAC Address\",\"filter\":\"\",\"name\":\"macAddr\",\"type\":\"string\",\"value\":\"00:00:00:00:00:00\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Interface PCI\",\"filter\":\"\",\"name\":\"interfacePCI\",\"type\":\"string\",\"value\":\"0000:00:00.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"System Network Card Name\",\"filter\":\"\",\"name\":\"systemNetworkCardName\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Gateway IPv4\",\"filter\":\"\",\"name\":\"gatewayIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"null|bak|sub|xor|round|lacp\",\"display\":\"Bond Type\",\"filter\":\"\",\"name\":\"bondType\",\"type\":\"string\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Bond ID\",\"filter\":\"0~32\",\"name\":\"bondId\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"BFD TX Interval Ms\",\"filter\":\"\",\"name\":\"bfdTxIntervalMs\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"BFD RX Interval Ms\",\"filter\":\"\",\"name\":\"bfdRxIntervalMs\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DNN Name\",\"filter\":\"\",\"name\":\"dnnName\",\"type\":\"string\",\"value\":\"default\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Gateway IPv6\",\"filter\":\"\",\"name\":\"gatewayIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"BFD Gateway IPv4\",\"filter\":\"\",\"name\":\"bfdGatewayIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"BFD Gateway IPv6\",\"filter\":\"\",\"name\":\"bfdGatewayIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"MTU\",\"filter\":\"0~65535\",\"name\":\"mtu\",\"type\":\"int\",\"value\":\"1500\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Vlan ID Min\",\"filter\":\"\",\"name\":\"vlanIdMin\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Vlan ID Max\",\"filter\":\"\",\"name\":\"vlanIdMax\",\"type\":\"int\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UDP Src Port\",\"filter\":\"1~65535\",\"name\":\"udpSrcPort\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UDP Listen Port\",\"filter\":\"0~65536\",\"name\":\"udpListenPort\",\"type\":\"int\",\"value\":\"2152\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UDS Local File Full Path\",\"filter\":\"\",\"name\":\"udsLocalFileFullPath\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UDS Remote File Full Path\",\"filter\":\"\",\"name\":\"udsRemoteFileFullPath\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Link Detection Type\",\"filter\":\"0~1\",\"name\":\"linkDetectionType\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"NAT Interface ID\",\"filter\":\"0~1\",\"name\":\"natInterfaceId\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv4\",\"filter\":\"\",\"name\":\"ueIpv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UE IPv4 Mask\",\"filter\":\"\",\"name\":\"ueIpv4Mask\",\"type\":\"string\",\"value\":\"255.255.255.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UE IPv6\",\"filter\":\"\",\"name\":\"ueIpv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UE IPv6 Prefix\",\"filter\":\"1~128\",\"name\":\"ueIpv6Prefix\",\"type\":\"int\",\"value\":\"64\"},{\"access\":\"read-write\",\"array\":[{\"access\":\"read-only\",\"comment\":\"1~32\",\"display\":\"Index\",\"filter\":\"1~32\",\"name\":\"index\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv4\",\"filter\":\"\",\"name\":\"ipv4\",\"type\":\"string\",\"value\":\"0.0.0.0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv4 Mask\",\"filter\":\"\",\"name\":\"ipv4Mask\",\"type\":\"string\",\"value\":\"0.0.0.0\"}],\"comment\":\"\",\"display\":\"GTPU Remote IPv4 Pool List\",\"filter\":\"1~32\",\"name\":\"gtpuRemoteIpv4PoolList\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"array\":[{\"access\":\"read-only\",\"comment\":\"1~32\",\"display\":\"Index\",\"filter\":\"1~32\",\"name\":\"index\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv6\",\"filter\":\"\",\"name\":\"ipv6\",\"type\":\"string\",\"value\":\"\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IPv6 Prefix\",\"filter\":\"\",\"name\":\"ipv6Prefix\",\"type\":\"int\",\"value\":\"64\"}],\"comment\":\"\",\"display\":\"GTPU Remote IPv6 Pool List\",\"filter\":\"0~32\",\"name\":\"gtpuRemoteIpv6PoolList\",\"type\":\"int\",\"value\":\"1\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"GTPU Signaling Handle\",\"filter\":\"0~1\",\"name\":\"gtpuSignalingHandle\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"IMS Default DSCP Value\",\"filter\":\"0~1\",\"name\":\"imsDefaultDSCPValue\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Data Default DSCP Value\",\"filter\":\"0~1\",\"name\":\"dataDefaultDSCPValue\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Inner DSCP Value Map\",\"filter\":\"0~1\",\"name\":\"innerDSCPValueMap\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Max Support Speed Mbps\",\"filter\":\"0~65536\",\"name\":\"maxSupportSpeedMbps\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK RX Queues Number\",\"filter\":\"0~127\",\"name\":\"dpdkRxQueuesNumber\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK TX Queues Number\",\"filter\":\"0~127\",\"name\":\"dpdkTxQueuesNumber\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK RX Desc Number\",\"filter\":\"0~32768\",\"name\":\"dpdkRxDescNumber\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK TX Desc Number\",\"filter\":\"0~32768\",\"name\":\"dpdkTxDescNumber\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"DPDK Workers\",\"filter\":\"\",\"name\":\"dpdkworkers\",\"type\":\"string\",\"value\":\"\"}]}'); INSERT INTO `param_config` VALUES (1689, 'UPF', '', 'networkControlCommon', 'Network Control Common', '', '{\"list\":[{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Local Switch Disabled\",\"filter\":\"0~1\",\"name\":\"localSwitchDisabled\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"Max TCP Sync Per Second\",\"filter\":\"\",\"name\":\"maxTCPSyncPerSecond\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"UPF Max Support Mbps\",\"filter\":\"\",\"name\":\"upfMaxSupportMbps\",\"type\":\"int\",\"value\":\"0\"},{\"access\":\"read-write\",\"comment\":\"\",\"display\":\"dscp Inner Mapping\",\"filter\":\"\",\"name\":\"dscpInnerMapping\",\"type\":\"int\",\"value\":\"0\"}]}'); diff --git a/restagent/etc/restconf.yaml b/restagent/etc/restconf.yaml index fa2d2bff..2bc27935 100644 --- a/restagent/etc/restconf.yaml +++ b/restagent/etc/restconf.yaml @@ -21,17 +21,9 @@ rest: - ipv4: 0.0.0.0 ipv6: port: 33040 - - ipv4: 0.0.0.0 - ipv6: - port: 34443 - scheme: https - clientAuthType: 0 - caFile: ./etc/certs/omc-ca.crt - certFile: ./etc/certs/omc-server.crt - keyFile: ./etc/certs/omc-server.key webServer: - enabled: true + enabled: false rootDir: d:/local.git/fe.ems.vue3/dist listen: - addr: :80 @@ -59,13 +51,13 @@ redis: # OMC系统使用库 default: port: 6379 # Redis port - host: "127.0.0.1" # Redis host - password: "helloearth" + host: "192.168.8.58" # Redis host + password: "redis@1234" db: 10 # Redis db_num # UDM网元用户库 udmuser: - port: 6379 # Redis port - host: "127.0.0.1" + port: 36379 # Redis port + host: "192.168.8.58" password: "helloearth" db: 0 # Redis db_num # 多个数据源时可以用这个指定默认的数据源 @@ -78,7 +70,7 @@ mml: port2: 5002 sleep: 200 deadLine: 10 - sizeRow: 100 + sizeRow: 600 sizeCol: 128 bufferSize: 65535 user: admin @@ -87,7 +79,7 @@ mml: # NE config ne: - user: root + user: omcuser etcdir: /usr/local/etc bindir: /usr/local/bin omcdir: /usr/local/omc @@ -116,12 +108,12 @@ omc: checksign: false rootDir: ./ binDir: ./bin - backup: ./backup - upload: ./upload - frontUpload: d:/local.git/fe.ems/upload - frontTraceDir: d:/local.git/fe.ems/trace - software: ./software - license: ./license + backup: C:/usr/local/omc/backup + upload: C:/usr/local/omc/upload + frontUpload: C:/usr/local/omc/upload + frontTraceDir: C:/usr/local/omc/trace + software: C:/usr/local/omc/software + license: C:/usr/local/omc/license gtpUri: gtp:192.168.2.219:2152 checkContentType: false testMode: false @@ -134,7 +126,7 @@ omc: # email/sms # smProxy: sms(Short Message Service)/smsc(SMS Centre) alarm: - forwardAlarm: true + forwardAlarm: false email: smtp: mail.agrandtech.com port: 25 @@ -189,12 +181,12 @@ testConfig: file: ./etc/testconfig.yaml # 静态文件配置, 相对项目根路径或填绝对路径 -staticFile: - # 默认资源,dir目录需要预先创建 - default: - prefix: "/static" - dir: "./static" - # 文件上传资源目录映射,与项目目录同级 - upload: - prefix: "/upload" - dir: "./upload" +# staticFile: +# # 默认资源,dir目录需要预先创建 +# default: +# prefix: "/static" +# dir: "./static" +# # 文件上传资源目录映射,与项目目录同级 +# upload: +# prefix: "/upload" +# dir: "./upload" diff --git a/src/framework/utils/file/csv.go b/src/framework/utils/file/csv.go index 401f2ec8..b6cec70a 100644 --- a/src/framework/utils/file/csv.go +++ b/src/framework/utils/file/csv.go @@ -16,13 +16,9 @@ import ( // data = append(data, []string{"1", "2", "3"}) // err := file.WriterCSVFile(data, filePath) func WriterFileCSV(data [][]string, filePath string) error { - // 获取文件所在的目录路径 - dirPath := filepath.Dir(filePath) - - // 确保文件夹路径存在 - err := os.MkdirAll(dirPath, 0775) - if err != nil { - logger.Errorf("MkdirAll dir %v", err) + // 创建本地输出目录 + if err := os.MkdirAll(filepath.Dir(filePath), 0775); err != nil { + return err } // 创建或打开文件 diff --git a/src/framework/utils/file/zip.go b/src/framework/utils/file/zip.go index e2d8f7ad..eac438f5 100644 --- a/src/framework/utils/file/zip.go +++ b/src/framework/utils/file/zip.go @@ -59,6 +59,11 @@ func CompressZipByFile(zipFilePath, filePath string) error { // CompressZipByDir 将目录下文件添加到 ZIP 压缩文件 func CompressZipByDir(zipFilePath, dirPath string) error { + // 创建本地输出目录 + if err := os.MkdirAll(filepath.Dir(zipFilePath), 0775); err != nil { + return err + } + // 创建输出文件 zipWriter, err := os.Create(zipFilePath) if err != nil { diff --git a/src/framework/utils/machine/launch.go b/src/framework/utils/machine/launch.go index bd9d9af9..3839d146 100644 --- a/src/framework/utils/machine/launch.go +++ b/src/framework/utils/machine/launch.go @@ -160,7 +160,7 @@ func Reset() error { // return fmt.Errorf("not support window") } else { // 重置数据库 - if _, err := cmd.Execf("sudo /usr/local/omc/bin/setomc.sh -m install"); err != nil { + if _, err := cmd.Execf("/usr/local/omc/bin/setomc.sh -m install"); err != nil { return err } // 重启服务 diff --git a/src/framework/utils/ssh/sftp.go b/src/framework/utils/ssh/sftp.go index 33367337..b08fdb22 100644 --- a/src/framework/utils/ssh/sftp.go +++ b/src/framework/utils/ssh/sftp.go @@ -39,8 +39,8 @@ func (s *SSHClientSFTP) CopyDirRemoteToLocal(remoteDir, localDir string) error { // 遍历远程文件和子目录并复制到本地 for _, remoteFile := range remoteFiles { - remotePath := filepath.Join(remoteDir, remoteFile.Name()) - localPath := filepath.Join(localDir, remoteFile.Name()) + remotePath := filepath.ToSlash(filepath.Join(remoteDir, remoteFile.Name())) + localPath := filepath.ToSlash(filepath.Join(localDir, remoteFile.Name())) if remoteFile.IsDir() { // 如果是子目录,则递归复制子目录 @@ -51,25 +51,10 @@ func (s *SSHClientSFTP) CopyDirRemoteToLocal(remoteDir, localDir string) error { } } else { // 如果是文件,则复制文件内容 - remoteFile, err := s.Client.Open(remotePath) - if err != nil { + if err := s.CopyFileRemoteToLocal(remotePath, localPath); err != nil { logger.Errorf("CopyDirRemoteToLocal failed to opening remote file %s: => %s", remotePath, err.Error()) continue } - defer remoteFile.Close() - - localFile, err := os.Create(localPath) - if err != nil { - logger.Errorf("CopyDirRemoteToLocal failed to creating local file %s: => %s", localPath, err.Error()) - continue - } - defer localFile.Close() - - _, err = io.Copy(localFile, remoteFile) - if err != nil { - logger.Errorf("CopyDirRemoteToLocal failed to copying file contents from %s to %s: => %s", remotePath, localPath, err.Error()) - continue - } } } return nil @@ -134,6 +119,10 @@ func (s *SSHClientSFTP) CopyDirLocalToRemote(localDir, remoteDir string) error { // CopyDirRemoteToLocal 复制文件-远程到本地 func (s *SSHClientSFTP) CopyFileRemoteToLocal(remotePath, localPath string) error { + if err := os.MkdirAll(filepath.Dir(localPath), 0775); err != nil { + return err + } + // 打开远程文件 remoteFile, err := s.Client.Open(remotePath) if err != nil { @@ -142,21 +131,6 @@ func (s *SSHClientSFTP) CopyFileRemoteToLocal(remotePath, localPath string) erro } defer remoteFile.Close() - if err := os.MkdirAll(filepath.Dir(localPath), 0775); err != nil { - return err - } - - // 如果目标文件已经存在,先将目标文件重命名 - // if info, err := os.Stat(localPath); err == nil && !info.IsDir() { - // ext := filepath.Ext(localPath) - // name := localPath[0 : len(localPath)-len(ext)] - // newName := fmt.Sprintf("%s-%s%s", name, time.Now().Format("20060102_150405"), ext) - // err := os.Rename(localPath, newName) - // if err != nil { - // return err - // } - // } - // 创建本地文件 localFile, err := os.Create(localPath) if err != nil { diff --git a/src/modules/network_element/service/ne_version.impl.go b/src/modules/network_element/service/ne_version.impl.go index da2dbfed..489fb2b1 100644 --- a/src/modules/network_element/service/ne_version.impl.go +++ b/src/modules/network_element/service/ne_version.impl.go @@ -202,15 +202,15 @@ func (r *NeVersionImpl) operateCommand(action, neType string, neFilePaths []stri omcStrArr := []string{} omcStrArr = append(omcStrArr, pkgCmdStr) if action == "install" { - omcStrArr = append(omcStrArr, "sudo /usr/local/omc/bin/setomc.sh -m install") // 初始化数据库 + omcStrArr = append(omcStrArr, "/usr/local/omc/bin/setomc.sh -m install") // 初始化数据库 } else { - omcStrArr = append(omcStrArr, "sudo /usr/local/omc/bin/setomc.sh -m upgrade") // 升级数据库 + omcStrArr = append(omcStrArr, "/usr/local/omc/bin/setomc.sh -m upgrade") // 升级数据库 } omcStrArr = append(omcStrArr, "sudo systemctl restart restagent") // 重启服务 omcStrArr = append(omcStrArr, fmt.Sprintf("sudo rm %s", strings.Join(neFilePaths, " "))) // 删除软件包 // 2s后安装 - cmdStrArr = append(cmdStrArr, fmt.Sprintf("nohup sh -c \"sleep 2s && %s\" > /dev/null 2>&1 & \n", strings.Join(omcStrArr, " && "))) + cmdStrArr = append(cmdStrArr, fmt.Sprintf("nohup sh -c \"sleep 2s && %s\" > /tmp/omc_%s.out 2>&1 & \n", strings.Join(omcStrArr, " && "), action)) // 结束 cmdStrArr = append(cmdStrArr, fmt.Sprintf("echo '%s' \n", okFlagStr)) return okFlagStr, cmdStrArr, nil @@ -558,7 +558,8 @@ func (r *NeVersionImpl) operateRun(sshClient *ssh.ConnSSH, preinput map[string]s } // 命令终止符后继续执行命令 - if len(cmdStrArr) > 0 && strings.LastIndex(outputStr, "~$ ") > 2 { + suffix := strings.HasSuffix(outputStr, "~]# ") || strings.HasSuffix(outputStr, "~$ ") + if len(cmdStrArr) > 0 && suffix { if firstRead { firstRead = false }