|
@@ -17,7 +17,9 @@ public class MinitorApplication {
|
|
|
|
|
|
private static final String MINITOR_ALARM_CONTENT = "定时监控程序运行异常";
|
|
private static final String MINITOR_ALARM_CONTENT = "定时监控程序运行异常";
|
|
|
|
|
|
- private static final String ADMIN_PHONE = "18618105263";
|
|
|
|
|
|
+ private static final String SDK_MINITOR_ADMIN_PHONE = "18618105263";
|
|
|
|
+
|
|
|
|
+ private static final String SDK_ADMIN_PHONE = "18592030302";
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
TimerTask timerTask = new TimerTask() {
|
|
TimerTask timerTask = new TimerTask() {
|
|
@@ -27,7 +29,9 @@ public class MinitorApplication {
|
|
log.info("---调度监控程序---");
|
|
log.info("---调度监控程序---");
|
|
if (errorTimes == 5 && requestTimes == 5) {
|
|
if (errorTimes == 5 && requestTimes == 5) {
|
|
//钉钉群通知,报警
|
|
//钉钉群通知,报警
|
|
- boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT, true, null);
|
|
|
|
|
|
+ List<String> mobileList = new ArrayList<>();
|
|
|
|
+ mobileList.add(SDK_ADMIN_PHONE);
|
|
|
|
+ boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT, false, mobileList);
|
|
log.info("钉钉报警发送结果:" + alarmResult);
|
|
log.info("钉钉报警发送结果:" + alarmResult);
|
|
errorTimes = 0;
|
|
errorTimes = 0;
|
|
requestTimes = 0;
|
|
requestTimes = 0;
|
|
@@ -43,7 +47,7 @@ public class MinitorApplication {
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
List<String> mobileList = new ArrayList<>();
|
|
List<String> mobileList = new ArrayList<>();
|
|
- mobileList.add(ADMIN_PHONE);
|
|
|
|
|
|
+ mobileList.add(SDK_MINITOR_ADMIN_PHONE);
|
|
AlarmUtil.alarmByDingDing(MINITOR_ALARM_CONTENT, false, mobileList);
|
|
AlarmUtil.alarmByDingDing(MINITOR_ALARM_CONTENT, false, mobileList);
|
|
log.error("定时任务执行异常,", e);
|
|
log.error("定时任务执行异常,", e);
|
|
}
|
|
}
|