...
|
...
|
@@ -176,12 +176,13 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
String ip=jo.getString("ip");
|
|
|
String reason=jo.getString("reason");
|
|
|
String duration=jo.get("duration")==null?"":""+jo.get("duration");
|
|
|
String hbaseTime=String.valueOf(jo.getLongValue("timestamp"));
|
|
|
if(StringUtils.isNotBlank(ip)){
|
|
|
String smsStr = "成功捕获恶意ip->" + ip ;
|
|
|
alarmMsgService.sendSms("MaliciousIp", smsStr, mobile_yunwei);
|
|
|
|
|
|
try {
|
|
|
maliciousIpMapper.insertMipObj(influxDBStr, ip, reason, duration);
|
|
|
maliciousIpMapper.insertMipObj(influxDBStr, ip, reason, duration,hbaseTime);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("writeMipsObjToOpsReids insert mip into influxdb failed", e);
|
|
|
}
|
...
|
...
|
@@ -207,12 +208,14 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
JSONObject jo= ipsObjArray.getJSONObject(i);
|
|
|
String ip=jo.getString("ip");
|
|
|
String reason=jo.getString("reason");
|
|
|
String hbaseTime=String.valueOf(jo.getLongValue("timestamp"));
|
|
|
//String duration=jo.get("duration")==null?"":""+jo.get("duration");
|
|
|
if(StringUtils.isNotBlank(ip)){
|
|
|
|
|
|
MaliciousIpsRecordForbid record=new MaliciousIpsRecordForbid();
|
|
|
record.setIp(ip);
|
|
|
record.setReason(reason);
|
|
|
record.setHbaseTime(hbaseTime);
|
|
|
maliciousIpsRecordForbidMapper.insert(record);
|
|
|
|
|
|
logger.info("MaliciousIpServiceImpl writeMipsObjToOpsReids - "+ip);
|
...
|
...
|
@@ -888,7 +891,7 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
}
|
|
|
}
|
|
|
}catch(Exception e){
|
|
|
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
return list;
|
...
|
...
|
|