Commit 583cb579 authored by gaozhentao's avatar gaozhentao

刪除微信告警測試方法,打印日志

parent 6edfe40a
......@@ -107,15 +107,16 @@ public class ReliabilityApi {
return manager.getStatistics();
}
@GetMapping("wxAlarm")
public boolean wxAlarm() {
return manager.wxAlarm();
}
/*
* 微信告警开关
* */
@PostMapping("changeSwitch")
public Map changeSwitch(@RequestBody String json) {
return manager.changeSwitch(json);
}
/*
* 获取微信告警开关状态
* */
@GetMapping("getSwitch")
public Map getSwitch() {
return manager.getSwitch();
......
......@@ -54,12 +54,10 @@ public class HttpTask extends BasicTask{
if(hostInfo.getRequest_body()== null){
map = SendHttpUtil.doPost(hostInfo.getService_path(),"");
}else {
long getStart = System.currentTimeMillis();
map = SendHttpUtil.doPost(hostInfo.getService_path(),hostInfo.getRequest_body());
}
}
if (hostInfo.getService_method().equals("get")) {
long getStart = System.currentTimeMillis();
map = SendHttpUtil.doGet(hostInfo.getService_path());
}
dur = System.currentTimeMillis() - start;
......
......@@ -81,7 +81,7 @@ public class QueryHostStatusTask implements Callable<SingleHostStatus> {
if (faultCount5Min != 0) value = "unstable";
// if (faultCount1Min != 0 && faultCount1Min >= correctCount1Min) value = "down";
if (faultCount1Min >= correctCount1Min) value = "down";
if (!value.equals("ok")) logger.error("返回状态为:{},5分钟内失败数:{},1分钟内失败数:{},标准值:{}", value, faultCount5Min, faultCount1Min, correctCount1Min);
if (!value.equals("ok")) logger.error("url:{},返回状态为:{},5分钟内失败数:{},1分钟内失败数:{},标准值:{}", tag, value, faultCount5Min, faultCount1Min, correctCount1Min);
hostStatusMap.put("faultCount", faultCountDay);
hostStatusMap.put("f60s", faultCount1Min);
hostStatusMap.put("value", value);
......
......@@ -570,22 +570,8 @@ public class Manager {
public boolean wxAlarm(){
/** 微信监控信息对象 */
MonitorConfig monitorConfig = new MonitorConfig();
monitorConfig.setAgentId(agentId);
monitorConfig.setCorpid(corpid);
monitorConfig.setCorpsecret(corpsecret);
monitorConfig.setUrl(wxurl);
String msg ="【告警测试】"+ "依图"+ " " + "192.168.56.15"
+ ":" +"22" + ",告警已恢复";
monitorConfig.setAlarmMsg(msg);
return MonitorUtil.wxAlarm(monitorConfig);
}
public Map changeSwitch(String json) {
JSONObject jsonObject = JSONObject.fromObject(json);
String currState = jsonObject.getString("state");
......
server:
port: 8091
port: 8090
spring:
data:
cassandra:
keyspace-name: ctid_prof
# contact-points: 192.168.189.130
# contact-points: 200.102.10.11
contact-points: 121.22.111.251
# contact-points: 172.16.15.7
# port: 9042
port: 9002
# username: gzt
# password: gzt
contact-points: 200.102.10.11
port: 9042
username: gzt
password: gzt
security:
user:
name: user
......@@ -27,12 +23,8 @@ jwt:
expiration: 1800000
tokenHead: "Bearer "
demo:
kairosdb:
# url: "http://172.16.15.7:8080"
# url: "http://192.168.189.130:8080"
# url: "http://200.102.10.11:8080"
url: "http://121.22.111.251:9008"
maxConnTotal: 50
maxConnPerRoute: 30
......@@ -49,10 +41,8 @@ alarm:
port: 8899
systemType: 101
tokeTime: 1200000
pointNumber: 60
#微信告警
#应用代理ID
agentId: 1000004
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment