package com.wgcloud.task;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
import com.wgcloud.common.NettytHandler;
|
import com.wgcloud.config.CommonConfig;
|
import com.wgcloud.entity.*;
|
import com.wgcloud.service.*;
|
import com.wgcloud.util.DateUtil;
|
import com.wgcloud.util.HostUtil;
|
import com.wgcloud.util.ServerBackupUtil;
|
import com.wgcloud.util.ThreadPoolUtil;
|
import com.wgcloud.util.msg.WarnMailUtil;
|
import com.wgcloud.util.msg.WarnPools;
|
import com.wgcloud.util.staticvar.BatchData;
|
import com.wgcloud.util.staticvar.StaticKeys;
|
import org.apache.commons.lang3.StringUtils;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import java.util.*;
|
|
/**
|
* @version v3.3
|
* @ClassName:DataScheduledTask.java
|
* @author: http://www.wgstart.com
|
* @date: 2021年3月16日
|
* @Description: 定时提交监控数据,清理历史数据
|
* @Copyright: 2019-2021 wgcloud. All rights reserved.
|
*/
|
@Component
|
public class DataScheduledTask {
|
private Logger logger = LoggerFactory.getLogger(DataScheduledTask.class);
|
|
|
@Autowired
|
private SystemInfoService systemInfoService;
|
@Autowired
|
private DiskStateService diskStateService;
|
@Autowired
|
private DeskIoService deskIoService;
|
@Autowired
|
private DiskSmartService diskSmartService;
|
@Autowired
|
private HostDiskPerService hostDiskPerService;
|
@Autowired
|
private CpuTemperaturesService cpuTemperaturesService;
|
@Autowired
|
private LogInfoService logInfoService;
|
@Autowired
|
private AppInfoService appInfoService;
|
@Autowired
|
private CustomInfoService customInfoService;
|
@Autowired
|
private FileWarnInfoService fileWarnInfoService;
|
@Autowired
|
private DockerInfoService dockerInfoService;
|
@Autowired
|
private PortInfoService portInfoService;
|
@Autowired
|
private FileSafeService fileSafeService;
|
@Autowired
|
private CpuStateService cpuStateService;
|
@Autowired
|
private MemStateService memStateService;
|
@Autowired
|
private NetIoStateService netIoStateService;
|
@Autowired
|
private SysLoadStateService sysLoadStateService;
|
@Autowired
|
private AppStateService appStateService;
|
@Autowired
|
private CustomStateService customStateService;
|
@Autowired
|
private FileWarnStateService fileWarnStateService;
|
@Autowired
|
private ShellStateService shellStateService;
|
@Autowired
|
private HeathStateService heathStateService;
|
@Autowired
|
private DceStateService dceStateService;
|
@Autowired
|
private SnmpStateService snmpStateService;
|
@Autowired
|
private DockerStateService dockerStateService;
|
@Autowired
|
private DbTableCountService dbTableCountService;
|
@Autowired
|
private TaskUtilService taskUtilService;
|
@Autowired
|
private CommonConfig commonConfig;
|
|
|
/**
|
* 29秒后执行,之后每隔29秒执行, 单位:ms。
|
* 批量提交数据
|
*/
|
@Scheduled(initialDelay = 29000L, fixedRate = 29 * 1000)
|
public synchronized void commitTask() {
|
if (DateUtil.isClearTime()) {
|
logger.info("正在清空历史趋势图数据,不执行提交监控数据----------" + DateUtil.getCurrentDateTime());
|
BatchData.clearAll();
|
return;
|
}
|
logger.info("批量提交监控数据任务开始----------" + DateUtil.getCurrentDateTime());
|
try {
|
if (BatchData.FILEWARN_STATE_LIST.size() > 0) {
|
List<FileWarnState> FILEWARN_STATE_LIST = new ArrayList<FileWarnState>();
|
FILEWARN_STATE_LIST.addAll(BatchData.FILEWARN_STATE_LIST);
|
BatchData.FILEWARN_STATE_LIST.clear();
|
fileWarnStateService.saveRecord(FILEWARN_STATE_LIST);
|
}
|
if (BatchData.APP_STATE_LIST.size() > 0) {
|
List<AppState> APP_STATE_LIST = new ArrayList<AppState>();
|
APP_STATE_LIST.addAll(BatchData.APP_STATE_LIST);
|
BatchData.APP_STATE_LIST.clear();
|
appStateService.saveRecord(APP_STATE_LIST);
|
}
|
if (BatchData.CUSTOM_STATE_LIST.size() > 0) {
|
List<CustomState> CUSTOM_STATE_LIST = new ArrayList<CustomState>();
|
CUSTOM_STATE_LIST.addAll(BatchData.CUSTOM_STATE_LIST);
|
BatchData.CUSTOM_STATE_LIST.clear();
|
customStateService.saveRecord(CUSTOM_STATE_LIST);
|
}
|
if (BatchData.HEATH_STATE_LIST.size() > 0) {
|
List<HeathState> HEATH_STATE_LIST = new ArrayList<HeathState>();
|
HEATH_STATE_LIST.addAll(BatchData.HEATH_STATE_LIST);
|
BatchData.HEATH_STATE_LIST.clear();
|
heathStateService.saveRecord(HEATH_STATE_LIST);
|
}
|
if (BatchData.DCE_STATE_LIST.size() > 0) {
|
List<DceState> DCE_STATE_LIST = new ArrayList<DceState>();
|
DCE_STATE_LIST.addAll(BatchData.DCE_STATE_LIST);
|
BatchData.DCE_STATE_LIST.clear();
|
dceStateService.saveRecord(DCE_STATE_LIST);
|
}
|
if (BatchData.DBTABLE_COUNT_LIST.size() > 0) {
|
List<DbTableCount> DBTABLE_COUNT_LIST = new ArrayList<DbTableCount>();
|
DBTABLE_COUNT_LIST.addAll(BatchData.DBTABLE_COUNT_LIST);
|
BatchData.DBTABLE_COUNT_LIST.clear();
|
dbTableCountService.saveRecord(DBTABLE_COUNT_LIST);
|
}
|
if (BatchData.SNMP_STATE_LIST.size() > 0) {
|
List<SnmpState> SNMP_STATE_LIST = new ArrayList<SnmpState>();
|
SNMP_STATE_LIST.addAll(BatchData.SNMP_STATE_LIST);
|
BatchData.SNMP_STATE_LIST.clear();
|
snmpStateService.saveRecord(SNMP_STATE_LIST);
|
}
|
if (BatchData.DOCKER_STATE_LIST.size() > 0) {
|
List<DockerState> DOCKER_STATE_LIST = new ArrayList<DockerState>();
|
DOCKER_STATE_LIST.addAll(BatchData.DOCKER_STATE_LIST);
|
BatchData.DOCKER_STATE_LIST.clear();
|
dockerStateService.saveRecord(DOCKER_STATE_LIST);
|
}
|
if (BatchData.CPU_STATE_LIST.size() > 0) {
|
List<CpuState> CPU_STATE_LIST = new ArrayList<CpuState>();
|
CPU_STATE_LIST.addAll(BatchData.CPU_STATE_LIST);
|
BatchData.CPU_STATE_LIST.clear();
|
cpuStateService.saveRecord(CPU_STATE_LIST);
|
}
|
if (BatchData.MEM_STATE_LIST.size() > 0) {
|
List<MemState> MEM_STATE_LIST = new ArrayList<MemState>();
|
MEM_STATE_LIST.addAll(BatchData.MEM_STATE_LIST);
|
BatchData.MEM_STATE_LIST.clear();
|
memStateService.saveRecord(MEM_STATE_LIST);
|
}
|
if (BatchData.NETIO_STATE_LIST.size() > 0) {
|
List<NetIoState> NETIO_STATE_LIST = new ArrayList<NetIoState>();
|
NETIO_STATE_LIST.addAll(BatchData.NETIO_STATE_LIST);
|
BatchData.NETIO_STATE_LIST.clear();
|
netIoStateService.saveRecord(NETIO_STATE_LIST);
|
}
|
if (BatchData.SYSLOAD_STATE_LIST.size() > 0) {
|
List<SysLoadState> SYSLOAD_STATE_LIST = new ArrayList<SysLoadState>();
|
SYSLOAD_STATE_LIST.addAll(BatchData.SYSLOAD_STATE_LIST);
|
BatchData.SYSLOAD_STATE_LIST.clear();
|
sysLoadStateService.saveRecord(SYSLOAD_STATE_LIST);
|
}
|
if (BatchData.LOG_INFO_LIST.size() > 0) {
|
List<LogInfo> LOG_INFO_LIST = new ArrayList<LogInfo>();
|
LOG_INFO_LIST.addAll(BatchData.LOG_INFO_LIST);
|
BatchData.LOG_INFO_LIST.clear();
|
logInfoService.saveRecord(LOG_INFO_LIST);
|
}
|
if (BatchData.DISK_STATE_LIST.size() > 0) {
|
batchCommitDeskState();
|
}
|
if (BatchData.DESK_IO_LIST.size() > 0) {
|
batchCommitDeskIo();
|
}
|
if (BatchData.DISK_SMART_LIST.size() > 0) {
|
batchCommitDiskSmart();
|
}
|
if (BatchData.CPU_TEMPERATURES_LIST.size() > 0) {
|
batchCommitCpuTemperatures();
|
}
|
if (BatchData.SYSTEM_INFO_LIST.size() > 0) {
|
batchCommitSystemInfo();
|
}
|
if (BatchData.APP_INFO_LIST.size() > 0) {
|
batchCommitAppInfo();
|
}
|
if (BatchData.CUSTOM_INFO_LIST.size() > 0) {
|
batchCommitCustomInfo();
|
}
|
if (BatchData.FILEWARN_INFO_LIST.size() > 0) {
|
batchCommitFileWarnInfo();
|
}
|
if (BatchData.PORT_INFO_LIST.size() > 0) {
|
batchCommitPortInfo();
|
}
|
if (BatchData.FILE_SAFE_LIST.size() > 0) {
|
batchCommitFileSafes();
|
}
|
if (BatchData.DOCKER_INFO_LIST.size() > 0) {
|
batchCommitDockerInfo();
|
}
|
} catch (Exception e) {
|
// TODO Auto-generated catch block
|
logger.error("批量提交监控数据错误", e);
|
logInfoService.save("批量提交监控数据错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
logger.info("批量提交监控数据任务结束----------" + DateUtil.getCurrentDateTime());
|
}
|
|
/**
|
* cpu温度数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitCpuTemperatures() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
|
List<CpuTemperatures> CPU_TEMPERATURES_LIST = new ArrayList<CpuTemperatures>();
|
CPU_TEMPERATURES_LIST.addAll(BatchData.CPU_TEMPERATURES_LIST);
|
BatchData.CPU_TEMPERATURES_LIST.clear();
|
List<String> hostnameList = new ArrayList<String>();
|
for (CpuTemperatures deskState : CPU_TEMPERATURES_LIST) {
|
if (!hostnameList.contains(deskState.getHostname())) {
|
hostnameList.add(deskState.getHostname());
|
}
|
}
|
if (!CollectionUtil.isEmpty(hostnameList)) {
|
cpuTemperaturesService.deleteByAccHname(hostnameList);
|
}
|
cpuTemperaturesService.saveRecord(CPU_TEMPERATURES_LIST);
|
}
|
|
/**
|
* 磁盘smart数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitDiskSmart() throws Exception {
|
List<DiskSmart> DISK_SMART_LIST = new ArrayList<DiskSmart>();
|
DISK_SMART_LIST.addAll(BatchData.DISK_SMART_LIST);
|
BatchData.DISK_SMART_LIST.clear();
|
List<String> hostnameList = new ArrayList<String>();
|
for (DiskSmart diskSmart : DISK_SMART_LIST) {
|
if (!hostnameList.contains(diskSmart.getHostname())) {
|
hostnameList.add(diskSmart.getHostname());
|
}
|
}
|
if (!CollectionUtil.isEmpty(hostnameList)) {
|
diskSmartService.deleteByAccHname(hostnameList);
|
}
|
diskSmartService.saveRecord(DISK_SMART_LIST);
|
}
|
|
/**
|
* 磁盘io数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitDeskIo() throws Exception {
|
List<DeskIo> DESK_IO_LIST = new ArrayList<DeskIo>();
|
DESK_IO_LIST.addAll(BatchData.DESK_IO_LIST);
|
BatchData.DESK_IO_LIST.clear();
|
List<String> hostnameList = new ArrayList<String>();
|
for (DeskIo deskState : DESK_IO_LIST) {
|
if (!hostnameList.contains(deskState.getHostname())) {
|
hostnameList.add(deskState.getHostname());
|
}
|
}
|
if (!CollectionUtil.isEmpty(hostnameList)) {
|
deskIoService.deleteByAccHname(hostnameList);
|
}
|
deskIoService.saveRecord(DESK_IO_LIST);
|
}
|
|
|
/**
|
* 磁盘空间数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitDeskState() throws Exception {
|
List<DiskState> DISK_STATE_LIST = new ArrayList<DiskState>();
|
DISK_STATE_LIST.addAll(BatchData.DISK_STATE_LIST);
|
BatchData.DISK_STATE_LIST.clear();
|
List<String> hostnameList = new ArrayList<String>();
|
for (DiskState diskState : DISK_STATE_LIST) {
|
if (!hostnameList.contains(diskState.getHostname())) {
|
hostnameList.add(diskState.getHostname());
|
}
|
}
|
if (!CollectionUtil.isEmpty(hostnameList)) {
|
diskStateService.deleteByAccHname(hostnameList);
|
}
|
diskStateService.saveRecord(DISK_STATE_LIST);
|
}
|
|
/**
|
* docker监控数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitDockerInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<DockerInfo> DOCKER_INFO_LIST = new ArrayList<DockerInfo>();
|
DOCKER_INFO_LIST.addAll(BatchData.DOCKER_INFO_LIST);
|
BatchData.DOCKER_INFO_LIST.clear();
|
|
dockerInfoService.updateRecord(DOCKER_INFO_LIST);
|
}
|
|
/**
|
* 进程监控数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitAppInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<AppInfo> APP_INFO_LIST = new ArrayList<AppInfo>();
|
APP_INFO_LIST.addAll(BatchData.APP_INFO_LIST);
|
BatchData.APP_INFO_LIST.clear();
|
|
appInfoService.updateRecord(APP_INFO_LIST);
|
}
|
|
/**
|
* 自定义监控项数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitCustomInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<CustomInfo> CUSTOM_INFO_LIST = new ArrayList<CustomInfo>();
|
CUSTOM_INFO_LIST.addAll(BatchData.CUSTOM_INFO_LIST);
|
BatchData.CUSTOM_INFO_LIST.clear();
|
|
customInfoService.updateRecord(CUSTOM_INFO_LIST);
|
}
|
|
/**
|
* 日志文件监控数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitFileWarnInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<FileWarnInfo> FILEWARN_INFO_LIST = new ArrayList<FileWarnInfo>();
|
FILEWARN_INFO_LIST.addAll(BatchData.FILEWARN_INFO_LIST);
|
BatchData.FILEWARN_INFO_LIST.clear();
|
|
fileWarnInfoService.updateRecord(FILEWARN_INFO_LIST);
|
}
|
|
/**
|
* 端口监控数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitPortInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<PortInfo> PORT_INFO_LIST = new ArrayList<PortInfo>();
|
PORT_INFO_LIST.addAll(BatchData.PORT_INFO_LIST);
|
BatchData.PORT_INFO_LIST.clear();
|
|
portInfoService.updateRecord(PORT_INFO_LIST);
|
}
|
|
/**
|
* 文件防篡改信息监测数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitFileSafes() throws Exception {
|
Map<String, Object> params = new HashMap<String, Object>();
|
List<FileSafe> FILE_SAFE_LIST = new ArrayList<FileSafe>();
|
FILE_SAFE_LIST.addAll(BatchData.FILE_SAFE_LIST);
|
BatchData.FILE_SAFE_LIST.clear();
|
|
fileSafeService.updateRecord(FILE_SAFE_LIST);
|
}
|
|
/**
|
* 主机监控数据保存
|
*
|
* @throws Exception
|
*/
|
private void batchCommitSystemInfo() throws Exception {
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
List<SystemInfo> SYSTEM_INFO_LIST = new ArrayList<SystemInfo>();
|
SYSTEM_INFO_LIST.addAll(BatchData.SYSTEM_INFO_LIST);
|
BatchData.SYSTEM_INFO_LIST.clear();
|
List<SystemInfo> updateList = new ArrayList<SystemInfo>();
|
List<SystemInfo> insertList = new ArrayList<SystemInfo>();
|
List<SystemInfo> savedList = systemInfoService.selectAllByParams(paramsDel);
|
for (SystemInfo systemInfo : SYSTEM_INFO_LIST) {
|
if (StringUtils.isEmpty(systemInfo.getHostname())) {
|
continue;
|
}
|
boolean issaved = false;
|
//之前若保存过,更新主机
|
for (SystemInfo systemInfoS : savedList) {
|
if (systemInfoS.getHostname().equals(systemInfo.getHostname())) {
|
systemInfo.setId(systemInfoS.getId());
|
updateList.add(systemInfo);
|
issaved = true;
|
break;
|
}
|
}
|
//之前未保存过,新增主机
|
if (!issaved) {
|
insertList.add(systemInfo);
|
}
|
}
|
//更新
|
systemInfoService.updateRecord(updateList);
|
//新增
|
systemInfoService.saveRecord(insertList);
|
|
//新加入主机发送通知 begin
|
for (SystemInfo systemInfoNew : insertList) {
|
Runnable runnable = () -> {
|
WarnMailUtil.sendHostDown(systemInfoNew, false);
|
};
|
ThreadPoolUtil.executor.execute(runnable);
|
}
|
//新加入主机发送通知 end
|
}
|
|
/**
|
* 所有主机都新增一条磁盘总使用率信息
|
*
|
* @throws Exception
|
*/
|
private void addHostDiskPer() throws Exception {
|
Date nowtime = DateUtil.getNowTime();
|
List<HostDiskPer> hostDiskPerList = new ArrayList<>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
List<SystemInfo> systemInfoList = systemInfoService.selectAllByParams(params);
|
for (SystemInfo systemInfo1 : systemInfoList) {
|
params.put("hostname", systemInfo1.getHostname());
|
List<DiskState> deskStates = diskStateService.selectAllByParams(params);
|
HostUtil.setDiskSumPer(deskStates, systemInfo1);
|
HostDiskPer hostDiskPer = new HostDiskPer();
|
hostDiskPer.setCreateTime(nowtime);
|
hostDiskPer.setDiskSumPer(systemInfo1.getDiskPer());
|
hostDiskPer.setHostname(systemInfo1.getHostname());
|
hostDiskPerList.add(hostDiskPer);
|
}
|
hostDiskPerService.saveRecord(hostDiskPerList);
|
}
|
|
/**
|
* 每天凌晨8:24:30执行
|
* 清理历史数据过程即将结束时,将主机、端口、进程、docker的更新时间刷新为当前时间
|
*/
|
@Scheduled(cron = "30 24 8 * * ?")
|
public void refreshCommitDate() {
|
try {
|
taskUtilService.refreshCommitDate();
|
} catch (Exception e) {
|
logger.error("刷新监控数据更新时间错误", e);
|
}
|
}
|
|
/**
|
* 每天凌晨8:10执行
|
* 删除历史趋势图数据,默认15天
|
*/
|
@Scheduled(cron = "0 10 8 * * ?")
|
public void clearHisdataTask() {
|
if (!StaticKeys.NODE_MASTER.equals(commonConfig.getNodeType())) {
|
logger.info("slave节点不执行清空历史趋势图数据任务");
|
return;
|
}
|
logger.info("清空" + commonConfig.getHistoryDataOut() + "天前的监控历史趋势图数据");
|
logger.info("定时清空历史趋势图数据任务开始----------" + DateUtil.getCurrentDateTime());
|
|
//配置的历史数据保留时间,天
|
String thrityDayBefore = DateUtil.getDateBefore(commonConfig.getHistoryDataOut());
|
Map<String, Object> paramsDel = new HashMap<String, Object>();
|
try {
|
paramsDel.put(StaticKeys.SEARCH_END_TIME, thrityDayBefore);
|
//执行删除操作begin
|
if (paramsDel.get(StaticKeys.SEARCH_END_TIME) != null && !"".equals(paramsDel.get(StaticKeys.SEARCH_END_TIME))) {
|
//删除历史cpu监控趋势图信息
|
cpuStateService.deleteByAccountAndDate(paramsDel);
|
//删除历史内存监控趋势图信息
|
memStateService.deleteByAccountAndDate(paramsDel);
|
//删除历史吞吐率监控趋势图信息
|
netIoStateService.deleteByAccountAndDate(paramsDel);
|
//删除历史负载状态监控趋势图信息
|
sysLoadStateService.deleteByAccountAndDate(paramsDel);
|
//删除历史进程趋势图数据
|
appStateService.deleteByDate(paramsDel);
|
//删除历史docker状态趋势图数据
|
dockerStateService.deleteByDate(paramsDel);
|
//删除历史磁盘监控信息
|
diskStateService.deleteByAccountAndDate(paramsDel);
|
//删除历史磁盘Io信息
|
deskIoService.deleteByAccountAndDate(paramsDel);
|
//删除历史磁盘smart信息
|
diskSmartService.deleteByAccountAndDate(paramsDel);
|
//删除历史cpu温度监控信息
|
cpuTemperaturesService.deleteByAccountAndDate(paramsDel);
|
//删除历史接口检测趋势图数据
|
heathStateService.deleteByDate(paramsDel);
|
//删除历史数通检测趋势图数据
|
dceStateService.deleteByDate(paramsDel);
|
//删除系统日志数据
|
logInfoService.deleteByDate(paramsDel);
|
//删除数据表历史统计趋势图信息数据
|
dbTableCountService.deleteByDate(paramsDel);
|
//删除日志监控数据记录
|
fileWarnStateService.deleteByDate(paramsDel);
|
//删除执行下发状态记录
|
shellStateService.deleteByDate(paramsDel);
|
//删除磁盘总使用率趋势图信息
|
hostDiskPerService.deleteByAccountAndDate(paramsDel);
|
//删除历史SNMP设备检测趋势图数据
|
snmpStateService.deleteByDate(paramsDel);
|
//删除自定义监控项趋势图数据
|
customStateService.deleteByDate(paramsDel);
|
|
//所有主机增加一条磁盘总使用率 begin
|
addHostDiskPer();
|
//所有主机增加一条磁盘总使用率 end
|
|
//清空发告警邮件的记录
|
logger.info("清空告警标记");
|
WarnPools.clearOldData();
|
|
//清空登录错误缓存记录
|
logger.info("清空登录账号登录错误缓存记录");
|
StaticKeys.LOGIN_BLOCK_MAP.clear();
|
StaticKeys.LOGIN_ERROR_MAP.clear();
|
|
//清空web ssh终端缓存
|
logger.info("清空web ssh终端缓存");
|
NettytHandler.clearOldData();
|
|
//清空缓存主机备注信息
|
HostUtil.clearCacheMap();
|
|
//清空server-backup节点处理监控的各种数据ID集合
|
ServerBackupUtil.clearCacheIdList();
|
|
logInfoService.save("定时清空历史趋势图数据完成", "每天8:10清空" + commonConfig.getHistoryDataOut() +
|
"天前的监控历史趋势图数据,任务完成", StaticKeys.LOG_XTCZ);
|
|
}
|
//执行删除操作end
|
|
} catch (Exception e) {
|
logger.error("定时清空历史趋势图数据任务出错", e);
|
logInfoService.save("定时清空历史趋势图数据错误", e.toString(), StaticKeys.LOG_XTCZ);
|
}
|
logger.info("定时清空历史趋势图数据任务结束----------" + DateUtil.getCurrentDateTime());
|
}
|
|
|
}
|