Commit 62ef6ccaeb87172c39a208a89ec64774f1b4da05
1 parent
469e1e09
Exists in
master
upgrade remote ip id
Showing
3 changed files
with
12 additions
and
11 deletions
Show diff stats
build.gradle
src/main/java/com/taover/heartbeat/bean/ClientRequest.java
... | ... | @@ -72,7 +72,7 @@ public class ClientRequest { |
72 | 72 | String unixtime = request.getParameter("unixtime"); |
73 | 73 | String seckey = request.getParameter("seckey"); |
74 | 74 | String ip = request.getRemoteHost(); |
75 | - return new ClientRequest(code, ip, | |
75 | + return new ClientRequest(code, ip, | |
76 | 76 | maxWaitSec==null?Instance.DEFAULT_MAX_WAIT_SEC:Integer.valueOf(maxWaitSec), |
77 | 77 | fixRateSec==null?Instance.DEFAULT_FIX_RATE_SEC:Integer.valueOf(fixRateSec), |
78 | 78 | unixtime==null?System.currentTimeMillis()/1000:Long.valueOf(unixtime), |
... | ... | @@ -80,6 +80,7 @@ public class ClientRequest { |
80 | 80 | } |
81 | 81 | |
82 | 82 | public String getIdentity() { |
83 | - return this.code + "@" + this.ip; | |
83 | + //return this.code + "@" + this.ip; | |
84 | + return this.code; | |
84 | 85 | } |
85 | 86 | } | ... | ... |
src/main/java/com/taover/heartbeat/bean/ReformInstance.java
... | ... | @@ -62,11 +62,11 @@ public class ReformInstance { |
62 | 62 | htmlContent += " 未收到服务器响应\n"; |
63 | 63 | }else { |
64 | 64 | if(instance.getLatestServerResponse().isOverdue()) { |
65 | - htmlContent += " 向服务器接口["+instance.getUrl()+"]发送请求,响应超时["+instance.getMaxWaitSec()+"s],请及时确认服务器是否正常运行\n"; | |
65 | + htmlContent += " 向接口["+instance.getUrl()+"]发送请求,响应超时["+instance.getMaxWaitSec()+"s],请及时确认服务是否正常运行\n"; | |
66 | 66 | }else if(!instance.getLatestServerResponse().isCodeOk()) { |
67 | - htmlContent += " 向服务器接口["+instance.getUrl()+"]发送请求,响应数据不正常(详细请查看邮件),请及时确认服务器是否正常运行\n"; | |
67 | + htmlContent += " 向接口["+instance.getUrl()+"]发送请求,响应数据不正常(详细请查看邮件),请及时确认服务是否正常运行\n"; | |
68 | 68 | }else { |
69 | - htmlContent += " 向服务器接口["+instance.getUrl()+"]发送请求,未知异常,请及时确认服务器是否正常运行\n"; | |
69 | + htmlContent += " 向接口["+instance.getUrl()+"]发送请求,未知异常,请及时确认服务是否正常运行\n"; | |
70 | 70 | } |
71 | 71 | } |
72 | 72 | htmlContent += " 最后一次请求时间: "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(instance.getLatestRequestUnixtime()*1000)); |
... | ... | @@ -74,9 +74,9 @@ public class ReformInstance { |
74 | 74 | } |
75 | 75 | |
76 | 76 | private String formatWeixin(ClientInstance instance) { |
77 | - String htmlContent = " 超过"+instance.getFixRateSec()+"秒未收到请求,请确认CODE["+instance.getCode()+"]对应的客户端是否运行正常\n"; | |
77 | + String htmlContent = " 超过"+instance.getFixRateSec()+"秒未收到请求,请确认CODE["+instance.getCode()+"]对应的服务是否运行正常\n"; | |
78 | 78 | htmlContent += " 客户端最后一次请求时间: "+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(instance.getLastestClientRequest().getUnixtime()*1000))+"\n"; |
79 | - htmlContent += " 客户端IP:"+instance.getIp(); | |
79 | + //htmlContent += " 客户端IP:"+instance.getIp(); | |
80 | 80 | htmlContent += " 累计次数(3次后不再报警):"+instance.getLostClientRequestCount(); |
81 | 81 | return htmlContent; |
82 | 82 | } |
... | ... | @@ -108,9 +108,9 @@ public class ReformInstance { |
108 | 108 | htmlContent += "<h4 style=\"color:red;\">"; |
109 | 109 | if(instance.getLatestServerResponse() != null) { |
110 | 110 | if(instance.getLatestServerResponse().isOverdue()) { |
111 | - htmlContent += " 向服务器接口["+instance.getUrl()+"]发送请求,响应超时["+instance.getMaxWaitSec()+"s],请及时确认服务器是否正常运行"; | |
111 | + htmlContent += " 向接口["+instance.getUrl()+"]发送请求,响应超时["+instance.getMaxWaitSec()+"s],请及时确认服务是否正常运行"; | |
112 | 112 | }else if(!instance.getLatestServerResponse().isCodeOk()) { |
113 | - htmlContent += " 向服务器接口["+instance.getUrl()+"]发送请求,响应数据不正常(详细请查看邮件),请及时确认服务器是否正常运行"; | |
113 | + htmlContent += " 向接口["+instance.getUrl()+"]发送请求,响应数据不正常(详细请查看邮件),请及时确认服务是否正常运行"; | |
114 | 114 | }else { |
115 | 115 | htmlContent += "未知异常"; |
116 | 116 | } |
... | ... | @@ -138,7 +138,7 @@ public class ReformInstance { |
138 | 138 | htmlContent += "</h4>"; |
139 | 139 | htmlContent += "<ul>"; |
140 | 140 | htmlContent += "<li>CODE: "+instance.getCode()+"</li>"; |
141 | - htmlContent += "<li>IP: "+instance.getIp()+"</li>"; | |
141 | + //htmlContent += "<li>IP: "+instance.getIp()+"</li>"; | |
142 | 142 | htmlContent += "<li>请求频率: "+instance.getFixRateSec()+"秒/次</li>"; |
143 | 143 | htmlContent += "<li>请求最大等待时间: "+instance.getMaxWaitSec()+"秒</li>"; |
144 | 144 | htmlContent += "<li>客户端请求时间戳: "+sdf.format(new Date(instance.getUnixtime()*1000))+"</li>"; | ... | ... |