|
@@ -24,16 +24,16 @@ public class MinitorApplication {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
+ log.info("---调度监控程序---");
|
|
|
if (errorTimes == 5 && requestTimes == 5) {
|
|
|
//钉钉群通知,报警
|
|
|
-// boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT, true, null);
|
|
|
-// log.info("钉钉报警发送结果:" + alarmResult);
|
|
|
- log.error("发送报警");
|
|
|
+ boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT, true, null);
|
|
|
+ log.info("钉钉报警发送结果:" + alarmResult);
|
|
|
errorTimes = 0;
|
|
|
requestTimes = 0;
|
|
|
} else {
|
|
|
//访问SDK接口
|
|
|
- boolean sdkResult = RequestUtil.requestSDK();
|
|
|
+ boolean sdkResult = RequestUtil.requestSDK(args[0], args[1]);
|
|
|
requestTimes++;
|
|
|
|
|
|
if (!sdkResult) {
|
|
@@ -52,6 +52,6 @@ public class MinitorApplication {
|
|
|
// 计时器
|
|
|
Timer timer = new Timer();
|
|
|
// 添加执行任务(延迟 0s 执行,每 60s 执行一次)
|
|
|
- timer.schedule(timerTask, 0, 5000);
|
|
|
+ timer.schedule(timerTask, 0, 60000);
|
|
|
}
|
|
|
}
|