Showing
1 changed file
with
2 additions
and
8 deletions
@@ -232,8 +232,8 @@ public class ZabbixAlarm { | @@ -232,8 +232,8 @@ public class ZabbixAlarm { | ||
232 | return; | 232 | return; |
233 | } | 233 | } |
234 | String tags = hostInfo.getTags(); | 234 | String tags = hostInfo.getTags(); |
235 | - //过滤 ops 、 gray | ||
236 | - if (StringUtils.isBlank(tags) || StringUtils.contains(StringUtils.lowerCase(tags), "ops") || StringUtils.contains(tags, "灰度")) { | 235 | + //过滤 ops 、 gray 、bigdata |
236 | + if (StringUtils.isBlank(tags) || StringUtils.contains(StringUtils.lowerCase(tags), "ops") || StringUtils.contains(tags, "灰度")||(("bigdata,").equals(tags))) { | ||
237 | return; | 237 | return; |
238 | } | 238 | } |
239 | //当前cpu | 239 | //当前cpu |
@@ -266,7 +266,6 @@ public class ZabbixAlarm { | @@ -266,7 +266,6 @@ public class ZabbixAlarm { | ||
266 | //网卡进出流量 大于 500m | 266 | //网卡进出流量 大于 500m |
267 | if (zabbixNetAlarm < inNet || zabbixNetAlarm < outNet) { | 267 | if (zabbixNetAlarm < inNet || zabbixNetAlarm < outNet) { |
268 | boolean sendFlag=true; | 268 | boolean sendFlag=true; |
269 | - if(tags!=null){ | ||
270 | if(tags.indexOf("bigdata,")>=0){ | 269 | if(tags.indexOf("bigdata,")>=0){ |
271 | //// 暂时不报警 | 270 | //// 暂时不报警 |
272 | if(tags.indexOf("mysql,")>=0){ | 271 | if(tags.indexOf("mysql,")>=0){ |
@@ -286,7 +285,6 @@ public class ZabbixAlarm { | @@ -286,7 +285,6 @@ public class ZabbixAlarm { | ||
286 | sendFlag=false; | 285 | sendFlag=false; |
287 | } | 286 | } |
288 | } | 287 | } |
289 | - } | ||
290 | 288 | ||
291 | if(sendFlag){ | 289 | if(sendFlag){ |
292 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); | 290 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); |
@@ -300,9 +298,6 @@ public class ZabbixAlarm { | @@ -300,9 +298,6 @@ public class ZabbixAlarm { | ||
300 | } | 298 | } |
301 | //cpu 大于 90% | 299 | //cpu 大于 90% |
302 | if (zabbixCpuAlarm < userCpu) { | 300 | if (zabbixCpuAlarm < userCpu) { |
303 | - if(tags!=null&&tags.indexOf("bigdata,")<0){ | ||
304 | - //// 暂时不报警 | ||
305 | - }else{ | ||
306 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); | 301 | String nowTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); |
307 | String alarmInfo = String.format(ALARMTEMPLATE, nowTime, userCpuTime, ip, tags, userCpu, String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet); | 302 | String alarmInfo = String.format(ALARMTEMPLATE, nowTime, userCpuTime, ip, tags, userCpu, String.valueOf(avMem) + " / " + String.valueOf(toMem), inNet, outNet); |
308 | DEBUG.info("send alarm vm info {}", alarmInfo); | 303 | DEBUG.info("send alarm vm info {}", alarmInfo); |
@@ -312,7 +307,6 @@ public class ZabbixAlarm { | @@ -312,7 +307,6 @@ public class ZabbixAlarm { | ||
312 | alarmMsgService.sendSms("vm-per-cpu", alarmInfo, mobile_yunwei); | 307 | alarmMsgService.sendSms("vm-per-cpu", alarmInfo, mobile_yunwei); |
313 | } | 308 | } |
314 | } | 309 | } |
315 | - } | ||
316 | 310 | ||
317 | /** | 311 | /** |
318 | * 查询最近告警记录,未满三次的不发送告警短信,满三次发送告警短信 | 312 | * 查询最近告警记录,未满三次的不发送告警短信,满三次发送告警短信 |
-
Please register or login to post a comment