Showing
1 changed file
with
7 additions
and
3 deletions
@@ -218,12 +218,16 @@ public class ZabbixAlarm { | @@ -218,12 +218,16 @@ public class ZabbixAlarm { | ||
218 | //system.cpu在另外一个库中,调用另一个接口 | 218 | //system.cpu在另外一个库中,调用另一个接口 |
219 | if (StringUtils.startsWith(itemInfo.getKeyName(), "system.cpu")) { | 219 | if (StringUtils.startsWith(itemInfo.getKeyName(), "system.cpu")) { |
220 | 220 | ||
221 | + DEBUG.info("Start to query dhistoryinfo by item {}",itemInfo); | ||
222 | + | ||
221 | ZabbixDHistoryInfo dHistoryInfo = historyMapper.queryDHistoryInfo(itemInfo.getItemId()); | 223 | ZabbixDHistoryInfo dHistoryInfo = historyMapper.queryDHistoryInfo(itemInfo.getItemId()); |
222 | 224 | ||
223 | if (null != dHistoryInfo) { | 225 | if (null != dHistoryInfo) { |
224 | historyList.add(dHistoryInfo); | 226 | historyList.add(dHistoryInfo); |
225 | } | 227 | } |
226 | } else { | 228 | } else { |
229 | + DEBUG.info("Start to query historyinfo by item {}",itemInfo); | ||
230 | + | ||
227 | ZabbixUHistoryInfo uHistoryInfo = historyMapper.queryUHistoryInfo(itemInfo.getItemId()); | 231 | ZabbixUHistoryInfo uHistoryInfo = historyMapper.queryUHistoryInfo(itemInfo.getItemId()); |
228 | 232 | ||
229 | if (null != uHistoryInfo) { | 233 | if (null != uHistoryInfo) { |
@@ -267,15 +271,15 @@ public class ZabbixAlarm { | @@ -267,15 +271,15 @@ public class ZabbixAlarm { | ||
267 | 271 | ||
268 | Double outNet = PointBuilder.findValueByKey(NetIfEnum.NET_IF_OUT.key(), itemInfos, historyList); | 272 | Double outNet = PointBuilder.findValueByKey(NetIfEnum.NET_IF_OUT.key(), itemInfos, historyList); |
269 | 273 | ||
270 | - //|| zabbixMemAlarm > memPer | 274 | + //|| zabbixMemAlarm > memPer && queryErrorMap(ip) |
271 | 275 | ||
272 | - if ((zabbixCpuAlarm < userCpu || zabbixNetAlarm < inNet || zabbixNetAlarm < outNet) && queryErrorMap(ip)) { | 276 | + if ((zabbixCpuAlarm < userCpu || zabbixNetAlarm < inNet || zabbixNetAlarm < outNet)) { |
273 | 277 | ||
274 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); | 278 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); |
275 | 279 | ||
276 | String alarmInfo = String.format(ALARMTEMPLATE, nowTime, ip, tags, userCpu, String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet); | 280 | String alarmInfo = String.format(ALARMTEMPLATE, nowTime, ip, tags, userCpu, String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet); |
277 | 281 | ||
278 | - DEBUG.info("3m 3times ,send alarm vm info {}", alarmInfo); | 282 | + DEBUG.info("send alarm vm info {}", alarmInfo); |
279 | 283 | ||
280 | Constants.ERRORMAP.remove(ip); | 284 | Constants.ERRORMAP.remove(ip); |
281 | 285 |
-
Please register or login to post a comment