Authored by qinchao

手机号码改为通过组加载

... ... @@ -16,19 +16,6 @@ import javax.annotation.PostConstruct;
public class SnsMobileConfig {
public static final Logger logger = LoggerFactory.getLogger(SnsMobileConfig.class);
@Autowired
private GetUsersInfoUtil getUsersInfoUtil;
@Value("${base_mobile}")
private String baseMobile;
@Value("${redis_exception_mobile}")
private String redisMobile;
@Value("${java_service_alarm_mobile}")
private String javaServiceMobile;
@Value("${java_service_alarm_flag}")
private boolean javaServiceFlag;
... ... @@ -38,11 +25,19 @@ public class SnsMobileConfig {
@Value("${java_service_alarm_count_threshold}")
private Integer javaServiceCountThreshold;
@Value("${java_api_error}")
private String javaApiError;
@Autowired
private GetUsersInfoUtil getUsersInfoUtil;
private String bigdataMobile;
private String javaApiError;
private String javaServiceMobile;
private String redisMobile;
private String baseMobile;
@PostConstruct
public void init(){
//大数据报警
... ... @@ -51,7 +46,7 @@ public class SnsMobileConfig {
bigdataMobile="";
}
/* //JAVAAPI错误报警
//JAVAAPI错误报警
javaApiError =getUsersInfoUtil.getMobileByAlarmGroup("JAVAAPI错误报警");
if(javaApiError==null){
javaApiError="";
... ... @@ -64,6 +59,7 @@ public class SnsMobileConfig {
javaServiceMobile="";
}
//REDIS异常报警
redisMobile=getUsersInfoUtil.getMobileByAlarmGroup("REDIS异常报警");
if(redisMobile==null){
... ... @@ -74,7 +70,7 @@ public class SnsMobileConfig {
baseMobile=getUsersInfoUtil.getMobileByAlarmGroup("基础组");
if(redisMobile==null){
baseMobile="";
}*/
}
logger.info("初始化手机号码");
logger.info("JAVAAPI错误报警 javaApiError :"+javaApiError);
... ...
... ... @@ -15,14 +15,15 @@ import com.monitor.other.dns.model.IPModel;
import com.monitor.other.dns.service.IDNSMonitorService;
import com.monitor.other.dns.service.IRestTemplateNoEncode;
import com.monitor.other.dns.util.AESUtil;
import com.util.GetUsersInfoUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NoHttpResponseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.text.SimpleDateFormat;
import java.util.*;
... ... @@ -34,6 +35,9 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService {
public static final Logger DEBUG = LoggerFactory.getLogger(DNSMonitorServiceImpl.class);
@Autowired
private GetUsersInfoUtil getUsersInfoUtil;
@Autowired
DNSConfig dnsConfig;
@Autowired
... ... @@ -48,21 +52,30 @@ public class DNSMonitorServiceImpl implements IDNSMonitorService {
@Autowired
IDNSMonitorMapper dnsMonitorMapper;
@Value("${dns_exception_mobile}")
String alarmMobile;
private String alarmMobile;
// 时间格式 每次监控后,记录这次监控记录的时间点
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
private static Logger logger = LoggerFactory.getLogger(DNSMonitorServiceImpl.class);
/**
* 监控DNS域名解析是否出现异常
* <p>
* host + uid 组合遍历
* 1.是否能解析出ip
* 2.ip是否能访问并且返回预期数据
*/
@PostConstruct
public void init() {
//大数据报警
alarmMobile = getUsersInfoUtil.getMobileByAlarmGroup("DNS异常报警");
if (alarmMobile == null) {
alarmMobile = "";
}
DEBUG.info("DNS异常报警 mobile is"+alarmMobile);
}
/**
* 监控DNS域名解析是否出现异常
* <p>
* host + uid 组合遍历
* 1.是否能解析出ip
* 2.ip是否能访问并且返回预期数据
*/
@Override
public void monitor() {
... ...
... ... @@ -8,17 +8,8 @@ qcloud_voice_url=https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid=
qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124
qcloud_sms_key=6e56f948f6f1c0a1bc359e23f7acc140
base_mobile=18751986615,18652008443,18252034289,17361900581,18751886435,17314953523
dns_exception_mobile=18751986615,18652008443,18252034289,17361900581
redis_exception_mobile=18751986615,18652008443,17361900581,18252034289
java_service_alarm_mobile=18751986615,18652008443,18252034289,17361900581,18602555621
java_service_alarm_flag=true
java_service_alarm_cost_threshold=300
java_service_alarm_count_threshold=50
java_api_error=18751986615,18652008443,18252034289,13951882433,17361900581,18602555621
SWITCH_DB_URL=http://172.31.56.59:8011/switchdb/switchMysql
\ No newline at end of file
... ...
# ******************** send sms common configs ********************
sendsms.url=http://221.179.180.158:9009/HttpQuickProcess_utf-8/submitMessageAll
#sendsms.username=yoho
#sendsms.pwd=E
qcloud_voice_url=https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid=1400021400&random=123
qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124
qcloud_sms_key=6e56f948f6f1
sendsms.username=yohoyw
sendsms.pwd=NCftHmJ9
sendsms.notice.productid=8
base_mobile=15905144483
dns_exception_mobile=15905144483
redis_exception_mobile=15905144483
qcloud_voice_url=https://yun.tim.qq.com/v3/tlsvoicesvr/sendvoiceprompt?sdkappid=1400021400&random=123
qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124
qcloud_sms_key=6e56f948f6f1
java_service_alarm_mobile=18614066537
java_service_alarm_flag=true
java_service_alarm_cost_threshold=150
java_service_alarm_count_threshold=50
java_api_error=15905144483
SWITCH_DB_URL=http://127.0.0.1:8011/switchdb/switchMysql
\ No newline at end of file
... ...