Authored by jack xue

告警通知修改

@@ -275,10 +275,18 @@ public class BaseLogJob implements Callable { @@ -275,10 +275,18 @@ public class BaseLogJob implements Callable {
275 protected String buildAlarmMsg() { 275 protected String buildAlarmMsg() {
276 276
277 StringBuilder builder = new StringBuilder(); 277 StringBuilder builder = new StringBuilder();
278 - builder.append("{"); 278 + if(StringUtils.equals(this.measureName,InterVar.APIACCESSMEASURE))
  279 + {
  280 + builder.append("{Warn:ApiNot200;");
  281 + }
  282 + else
  283 + {
  284 + builder.append("{Warn:ServiceNot200;");
  285 + }
  286 +
279 builder.append("云:").append(type).append(";"); 287 builder.append("云:").append(type).append(";");
280 builder.append("总计:").append(this.apiSeriesModelList.size()).append(";"); 288 builder.append("总计:").append(this.apiSeriesModelList.size()).append(";");
281 - builder.append("top接口:"); 289 + builder.append("Top接口:");
282 builder.append(this.resultList.get(0).getApiKey()).append(" : ").append(this.resultList.get(0).getApiSeriesModelList().size()).append(";"); 290 builder.append(this.resultList.get(0).getApiKey()).append(" : ").append(this.resultList.get(0).getApiSeriesModelList().size()).append(";");
283 builder.append("}"); 291 builder.append("}");
284 return builder.toString(); 292 return builder.toString();
@@ -231,15 +231,15 @@ public class ErrorLogJob implements Callable { @@ -231,15 +231,15 @@ public class ErrorLogJob implements Callable {
231 231
232 errorSeriesModel.setMessage(oneRow.get(KINDEMAPS.get("err_msg")).toString()); 232 errorSeriesModel.setMessage(oneRow.get(KINDEMAPS.get("err_msg")).toString());
233 233
234 - if (errorSeriesModel.getMessage().contains("Lua")) { 234 + if (errorSeriesModel.getMessage().contains("[lua]")) {
235 235
236 - errorSeriesModel.setType("Lua"); 236 + errorSeriesModel.setType("Lua-error");
237 237
238 } else if (errorSeriesModel.getMessage().contains(": Connection")) { 238 } else if (errorSeriesModel.getMessage().contains(": Connection")) {
239 239
240 - errorSeriesModel.setType("Connection"); 240 + errorSeriesModel.setType("Connection-error");
241 } else { 241 } else {
242 - errorSeriesModel.setType("Others"); 242 + errorSeriesModel.setType("Others-error");
243 } 243 }
244 244
245 errorSeriesModelList.add(errorSeriesModel); 245 errorSeriesModelList.add(errorSeriesModel);
@@ -260,7 +260,7 @@ public class ErrorLogJob implements Callable { @@ -260,7 +260,7 @@ public class ErrorLogJob implements Callable {
260 private String buildAlarmMsg() { 260 private String buildAlarmMsg() {
261 261
262 StringBuilder builder = new StringBuilder(); 262 StringBuilder builder = new StringBuilder();
263 - builder.append("{"); 263 + builder.append("{Warn:Nginx-Error;");
264 builder.append("云:").append(type).append(";"); 264 builder.append("云:").append(type).append(";");
265 builder.append("总计:").append(this.errorSeriesModelList.size()).append(";"); 265 builder.append("总计:").append(this.errorSeriesModelList.size()).append(";");
266 List<ErrorStaModel> operList = null; 266 List<ErrorStaModel> operList = null;
@@ -270,7 +270,7 @@ public class ErrorLogJob implements Callable { @@ -270,7 +270,7 @@ public class ErrorLogJob implements Callable {
270 operList = InterVar.QC_NGINX_ERROR_LIST; 270 operList = InterVar.QC_NGINX_ERROR_LIST;
271 } 271 }
272 for (ErrorStaModel errorStaModel : operList) { 272 for (ErrorStaModel errorStaModel : operList) {
273 - builder.append(errorStaModel.getType()).append(":").append(errorStaModel.getErrorSeriesModelList().size()); 273 + builder.append("Error:").append(errorStaModel.getType()).append("-").append(errorStaModel.getErrorSeriesModelList().size());
274 } 274 }
275 275
276 builder.append("}"); 276 builder.append("}");