告警记录优化

This commit is contained in:
慕下 2024-08-14 16:28:37 +08:00
parent 3b7cb6da7a
commit 96e50b4462
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.trade.doTest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
@Slf4j
public class DoKDTest {
@Test
public void test(){
String url = "http://127.0.0.1:6127/admin-api/trade/delivery/express-template/doTest";
DeliveryExpressDO expressDO = new DeliveryExpressDO();
expressDO.setCode("134435");
expressDO.setLogo("scsdc");
expressDO.setName("jjjj");
HttpResponse postSec = HttpUtil.createPost(url)
.header("Content-Type","application/x-www-form-urlencoded")
.header("tenant-id","1")
.body(expressDO.toString())
.execute();
System.out.println(postSec.body());
}
}

View File

@ -82,7 +82,7 @@ public class WarningJob implements JobHandler {
OperateWarningDO spaceWarningDO = new OperateWarningDO(); OperateWarningDO spaceWarningDO = new OperateWarningDO();
spaceWarningDO.setAlarmPolicy("磁盘告警策略"); spaceWarningDO.setAlarmPolicy("磁盘告警策略");
spaceWarningDO.setMonitoringObject("磁盘"); spaceWarningDO.setMonitoringObject("磁盘");
spaceWarningDO.setTriggeringCondition("当磁盘占用率达到"+Double.parseDouble(configCountProcessCPUDo.getLabel())*100+"%"); spaceWarningDO.setTriggeringCondition("当磁盘占用率达到"+Double.parseDouble(configCountDo.getLabel())*100+"%");
operateWarningMapper.insert(spaceWarningDO); operateWarningMapper.insert(spaceWarningDO);
} }
} catch (Exception e) { } catch (Exception e) {