feat: 更新备份导出功能,调整文件路径和清除告警表字段缺失
This commit is contained in:
@@ -50,7 +50,7 @@ INSERT INTO `sys_job` VALUES (20, 'job.ne_alarm_state_check', 'SYSTEM', 'ne_alar
|
|||||||
INSERT INTO `sys_job` VALUES (21, 'job.ne_alarm_state_check_cmd', 'SYSTEM', 'ne_alarm_state_check_cmd', '{\"alarmTitle\":\"NE State Check Alarm CPU/Menory/Disk\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: CPU/Menory/Disk status received from target NE reaches the threshold\",\"specificProblemId\":\"AC10100\",\"addInfo\":\"\",\"cpuUseGt\":70,\"memUseGt\":70,\"diskUseGt\":70}', '0/15 * * * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_cmd_remark');
|
INSERT INTO `sys_job` VALUES (21, 'job.ne_alarm_state_check_cmd', 'SYSTEM', 'ne_alarm_state_check_cmd', '{\"alarmTitle\":\"NE State Check Alarm CPU/Menory/Disk\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: CPU/Menory/Disk status received from target NE reaches the threshold\",\"specificProblemId\":\"AC10100\",\"addInfo\":\"\",\"cpuUseGt\":70,\"memUseGt\":70,\"diskUseGt\":70}', '0/15 * * * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_cmd_remark');
|
||||||
INSERT INTO `sys_job` VALUES (22, 'job.ne_alarm_state_check_license', 'SYSTEM', 'ne_alarm_state_check_license', '{\"alarmTitle\":\"NE State Check Alarm License\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: License received from target NE is about to expire\",\"specificProblemId\":\"AC10200\",\"addInfo\":\"\",\"dayLt\":7}', '0 5 0 * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_license_remark');
|
INSERT INTO `sys_job` VALUES (22, 'job.ne_alarm_state_check_license', 'SYSTEM', 'ne_alarm_state_check_license', '{\"alarmTitle\":\"NE State Check Alarm License\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: License received from target NE is about to expire\",\"specificProblemId\":\"AC10200\",\"addInfo\":\"\",\"dayLt\":7}', '0 5 0 * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_license_remark');
|
||||||
|
|
||||||
INSERT INTO `sys_job` VALUES (30, 'job.backup_remove_file', 'SYSTEM', 'backup_remove_file', '[{\"backupPath\":\"/udm_data/auth\",\"storeDays\":30},{\"backupPath\":\"/udm_data/sub\",\"storeDays\":30},{\"backupPath\":\"/udm_data/voip\",\"storeDays\":30},{\"backupPath\":\"/udm_data/volte\",\"storeDays\":30},{\"backupPath\":\"/cdr/ims_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/smsc_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/smf_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/sgwc_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/log/sys_log_operate\",\"storeDays\":30,\"storeNum\":7},{\"backupPath\":\"/log/sys_log_login\",\"storeDays\":30,\"storeNum\":7}]', '0 10 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'system', 1698478134839, 'job.backup_remove_file_remark');
|
INSERT INTO `sys_job` VALUES (30, 'job.backup_remove_file', 'SYSTEM', 'backup_remove_file', '[{\"backupPath\":\"/u_auth_user\",\"storeDays\":30},{\"backupPath\":\"/u_sub_user\",\"storeDays\":30},{\"backupPath\":\"/u_voip_auth\",\"storeDays\":30},{\"backupPath\":\"/u_ims_user\",\"storeDays\":30},{\"backupPath\":\"/ims_cdr\",\"storeDays\":30},{\"backupPath\":\"/smsc_cdr\",\"storeDays\":30},{\"backupPath\":\"/smf_cdr\",\"storeDays\":30},{\"backupPath\":\"/sgwc_cdr\",\"storeDays\":30},{\"backupPath\":\"/operate_log\",\"storeDays\":30,\"storeNum\":7},{\"backupPath\":\"/log/login_log\",\"storeDays\":30,\"storeNum\":7}]', '0 10 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'system', 1698478134839, 'job.backup_remove_file_remark');
|
||||||
INSERT INTO `sys_job` VALUES (31, 'job.backup_export_udm', 'SYSTEM', 'backup_export_udm', '{\"dataType\":[\"auth\",\"sub\",\"voip\",\"volte\"],\"fileType\":\"txt\"}', '0 35 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_udm_remark');
|
INSERT INTO `sys_job` VALUES (31, 'job.backup_export_udm', 'SYSTEM', 'backup_export_udm', '{\"dataType\":[\"auth\",\"sub\",\"voip\",\"volte\"],\"fileType\":\"txt\"}', '0 35 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_udm_remark');
|
||||||
INSERT INTO `sys_job` VALUES (32, 'job.backup_export_cdr', 'SYSTEM', 'backup_export_cdr', '{\"dataType\":[\"ims\",\"smf\",\"sgwc\",\"smsc\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_cdr_remark');
|
INSERT INTO `sys_job` VALUES (32, 'job.backup_export_cdr', 'SYSTEM', 'backup_export_cdr', '{\"dataType\":[\"ims\",\"smf\",\"sgwc\",\"smsc\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_cdr_remark');
|
||||||
INSERT INTO `sys_job` VALUES (33, 'job.backup_export_log', 'SYSTEM', 'backup_export_log', '{\"dataType\":[\"operate\",\"login\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_log_remark');
|
INSERT INTO `sys_job` VALUES (33, 'job.backup_export_log', 'SYSTEM', 'backup_export_log', '{\"dataType\":[\"operate\",\"login\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_log_remark');
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ REPLACE INTO `sys_job` VALUES (20, 'job.ne_alarm_state_check', 'SYSTEM', 'ne_ala
|
|||||||
REPLACE INTO `sys_job` VALUES (21, 'job.ne_alarm_state_check_cmd', 'SYSTEM', 'ne_alarm_state_check_cmd', '{\"alarmTitle\":\"NE State Check Alarm CPU/Menory/Disk\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: CPU/Menory/Disk status received from target NE reaches the threshold\",\"specificProblemId\":\"AC10100\",\"addInfo\":\"\",\"cpuUseGt\":70,\"memUseGt\":70,\"diskUseGt\":70}', '0/15 * * * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_cmd_remark');
|
REPLACE INTO `sys_job` VALUES (21, 'job.ne_alarm_state_check_cmd', 'SYSTEM', 'ne_alarm_state_check_cmd', '{\"alarmTitle\":\"NE State Check Alarm CPU/Menory/Disk\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: CPU/Menory/Disk status received from target NE reaches the threshold\",\"specificProblemId\":\"AC10100\",\"addInfo\":\"\",\"cpuUseGt\":70,\"memUseGt\":70,\"diskUseGt\":70}', '0/15 * * * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_cmd_remark');
|
||||||
REPLACE INTO `sys_job` VALUES (22, 'job.ne_alarm_state_check_license', 'SYSTEM', 'ne_alarm_state_check_license', '{\"alarmTitle\":\"NE State Check Alarm License\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: License received from target NE is about to expire\",\"specificProblemId\":\"AC10200\",\"addInfo\":\"\",\"dayLt\":7}', '0 5 0 * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_license_remark');
|
REPLACE INTO `sys_job` VALUES (22, 'job.ne_alarm_state_check_license', 'SYSTEM', 'ne_alarm_state_check_license', '{\"alarmTitle\":\"NE State Check Alarm License\",\"alarmType\":\"2\",\"origSeverity\":\"2\",\"specificProblem\":\"Alarm Cause: License received from target NE is about to expire\",\"specificProblemId\":\"AC10200\",\"addInfo\":\"\",\"dayLt\":7}', '0 5 0 * * ?', '3', '0', '1', '0', 'system', 1698478134839, 'system', 1698478134839, 'job.ne_alarm_state_check_license_remark');
|
||||||
|
|
||||||
REPLACE INTO `sys_job` VALUES (30, 'job.backup_remove_file', 'SYSTEM', 'backup_remove_file', '[{\"backupPath\":\"/udm_data/auth\",\"storeDays\":30},{\"backupPath\":\"/udm_data/sub\",\"storeDays\":30},{\"backupPath\":\"/udm_data/voip\",\"storeDays\":30},{\"backupPath\":\"/udm_data/volte\",\"storeDays\":30},{\"backupPath\":\"/cdr/ims_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/smsc_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/smf_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/cdr/sgwc_cdr_event\",\"storeDays\":30},{\"backupPath\":\"/log/sys_log_operate\",\"storeDays\":30,\"storeNum\":7},{\"backupPath\":\"/log/sys_log_login\",\"storeDays\":30,\"storeNum\":7}]', '0 10 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'system', 1698478134839, 'job.backup_remove_file_remark');
|
REPLACE INTO `sys_job` VALUES (30, 'job.backup_remove_file', 'SYSTEM', 'backup_remove_file', '[{\"backupPath\":\"/u_auth_user\",\"storeDays\":30},{\"backupPath\":\"/u_sub_user\",\"storeDays\":30},{\"backupPath\":\"/u_voip_auth\",\"storeDays\":30},{\"backupPath\":\"/u_ims_user\",\"storeDays\":30},{\"backupPath\":\"/ims_cdr\",\"storeDays\":30},{\"backupPath\":\"/smsc_cdr\",\"storeDays\":30},{\"backupPath\":\"/smf_cdr\",\"storeDays\":30},{\"backupPath\":\"/sgwc_cdr\",\"storeDays\":30},{\"backupPath\":\"/operate_log\",\"storeDays\":30,\"storeNum\":7},{\"backupPath\":\"/log/login_log\",\"storeDays\":30,\"storeNum\":7}]', '0 10 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'system', 1698478134839, 'job.backup_remove_file_remark');
|
||||||
REPLACE INTO `sys_job` VALUES (31, 'job.backup_export_udm', 'SYSTEM', 'backup_export_udm', '{\"dataType\":[\"auth\",\"sub\",\"voip\",\"volte\"],\"fileType\":\"txt\"}', '0 35 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_udm_remark');
|
REPLACE INTO `sys_job` VALUES (31, 'job.backup_export_udm', 'SYSTEM', 'backup_export_udm', '{\"dataType\":[\"auth\",\"sub\",\"voip\",\"volte\"],\"fileType\":\"txt\"}', '0 35 0 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_udm_remark');
|
||||||
REPLACE INTO `sys_job` VALUES (32, 'job.backup_export_cdr', 'SYSTEM', 'backup_export_cdr', '{\"dataType\":[\"ims\",\"smf\",\"sgwc\",\"smsc\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_cdr_remark');
|
REPLACE INTO `sys_job` VALUES (32, 'job.backup_export_cdr', 'SYSTEM', 'backup_export_cdr', '{\"dataType\":[\"ims\",\"smf\",\"sgwc\",\"smsc\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_cdr_remark');
|
||||||
REPLACE INTO `sys_job` VALUES (33, 'job.backup_export_log', 'SYSTEM', 'backup_export_log', '{\"dataType\":[\"operate\",\"login\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_log_remark');
|
REPLACE INTO `sys_job` VALUES (33, 'job.backup_export_log', 'SYSTEM', 'backup_export_log', '{\"dataType\":[\"operate\",\"login\"],\"fileType\":\"xlsx\",\"hour\":1}', '0 0 0/1 * * ?', '3', '0', '1', '1', 'system', 1698478134839, 'supervisor', 1745481169354, 'job.backup_export_log_remark');
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ pprof:
|
|||||||
rest:
|
rest:
|
||||||
- ipv4: 0.0.0.0
|
- ipv4: 0.0.0.0
|
||||||
ipv6:
|
ipv6:
|
||||||
port: 43030
|
port: 33040
|
||||||
- ipv4: 0.0.0.0
|
- ipv4: 0.0.0.0
|
||||||
ipv6:
|
ipv6:
|
||||||
port: 43443
|
port: 43443
|
||||||
@@ -31,7 +31,7 @@ rest:
|
|||||||
keyFile: ./etc/certs/omc-server.key
|
keyFile: ./etc/certs/omc-server.key
|
||||||
|
|
||||||
webServer:
|
webServer:
|
||||||
enabled: true
|
enabled: false
|
||||||
rootDir: /home/simon/omc.git/fe.ems.vue3/dist # front-end build dist directory
|
rootDir: /home/simon/omc.git/fe.ems.vue3/dist # front-end build dist directory
|
||||||
listen:
|
listen:
|
||||||
- addr: :8080
|
- addr: :8080
|
||||||
@@ -47,7 +47,7 @@ database:
|
|||||||
type: mysql
|
type: mysql
|
||||||
user: root
|
user: root
|
||||||
password: 1000omc@kp!
|
password: 1000omc@kp!
|
||||||
host: 192.168.2.211
|
host: 192.168.8.222
|
||||||
port: 33066
|
port: 33066
|
||||||
name: "tenants_db"
|
name: "tenants_db"
|
||||||
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
connParam: charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True
|
||||||
@@ -58,8 +58,8 @@ redis:
|
|||||||
dataSource:
|
dataSource:
|
||||||
# OMC system db
|
# OMC system db
|
||||||
default:
|
default:
|
||||||
port: 6379 # Redis port
|
port: 16379 # Redis port
|
||||||
host: "192.168.2.211" # Redis host
|
host: "192.168.9.58" # Redis host
|
||||||
password: "helloearth"
|
password: "helloearth"
|
||||||
db: 10 # Redis db_num
|
db: 10 # Redis db_num
|
||||||
# used to specify the default data source for multiple data resourece
|
# used to specify the default data source for multiple data resourece
|
||||||
@@ -77,8 +77,8 @@ mml:
|
|||||||
|
|
||||||
# Tracking configuration
|
# Tracking configuration
|
||||||
trace:
|
trace:
|
||||||
enabled: false
|
enabled: true
|
||||||
host: "172.16.5.100" # Fill in the specific IP address
|
host: "192.168.5.58" # Fill in the specific IP address
|
||||||
port: 33033
|
port: 33033
|
||||||
|
|
||||||
# NE config
|
# NE config
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func (s BackupExportCDRProcessor) exportIMS(hour int, rmUID, fileType string) st
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("ims_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("ims_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/ims_cdr_event", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/ims_cdr", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -383,7 +383,7 @@ func (s BackupExportCDRProcessor) exportIMS(hour int, rmUID, fileType string) st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "cdr"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
@@ -413,7 +413,7 @@ func (s BackupExportCDRProcessor) exportSMSC(hour int, rmUID, fileType string) s
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("smsc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("smsc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smsc_cdr_event", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smsc_cdr", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -604,7 +604,7 @@ func (s BackupExportCDRProcessor) exportSMSC(hour int, rmUID, fileType string) s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "cdr"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
@@ -633,7 +633,7 @@ func (s BackupExportCDRProcessor) exportSMF(hour int, rmUID, fileType string) st
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("smf_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("smf_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smf_cdr_event", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/smf_cdr", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -1016,7 +1016,7 @@ func (s BackupExportCDRProcessor) exportSMF(hour int, rmUID, fileType string) st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "cdr"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
@@ -1045,7 +1045,7 @@ func (s BackupExportCDRProcessor) exportSGWC(hour int, rmUID, fileType string) s
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("sgwc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("sgwc_cdr_event_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/sgwc_cdr_event", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/cdr/sgwc_cdr", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -1435,7 +1435,7 @@ func (s BackupExportCDRProcessor) exportSGWC(hour int, rmUID, fileType string) s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "cdr"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ func (s BackupExportLogProcessor) exportOperate(hour int, fileType string) strin
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("sys_log_operate_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("sys_log_operate_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/log/sys_log_operate", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/operate_log", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -233,7 +233,7 @@ func (s BackupExportLogProcessor) exportOperate(hour int, fileType string) strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "log"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
@@ -273,7 +273,7 @@ func (s BackupExportLogProcessor) exportLogin(hour int, fileType string) string
|
|||||||
|
|
||||||
// 导出文件名称
|
// 导出文件名称
|
||||||
fileName := fmt.Sprintf("sys_log_login_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
fileName := fmt.Sprintf("sys_log_login_export_%d_%s.%s", len(rows), date.ParseDateToStr(end, date.YYYYMMDDHHMMSS), fileType)
|
||||||
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/log/sys_log_login", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "/log/login_log", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ func (s BackupExportLogProcessor) exportLogin(hour int, fileType string) string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "log"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ func (s BackupExportUDMProcessor) exportAuth(neId, fileType string) string {
|
|||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("auth_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
fileName := fmt.Sprintf("auth_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
||||||
filePath := filepath.Join("/usr/local/omc/backup/udm_data/auth", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "u_auth_user", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -126,10 +126,10 @@ func (s BackupExportUDMProcessor) exportAuth(neId, fileType string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "udm_data"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return fmt.Sprintf("ok, rows:%d", len(rows))
|
||||||
}
|
}
|
||||||
|
|
||||||
// exportSub 导出签约用户数据
|
// exportSub 导出签约用户数据
|
||||||
@@ -141,7 +141,7 @@ func (s BackupExportUDMProcessor) exportSub(neId, fileType string) string {
|
|||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("sub_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
fileName := fmt.Sprintf("sub_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
||||||
filePath := filepath.Join("/usr/local/omc/backup/udm_data/sub", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "u_sub_user", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -174,10 +174,10 @@ func (s BackupExportUDMProcessor) exportSub(neId, fileType string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "udm_data"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return fmt.Sprintf("ok, rows:%d", len(rows))
|
||||||
}
|
}
|
||||||
|
|
||||||
// exportVOIP 导出VOIP用户数据
|
// exportVOIP 导出VOIP用户数据
|
||||||
@@ -189,7 +189,7 @@ func (s BackupExportUDMProcessor) exportVOIP(neId, fileType string) string {
|
|||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("voip_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
fileName := fmt.Sprintf("voip_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
||||||
filePath := filepath.Join("/usr/local/omc/backup/udm_data/voip", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "u_voip_auth", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -220,10 +220,10 @@ func (s BackupExportUDMProcessor) exportVOIP(neId, fileType string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "udm_data"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return fmt.Sprintf("ok, rows:%d", len(rows))
|
||||||
}
|
}
|
||||||
|
|
||||||
// exportVolte 导出Volte用户数据
|
// exportVolte 导出Volte用户数据
|
||||||
@@ -235,7 +235,7 @@ func (s BackupExportUDMProcessor) exportVolte(neId, fileType string) string {
|
|||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("volte_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
fileName := fmt.Sprintf("volte_%s_export_%s.%s", neId, time.Now().Format("20060102150405"), fileType)
|
||||||
filePath := filepath.Join("/usr/local/omc/backup/udm_data/volte", fileName)
|
filePath := filepath.Join(s.backupService.BACKUP_DIR, "u_ims_user", fileName)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
filePath = fmt.Sprintf("C:%s", filePath)
|
filePath = fmt.Sprintf("C:%s", filePath)
|
||||||
}
|
}
|
||||||
@@ -266,8 +266,8 @@ func (s BackupExportUDMProcessor) exportVolte(neId, fileType string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 上传到FTP服务器
|
// 上传到FTP服务器
|
||||||
if err := s.backupService.FTPPushFile(filePath, "udm_data"); err != nil {
|
if err := s.backupService.FTPPushFile(filePath, ""); err != nil {
|
||||||
return "ok, ftp err:" + err.Error()
|
return "ok, ftp err:" + err.Error()
|
||||||
}
|
}
|
||||||
return "ok"
|
return fmt.Sprintf("ok, rows:%d", len(rows))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ func (s NeAlarmStateCheckProcessor) alarmClear(neInfo neModel.NeInfo, v neDataMo
|
|||||||
v.AlarmStatus = "0"
|
v.AlarmStatus = "0"
|
||||||
// 告警清除
|
// 告警清除
|
||||||
v.ClearType = "1"
|
v.ClearType = "1"
|
||||||
v.ClearTime = time.Unix(neInfo.UpdateTime, 0)
|
v.ClearTime = time.UnixMilli(neInfo.UpdateTime)
|
||||||
v.ClearUser = "system"
|
v.ClearUser = "system"
|
||||||
rows := s.alarmService.Update(v)
|
rows := s.alarmService.Update(v)
|
||||||
if rows > 0 {
|
if rows > 0 {
|
||||||
@@ -150,7 +150,7 @@ func (s NeAlarmStateCheckProcessor) alarmNew(neInfo neModel.NeInfo, v alarmParam
|
|||||||
AlarmId: v.AlarmId,
|
AlarmId: v.AlarmId,
|
||||||
AlarmTitle: v.AlarmTitle,
|
AlarmTitle: v.AlarmTitle,
|
||||||
AlarmCode: fmt.Sprint(constants.ALARM_STATE_CHECK),
|
AlarmCode: fmt.Sprint(constants.ALARM_STATE_CHECK),
|
||||||
EventTime: time.Unix(lastTime, 0),
|
EventTime: time.UnixMilli(lastTime),
|
||||||
AlarmType: v.AlarmType,
|
AlarmType: v.AlarmType,
|
||||||
OrigSeverity: v.OrigSeverity,
|
OrigSeverity: v.OrigSeverity,
|
||||||
PerceivedSeverity: v.OrigSeverity,
|
PerceivedSeverity: v.OrigSeverity,
|
||||||
@@ -162,6 +162,9 @@ func (s NeAlarmStateCheckProcessor) alarmNew(neInfo neModel.NeInfo, v alarmParam
|
|||||||
SpecificProblem: v.SpecificProblem,
|
SpecificProblem: v.SpecificProblem,
|
||||||
SpecificProblemId: v.SpecificProblemID,
|
SpecificProblemId: v.SpecificProblemID,
|
||||||
AddInfo: v.AddInfo,
|
AddInfo: v.AddInfo,
|
||||||
|
Counter: "0",
|
||||||
|
AckState: "0",
|
||||||
|
ClearType: "0",
|
||||||
}
|
}
|
||||||
insertId := s.alarmService.InsertAndForword(alarm)
|
insertId := s.alarmService.InsertAndForword(alarm)
|
||||||
if insertId != "" {
|
if insertId != "" {
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ func (s NeAlarmStateCheckCMDProcessor) alarmClear(neInfo neModel.NeInfo, v neDat
|
|||||||
v.AlarmStatus = "0"
|
v.AlarmStatus = "0"
|
||||||
// 告警清除
|
// 告警清除
|
||||||
v.ClearType = "1"
|
v.ClearType = "1"
|
||||||
v.ClearTime = time.Unix(neInfo.UpdateTime, 0)
|
v.ClearTime = time.UnixMilli(neInfo.UpdateTime)
|
||||||
v.ClearUser = "system"
|
v.ClearUser = "system"
|
||||||
rows := s.alarmService.Update(v)
|
rows := s.alarmService.Update(v)
|
||||||
if rows > 0 {
|
if rows > 0 {
|
||||||
@@ -266,7 +266,7 @@ func (s NeAlarmStateCheckCMDProcessor) alarmNew(neInfo neModel.NeInfo, v alarmPa
|
|||||||
AlarmId: v.AlarmId,
|
AlarmId: v.AlarmId,
|
||||||
AlarmTitle: v.AlarmTitle,
|
AlarmTitle: v.AlarmTitle,
|
||||||
AlarmCode: fmt.Sprint(constants.ALARM_CMD_CHECK),
|
AlarmCode: fmt.Sprint(constants.ALARM_CMD_CHECK),
|
||||||
EventTime: time.Unix(lastTime, 0),
|
EventTime: time.UnixMilli(lastTime),
|
||||||
AlarmType: v.AlarmType,
|
AlarmType: v.AlarmType,
|
||||||
OrigSeverity: v.OrigSeverity,
|
OrigSeverity: v.OrigSeverity,
|
||||||
PerceivedSeverity: v.OrigSeverity,
|
PerceivedSeverity: v.OrigSeverity,
|
||||||
@@ -278,6 +278,9 @@ func (s NeAlarmStateCheckCMDProcessor) alarmNew(neInfo neModel.NeInfo, v alarmPa
|
|||||||
SpecificProblem: v.SpecificProblem,
|
SpecificProblem: v.SpecificProblem,
|
||||||
SpecificProblemId: v.SpecificProblemID,
|
SpecificProblemId: v.SpecificProblemID,
|
||||||
AddInfo: v.AddInfo,
|
AddInfo: v.AddInfo,
|
||||||
|
Counter: "0",
|
||||||
|
AckState: "0",
|
||||||
|
ClearType: "0",
|
||||||
}
|
}
|
||||||
insertId := s.alarmService.InsertAndForword(alarm)
|
insertId := s.alarmService.InsertAndForword(alarm)
|
||||||
if insertId != "" {
|
if insertId != "" {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ func (s NeAlarmStateCheckLicenseProcessor) alarmClear(neInfo neModel.NeInfo, v n
|
|||||||
v.AlarmStatus = "0"
|
v.AlarmStatus = "0"
|
||||||
// 告警清除
|
// 告警清除
|
||||||
v.ClearType = "1"
|
v.ClearType = "1"
|
||||||
v.ClearTime = time.Unix(neInfo.UpdateTime, 0)
|
v.ClearTime = time.UnixMilli(neInfo.UpdateTime)
|
||||||
v.ClearUser = "system"
|
v.ClearUser = "system"
|
||||||
rows := s.alarmService.Update(v)
|
rows := s.alarmService.Update(v)
|
||||||
if rows > 0 {
|
if rows > 0 {
|
||||||
@@ -191,7 +191,7 @@ func (s NeAlarmStateCheckLicenseProcessor) alarmNew(neInfo neModel.NeInfo, v ala
|
|||||||
AlarmId: v.AlarmId,
|
AlarmId: v.AlarmId,
|
||||||
AlarmTitle: v.AlarmTitle,
|
AlarmTitle: v.AlarmTitle,
|
||||||
AlarmCode: fmt.Sprint(constants.ALARM_LICENSE_CHECK),
|
AlarmCode: fmt.Sprint(constants.ALARM_LICENSE_CHECK),
|
||||||
EventTime: time.Unix(lastTime, 0),
|
EventTime: time.UnixMilli(lastTime),
|
||||||
AlarmType: v.AlarmType,
|
AlarmType: v.AlarmType,
|
||||||
OrigSeverity: v.OrigSeverity,
|
OrigSeverity: v.OrigSeverity,
|
||||||
PerceivedSeverity: v.OrigSeverity,
|
PerceivedSeverity: v.OrigSeverity,
|
||||||
@@ -203,6 +203,9 @@ func (s NeAlarmStateCheckLicenseProcessor) alarmNew(neInfo neModel.NeInfo, v ala
|
|||||||
SpecificProblem: v.SpecificProblem,
|
SpecificProblem: v.SpecificProblem,
|
||||||
SpecificProblemId: v.SpecificProblemID,
|
SpecificProblemId: v.SpecificProblemID,
|
||||||
AddInfo: v.AddInfo,
|
AddInfo: v.AddInfo,
|
||||||
|
Counter: "0",
|
||||||
|
AckState: "0",
|
||||||
|
ClearType: "0",
|
||||||
}
|
}
|
||||||
insertId := s.alarmService.InsertAndForword(alarm)
|
insertId := s.alarmService.InsertAndForword(alarm)
|
||||||
if insertId != "" {
|
if insertId != "" {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"be.ems/src/modules/crontask/processor/backupEtcFromNE"
|
"be.ems/src/modules/crontask/processor/backupEtcFromNE"
|
||||||
processorBackupExportCDR "be.ems/src/modules/crontask/processor/backup_export_cdr"
|
processorBackupExportCDR "be.ems/src/modules/crontask/processor/backup_export_cdr"
|
||||||
processorBackupExportLog "be.ems/src/modules/crontask/processor/backup_export_log"
|
processorBackupExportLog "be.ems/src/modules/crontask/processor/backup_export_log"
|
||||||
|
processorBackupExportUDM "be.ems/src/modules/crontask/processor/backup_export_udm"
|
||||||
processorBackupRemoveFile "be.ems/src/modules/crontask/processor/backup_remove_file"
|
processorBackupRemoveFile "be.ems/src/modules/crontask/processor/backup_remove_file"
|
||||||
"be.ems/src/modules/crontask/processor/delExpiredNeBackup"
|
"be.ems/src/modules/crontask/processor/delExpiredNeBackup"
|
||||||
"be.ems/src/modules/crontask/processor/deleteExpiredRecord"
|
"be.ems/src/modules/crontask/processor/deleteExpiredRecord"
|
||||||
@@ -48,6 +49,8 @@ func InitCronQueue() {
|
|||||||
|
|
||||||
// 备份-删除备份目录下文件
|
// 备份-删除备份目录下文件
|
||||||
cron.CreateQueue("backup_remove_file", processorBackupRemoveFile.NewProcessor)
|
cron.CreateQueue("backup_remove_file", processorBackupRemoveFile.NewProcessor)
|
||||||
|
// 备份-导出UDM用户数据
|
||||||
|
cron.CreateQueue("backup_export_udm", processorBackupExportUDM.NewProcessor)
|
||||||
// 备份-导出CDR数据
|
// 备份-导出CDR数据
|
||||||
cron.CreateQueue("backup_export_cdr", processorBackupExportCDR.NewProcessor)
|
cron.CreateQueue("backup_export_cdr", processorBackupExportCDR.NewProcessor)
|
||||||
// 备份-导出Log数据
|
// 备份-导出Log数据
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ func (s BackupController) FTPPush(c *gin.Context) {
|
|||||||
var body struct {
|
var body struct {
|
||||||
Path string `form:"path" binding:"required"` // 路径必须是 BACKUP_DIR 开头的路径
|
Path string `form:"path" binding:"required"` // 路径必须是 BACKUP_DIR 开头的路径
|
||||||
Filename string `form:"fileName" binding:"required"`
|
Filename string `form:"fileName" binding:"required"`
|
||||||
Tag string `form:"tag" binding:"required"` // 标签,用于区分不同的备份文件
|
Tag string `form:"tag"` // 标签,用于区分不同的备份文件
|
||||||
}
|
}
|
||||||
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
if err := c.ShouldBindBodyWithJSON(&body); err != nil {
|
||||||
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
errMsgs := fmt.Sprintf("bind err: %s", resp.FormatBindError(err))
|
||||||
|
|||||||
Reference in New Issue
Block a user