|
@@ -9,6 +9,8 @@ import com.monitor.influxdb.mapper.IDNSMonitorMapper; |
|
@@ -9,6 +9,8 @@ import com.monitor.influxdb.mapper.IDNSMonitorMapper; |
9
|
import com.monitor.other.dns.common.DNSConfig;
|
9
|
import com.monitor.other.dns.common.DNSConfig;
|
10
|
import com.monitor.other.dns.constant.InterVar;
|
10
|
import com.monitor.other.dns.constant.InterVar;
|
11
|
import com.monitor.other.dns.model.DNSIPsModel;
|
11
|
import com.monitor.other.dns.model.DNSIPsModel;
|
|
|
12
|
+import com.monitor.other.dns.model.HostDNSConnectModel;
|
|
|
13
|
+import com.monitor.other.dns.model.IPConnectModel;
|
12
|
import com.monitor.other.dns.model.IPModel;
|
14
|
import com.monitor.other.dns.model.IPModel;
|
13
|
import com.monitor.other.dns.service.IDNSMonitorService;
|
15
|
import com.monitor.other.dns.service.IDNSMonitorService;
|
14
|
import com.monitor.other.dns.service.IRestTemplateNoEncode;
|
16
|
import com.monitor.other.dns.service.IRestTemplateNoEncode;
|
|
@@ -21,7 +23,9 @@ import org.springframework.beans.factory.annotation.Value; |
|
@@ -21,7 +23,9 @@ import org.springframework.beans.factory.annotation.Value; |
21
|
import org.springframework.stereotype.Service;
|
23
|
import org.springframework.stereotype.Service;
|
22
|
|
24
|
|
23
|
import java.util.ArrayList;
|
25
|
import java.util.ArrayList;
|
|
|
26
|
+import java.util.HashMap;
|
24
|
import java.util.List;
|
27
|
import java.util.List;
|
|
|
28
|
+import java.util.Map;
|
25
|
|
29
|
|
26
|
/**
|
30
|
/**
|
27
|
* Created by yoho on 2016/8/1.
|
31
|
* Created by yoho on 2016/8/1.
|
|
@@ -58,27 +62,45 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -58,27 +62,45 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
58
|
*/
|
62
|
*/
|
59
|
@Override
|
63
|
@Override
|
60
|
public void monitor() {
|
64
|
public void monitor() {
|
|
|
65
|
+ List<HostDNSConnectModel> hostDNSConnectModelList = new ArrayList<>();
|
61
|
|
66
|
|
62
|
for (String host : dnsConfig.getHosts()) {
|
67
|
for (String host : dnsConfig.getHosts()) {
|
63
|
- for (String id : dnsConfig.getUids()) {
|
|
|
64
|
|
68
|
|
65
|
- String result = restTemplateNoEncode.doGet(buildDNSUrl(host,id));
|
|
|
66
|
- List<IPModel> ipModelList = parseIPModels(result);
|
69
|
+ HostDNSConnectModel hostDNSConnectModel = new HostDNSConnectModel(host);
|
|
|
70
|
+
|
|
|
71
|
+ //key为uid value为host+uid下的ip以及其状态
|
|
|
72
|
+ Map<String, List<IPConnectModel>> ipConnectModelsMap = new HashMap<>();
|
|
|
73
|
+
|
|
|
74
|
+ for (String uid : dnsConfig.getUids()) {
|
|
|
75
|
+
|
|
|
76
|
+ String result = restTemplateNoEncode.doGet(buildDNSUrl(host,uid));
|
|
|
77
|
+ List<String> ipModelList = parseIPModels(result);
|
67
|
|
78
|
|
68
|
- //调用dns api无返回ip,即异常,发送告警短信,把数据存数influxdb中
|
|
|
69
|
if (null == ipModelList) {
|
79
|
if (null == ipModelList) {
|
70
|
- alarmMsgService.sendSms("dns_exception", buildDNSFailedMsnContent(host, id),
|
80
|
+
|
|
|
81
|
+ //短信告警
|
|
|
82
|
+ alarmMsgService.sendSms("dns_exception", buildDNSFailedMsnContent(host, uid),
|
71
|
result, alarmMobile);
|
83
|
result, alarmMobile);
|
|
|
84
|
+ //host dns 检测数据存入influxdb
|
|
|
85
|
+ dnsMonitorMapper.insert(host, uid, IDNSMonitorMapper.FAILED, IDNSMonitorMapper.NULL_IP);
|
|
|
86
|
+
|
|
|
87
|
+ ipConnectModelsMap.put(uid, null);
|
72
|
logger.error("DNSMonitor Connect DNS no ip return.host:{},uid{}",
|
88
|
logger.error("DNSMonitor Connect DNS no ip return.host:{},uid{}",
|
73
|
- host, id);
|
|
|
74
|
- dnsMonitorMapper.insert(host, id, IDNSMonitorMapper.FAILED, IDNSMonitorMapper.NULL_IP);
|
89
|
+ host, uid);
|
75
|
continue;
|
90
|
continue;
|
76
|
}
|
91
|
}
|
77
|
|
92
|
|
78
|
- dnsMonitorMapper.insert(host, id, IDNSMonitorMapper.SUCCESSED, JSONArray.toJSONString(ipModelList));
|
|
|
79
|
- monitIPConnection(host, id, ipModelList);
|
93
|
+ //host dns 检测数据存入influxdb
|
|
|
94
|
+ dnsMonitorMapper.insert(host, uid, IDNSMonitorMapper.SUCCESSED, JSONArray.toJSONString(ipModelList));
|
|
|
95
|
+
|
|
|
96
|
+ monitIPConnection(host, uid, ipModelList, ipConnectModelsMap);
|
80
|
}
|
97
|
}
|
|
|
98
|
+ hostDNSConnectModel.setIps(ipConnectModelsMap);
|
|
|
99
|
+ hostDNSConnectModelList.add(hostDNSConnectModel);
|
81
|
}
|
100
|
}
|
|
|
101
|
+
|
|
|
102
|
+ InterVar.hostDNSConnectModelList.clear();
|
|
|
103
|
+ InterVar.hostDNSConnectModelList.addAll(hostDNSConnectModelList);
|
82
|
}
|
104
|
}
|
83
|
|
105
|
|
84
|
/**
|
106
|
/**
|
|
@@ -86,14 +108,15 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -86,14 +108,15 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
86
|
*
|
108
|
*
|
87
|
* m.yoho.com域名返回为网页,其他域名不注明则为api接口
|
109
|
* m.yoho.com域名返回为网页,其他域名不注明则为api接口
|
88
|
* @param host
|
110
|
* @param host
|
89
|
- * @param ipModelList
|
111
|
+ * @param ipList
|
90
|
*/
|
112
|
*/
|
91
|
- private void monitIPConnection(String host,String uid, List<IPModel> ipModelList) {
|
113
|
+ private void monitIPConnection(String host,String uid, List<String> ipList,
|
|
|
114
|
+ Map<String, List<IPConnectModel>> ipConnectionMaps) {
|
92
|
|
115
|
|
93
|
if (InterVar.M_YOHOBUY_COM.equals(host)) {
|
116
|
if (InterVar.M_YOHOBUY_COM.equals(host)) {
|
94
|
- monitMYohoBuyComIp(host, uid, ipModelList);
|
117
|
+ monitMYohoBuyComIp(host, uid, ipList, ipConnectionMaps);
|
95
|
} else {
|
118
|
} else {
|
96
|
- monitApiIp(host, uid, ipModelList);
|
119
|
+ monitApiIp(host, uid, ipList, ipConnectionMaps);
|
97
|
}
|
120
|
}
|
98
|
}
|
121
|
}
|
99
|
|
122
|
|
|
@@ -101,33 +124,37 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -101,33 +124,37 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
101
|
*
|
124
|
*
|
102
|
* @param host
|
125
|
* @param host
|
103
|
* @param uid
|
126
|
* @param uid
|
104
|
- * @param ipModelList
|
127
|
+ * @param ipList
|
105
|
*/
|
128
|
*/
|
106
|
- private void monitApiIp(String host, String uid, List<IPModel> ipModelList) {
|
129
|
+ private void monitApiIp(String host, String uid, List<String> ipList,
|
|
|
130
|
+ Map<String, List<IPConnectModel>> ipConnectionMap) {
|
107
|
List<String> errorIPs = new ArrayList<>();
|
131
|
List<String> errorIPs = new ArrayList<>();
|
108
|
StringBuilder alarmInfo = new StringBuilder();
|
132
|
StringBuilder alarmInfo = new StringBuilder();
|
|
|
133
|
+ List<IPConnectModel> ipConnectModels = new ArrayList<>();
|
109
|
|
134
|
|
110
|
- for (IPModel ipModel : ipModelList) {
|
135
|
+ for (String ip : ipList) {
|
111
|
|
136
|
|
112
|
String responseCode = restTemplateNoEncode.doGetResponseCode(
|
137
|
String responseCode = restTemplateNoEncode.doGetResponseCode(
|
113
|
- InterVar.HTTP + ipModel.getIp() + dnsConfig.getServices().get(host));
|
138
|
+ InterVar.HTTP + ip + dnsConfig.getServices().get(host));
|
114
|
|
139
|
|
115
|
//ip不通,告警
|
140
|
//ip不通,告警
|
116
|
if (!InterVar.RESPONSE_CODE_200.equals(responseCode) || null == responseCode) {
|
141
|
if (!InterVar.RESPONSE_CODE_200.equals(responseCode) || null == responseCode) {
|
117
|
- errorIPs.add(ipModel.getIp());
|
142
|
+ errorIPs.add(ip);
|
118
|
alarmInfo.append(" ip: ");
|
143
|
alarmInfo.append(" ip: ");
|
119
|
- alarmInfo.append(ipModel.getIp());
|
144
|
+ alarmInfo.append(ip);
|
120
|
alarmInfo.append(" 不通. ");
|
145
|
alarmInfo.append(" 不通. ");
|
121
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 不通。",
|
146
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 不通。",
|
122
|
- host, uid, ipModel.getIp());
|
|
|
123
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(),
|
|
|
124
|
- IDNSMonitorMapper.FAILED, IDNSMonitorMapper.HTTP_STATUS_CODE_NOT_200, "");
|
147
|
+ host, uid, ip);
|
|
|
148
|
+ dnsMonitorMapper.insert(host, uid, ip, IDNSMonitorMapper.FAILED,
|
|
|
149
|
+ IDNSMonitorMapper.HTTP_STATUS_CODE_NOT_200, "");
|
|
|
150
|
+
|
|
|
151
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.FAILED, InterVar.HTTP_STATUS_CODE_NOT_200));
|
125
|
continue;
|
152
|
continue;
|
126
|
}
|
153
|
}
|
127
|
|
154
|
|
128
|
//获取服务请求返回的数据是否正确 code:200
|
155
|
//获取服务请求返回的数据是否正确 code:200
|
129
|
String response = httpRestClientService.doGet(
|
156
|
String response = httpRestClientService.doGet(
|
130
|
- InterVar.HTTP + ipModel.getIp() + dnsConfig.getServices().get(host), null);
|
157
|
+ InterVar.HTTP + ip + dnsConfig.getServices().get(host), null);
|
131
|
|
158
|
|
132
|
String resultCode = null;
|
159
|
String resultCode = null;
|
133
|
|
160
|
|
|
@@ -140,32 +167,36 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -140,32 +167,36 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
140
|
|
167
|
|
141
|
//返回数据 code!=200 告警
|
168
|
//返回数据 code!=200 告警
|
142
|
if (!InterVar.RESPONSE_CODE_200.equals(resultCode) || null == response) {
|
169
|
if (!InterVar.RESPONSE_CODE_200.equals(resultCode) || null == response) {
|
143
|
- errorIPs.add(ipModel.getIp());
|
170
|
+ errorIPs.add(ip);
|
144
|
|
171
|
|
145
|
alarmInfo.append(" ip: ");
|
172
|
alarmInfo.append(" ip: ");
|
146
|
- alarmInfo.append(ipModel.getIp());
|
173
|
+ alarmInfo.append(ip);
|
147
|
alarmInfo.append(";response: ");
|
174
|
alarmInfo.append(";response: ");
|
148
|
alarmInfo.append(response);
|
175
|
alarmInfo.append(response);
|
149
|
alarmInfo.append(". ");
|
176
|
alarmInfo.append(". ");
|
150
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {}, response {} ",
|
177
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {}, response {} ",
|
151
|
- host, uid, ipModel.getIp(), response);
|
178
|
+ host, uid, ip, response);
|
152
|
|
179
|
|
153
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(),
|
180
|
+ dnsMonitorMapper.insert(host, uid, ip,
|
154
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.RETURN_DATA_CODE_NOT_200,
|
181
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.RETURN_DATA_CODE_NOT_200,
|
155
|
response);
|
182
|
response);
|
|
|
183
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.FAILED, InterVar.RETURN_DATA_CODE_NOT_200));
|
156
|
continue;
|
184
|
continue;
|
157
|
}
|
185
|
}
|
158
|
|
186
|
|
159
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(), IDNSMonitorMapper.SUCCESSED, "", "");
|
187
|
+ dnsMonitorMapper.insert(host, uid, ip, IDNSMonitorMapper.SUCCESSED, "", "");
|
|
|
188
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.SUCCESSED, ""));
|
160
|
}
|
189
|
}
|
161
|
|
190
|
|
|
|
191
|
+ ipConnectionMap.put(uid, ipConnectModels);
|
|
|
192
|
+
|
162
|
if (!errorIPs.isEmpty()) {
|
193
|
if (!errorIPs.isEmpty()) {
|
163
|
alarmMsgService.sendSms("dns_exception",
|
194
|
alarmMsgService.sendSms("dns_exception",
|
164
|
- buildIPConnectFailedMsnContent(host, uid, ipModelList, errorIPs),
|
195
|
+ buildIPConnectFailedMsnContent(host, uid, ipList, errorIPs),
|
165
|
alarmInfo.toString(), alarmMobile);
|
196
|
alarmInfo.toString(), alarmMobile);
|
166
|
|
197
|
|
167
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, dnsIP {}, connextFailedIP {}",
|
198
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, dnsIP {}, connextFailedIP {}",
|
168
|
- host, uid, ipModelList.toString(), errorIPs.toString());
|
199
|
+ host, uid, ipList.toString(), errorIPs.toString());
|
169
|
}
|
200
|
}
|
170
|
}
|
201
|
}
|
171
|
|
202
|
|
|
@@ -176,55 +207,63 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -176,55 +207,63 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
176
|
* 2.返回预期数据
|
207
|
* 2.返回预期数据
|
177
|
* @param host
|
208
|
* @param host
|
178
|
* @param uid
|
209
|
* @param uid
|
179
|
- * @param ipModelList
|
210
|
+ * @param ipList
|
180
|
*/
|
211
|
*/
|
181
|
- private void monitMYohoBuyComIp(String host, String uid, List<IPModel> ipModelList) {
|
212
|
+ private void monitMYohoBuyComIp(String host, String uid, List<String> ipList,
|
|
|
213
|
+ Map<String, List<IPConnectModel>> ipConnectionMap) {
|
182
|
List<String> errorIPs = new ArrayList<>();
|
214
|
List<String> errorIPs = new ArrayList<>();
|
183
|
StringBuilder alarmInfo = new StringBuilder();
|
215
|
StringBuilder alarmInfo = new StringBuilder();
|
|
|
216
|
+ List<IPConnectModel> ipConnectModels = new ArrayList<>();
|
184
|
|
217
|
|
185
|
- for (IPModel ipModel : ipModelList) {
|
218
|
+ for (String ip : ipList) {
|
186
|
|
219
|
|
187
|
- String responseCode = restTemplateNoEncode.doGetResponseCode(InterVar.HTTPS + ipModel.getIp());
|
220
|
+ String responseCode = restTemplateNoEncode.doGetResponseCode(InterVar.HTTPS + ip);
|
188
|
|
221
|
|
189
|
//ip不通,异常数据告警
|
222
|
//ip不通,异常数据告警
|
190
|
if (!InterVar.RESPONSE_CODE_200.equals(responseCode) || null == responseCode) {
|
223
|
if (!InterVar.RESPONSE_CODE_200.equals(responseCode) || null == responseCode) {
|
191
|
- errorIPs.add(ipModel.getIp());
|
224
|
+ errorIPs.add(ip);
|
192
|
alarmInfo.append(" ip: ");
|
225
|
alarmInfo.append(" ip: ");
|
193
|
- alarmInfo.append(ipModel.getIp());
|
226
|
+ alarmInfo.append(ip);
|
194
|
alarmInfo.append(" 不通. ");
|
227
|
alarmInfo.append(" 不通. ");
|
195
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 不通。",
|
228
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 不通。",
|
196
|
- host, uid, ipModel.getIp());
|
|
|
197
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(),
|
229
|
+ host, uid, ip);
|
|
|
230
|
+ dnsMonitorMapper.insert(host, uid, ip,
|
198
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.HTTP_STATUS_CODE_NOT_200, "");
|
231
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.HTTP_STATUS_CODE_NOT_200, "");
|
|
|
232
|
+
|
|
|
233
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.FAILED, InterVar.HTTP_STATUS_CODE_NOT_200));
|
199
|
continue;
|
234
|
continue;
|
200
|
}
|
235
|
}
|
201
|
|
236
|
|
202
|
//检测该ip是否返回预期网页
|
237
|
//检测该ip是否返回预期网页
|
203
|
String response = restTemplateNoEncode.doGet(
|
238
|
String response = restTemplateNoEncode.doGet(
|
204
|
- InterVar.HTTPS + ipModel.getIp() + dnsConfig.getServices().get(host));
|
239
|
+ InterVar.HTTPS + ip + dnsConfig.getServices().get(host));
|
205
|
|
240
|
|
206
|
//验证返回网页是否正确 如果不含有该字符串则返回结果错误
|
241
|
//验证返回网页是否正确 如果不含有该字符串则返回结果错误
|
207
|
if (-1 == response.indexOf(InterVar.M_YOHOBUY_COM_RESPONSE_PATTEN) || null == response) {
|
242
|
if (-1 == response.indexOf(InterVar.M_YOHOBUY_COM_RESPONSE_PATTEN) || null == response) {
|
208
|
- errorIPs.add(ipModel.getIp());
|
243
|
+ errorIPs.add(ip);
|
209
|
alarmInfo.append(" ip: ");
|
244
|
alarmInfo.append(" ip: ");
|
210
|
- alarmInfo.append(ipModel.getIp());
|
245
|
+ alarmInfo.append(ip);
|
211
|
alarmInfo.append(" 返回网页错误. ");
|
246
|
alarmInfo.append(" 返回网页错误. ");
|
212
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(),
|
247
|
+ dnsMonitorMapper.insert(host, uid, ip,
|
213
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.RETURN_DATA_CODE_NOT_200, response);
|
248
|
IDNSMonitorMapper.FAILED, IDNSMonitorMapper.RETURN_DATA_CODE_NOT_200, response);
|
214
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 结果错误。",
|
249
|
logger.info("DNSMonitor Connect DNS API: host {}, uid {}, ip {} 结果错误。",
|
215
|
- host, uid, ipModel.getIp());
|
250
|
+ host, uid, ip);
|
|
|
251
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.FAILED, InterVar.RETURN_DATA_CODE_NOT_200));
|
216
|
continue;
|
252
|
continue;
|
217
|
}
|
253
|
}
|
218
|
|
254
|
|
219
|
- dnsMonitorMapper.insert(host, uid, ipModel.getIp(), IDNSMonitorMapper.SUCCESSED, "", "");
|
255
|
+ dnsMonitorMapper.insert(host, uid, ip, IDNSMonitorMapper.SUCCESSED, "", "");
|
|
|
256
|
+ ipConnectModels.add(new IPConnectModel(ip, InterVar.SUCCESSED, ""));
|
220
|
}
|
257
|
}
|
221
|
|
258
|
|
|
|
259
|
+ ipConnectionMap.put(uid, ipConnectModels);
|
|
|
260
|
+
|
222
|
if (!errorIPs.isEmpty()) {
|
261
|
if (!errorIPs.isEmpty()) {
|
223
|
alarmMsgService.sendSms("dns_exception",
|
262
|
alarmMsgService.sendSms("dns_exception",
|
224
|
- buildIPConnectFailedMsnContent(host, uid, ipModelList, errorIPs),
|
263
|
+ buildIPConnectFailedMsnContent(host, uid, ipList, errorIPs),
|
225
|
alarmInfo.toString(), alarmMobile);
|
264
|
alarmInfo.toString(), alarmMobile);
|
226
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, dnsIP {}, connextFailedIP {}",
|
265
|
logger.error("DNSMonitor Connect DNS API: host {}, uid {}, dnsIP {}, connextFailedIP {}",
|
227
|
- host, uid, ipModelList.toString(), errorIPs.toString());
|
266
|
+ host, uid, ipList.toString(), errorIPs.toString());
|
228
|
}
|
267
|
}
|
229
|
}
|
268
|
}
|
230
|
|
269
|
|
|
@@ -235,13 +274,21 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -235,13 +274,21 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
235
|
* @param result
|
274
|
* @param result
|
236
|
* @return
|
275
|
* @return
|
237
|
*/
|
276
|
*/
|
238
|
- private List<IPModel> parseIPModels(String result) {
|
277
|
+ private List<String> parseIPModels(String result) {
|
239
|
String decodeResult = AESUtil.decode(result);
|
278
|
String decodeResult = AESUtil.decode(result);
|
240
|
|
279
|
|
241
|
DNSIPsModel dnsiPsModel = JSON.parseObject(decodeResult, DNSIPsModel.class);
|
280
|
DNSIPsModel dnsiPsModel = JSON.parseObject(decodeResult, DNSIPsModel.class);
|
242
|
List<IPModel> ipModelList = JSON.parseArray(dnsiPsModel.getContent() , IPModel.class);
|
281
|
List<IPModel> ipModelList = JSON.parseArray(dnsiPsModel.getContent() , IPModel.class);
|
243
|
|
282
|
|
244
|
- return ipModelList;
|
283
|
+ if (null == ipModelList) {
|
|
|
284
|
+ return null;
|
|
|
285
|
+ }
|
|
|
286
|
+
|
|
|
287
|
+ List<String> ipList = new ArrayList<String>();
|
|
|
288
|
+ for (IPModel ipModel : ipModelList) {
|
|
|
289
|
+ ipList.add(ipModel.getIp());
|
|
|
290
|
+ }
|
|
|
291
|
+ return ipList;
|
245
|
}
|
292
|
}
|
246
|
|
293
|
|
247
|
/**
|
294
|
/**
|
|
@@ -269,7 +316,7 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
|
@@ -269,7 +316,7 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
269
|
* @param connectFailedIps 访问失败的ip组
|
316
|
* @param connectFailedIps 访问失败的ip组
|
270
|
* @return
|
317
|
* @return
|
271
|
*/
|
318
|
*/
|
272
|
- private String buildIPConnectFailedMsnContent(String host, String uid, List<IPModel> ips,
|
319
|
+ private String buildIPConnectFailedMsnContent(String host, String uid, List<String> ips,
|
273
|
List<String> connectFailedIps) {
|
320
|
List<String> connectFailedIps) {
|
274
|
StringBuilder sb = new StringBuilder();
|
321
|
StringBuilder sb = new StringBuilder();
|
275
|
sb.append("DNS解析IP错误!");
|
322
|
sb.append("DNS解析IP错误!");
|