|
@@ -1,5 +1,6 @@
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
|
+import java.net.InetAddress;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Timer;
|
|
@@ -27,11 +28,15 @@ public class MinitorApplication {
|
|
|
public void run() {
|
|
|
try {
|
|
|
log.info("---调度监控程序---");
|
|
|
+
|
|
|
+
|
|
|
if (errorTimes == 5 && requestTimes == 5) {
|
|
|
//钉钉群通知,报警
|
|
|
+ InetAddress address = InetAddress.getLocalHost();
|
|
|
+ String hostAddress = address.getHostAddress();
|
|
|
List<String> mobileList = new ArrayList<>();
|
|
|
mobileList.add(SDK_ADMIN_PHONE);
|
|
|
- boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT, false, mobileList);
|
|
|
+ boolean alarmResult = AlarmUtil.alarmByDingDing(ALARM_CONTENT + "\n服务器ip:"+hostAddress, false, mobileList);
|
|
|
log.info("钉钉报警发送结果:" + alarmResult);
|
|
|
errorTimes = 0;
|
|
|
requestTimes = 0;
|