Authored by jack

增加redis短信联系人

... ... @@ -12,6 +12,9 @@ public class SnsMobileConfig {
@Value("${base_mobile}")
private String baseMobile;
@Value("${redis_exception_mobile}")
private String redisMobile;
public String getBaseMobile() {
return baseMobile;
}
... ... @@ -19,4 +22,13 @@ public class SnsMobileConfig {
public void setBaseMobile(String baseMobile) {
this.baseMobile = baseMobile;
}
public String getRedisMobile() {
return redisMobile;
}
public void setRedisMobile(String redisMobile) {
this.redisMobile = redisMobile;
}
}
... ...
... ... @@ -59,7 +59,7 @@ public class RedisTask extends Task {
try {
if (null == client || !client.isConnected()) {
this.getAlarmMsgService().sendSms("Redis", "Failed to connect to redis " + this.getUrl() + " .", this.getSnsMobileConfig().getBaseMobile());
this.getAlarmMsgService().sendSms("Redis", "Failed to connect to redis " + this.getUrl() + " .", this.getSnsMobileConfig().getRedisMobile());
return;
}
... ... @@ -94,7 +94,7 @@ public class RedisTask extends Task {
//check redis
if (!testRedis(redisInfo)) {
this.getAlarmMsgService().sendSms("Redis", "Failed to write-read redis " + this.getUrl() + " .", this.getSnsMobileConfig().getBaseMobile());
this.getAlarmMsgService().sendSms("Redis", "Failed to write-read redis " + this.getUrl() + " .", this.getSnsMobileConfig().getRedisMobile());
redisInfo.setStatus("NO-OK");
}
... ... @@ -104,7 +104,7 @@ public class RedisTask extends Task {
e.printStackTrace();
this.getAlarmMsgService().sendSms("Redis", "Failed to write-read redis:" + this.getUrl() + "," + "role:" + redisInfo.getRole() + ".", this.getSnsMobileConfig().getBaseMobile());
this.getAlarmMsgService().sendSms("Redis", "Failed to write-read redis:" + this.getUrl() + "," + "role:" + redisInfo.getRole() + ".", this.getSnsMobileConfig().getRedisMobile());
redisInfo.setStatus("NO-OK");
}
... ...
... ... @@ -64,7 +64,7 @@ public class TwemproxyTask extends Task {
} catch (Exception e) {
this.getAlarmMsgService().sendSms("Twemproxy", "Failed to query Twemproxy " + this.getUrl() + " monitor info.", this.getSnsMobileConfig().getBaseMobile());
this.getAlarmMsgService().sendSms("Twemproxy", "Failed to query Twemproxy " + this.getUrl() + " monitor info.", this.getSnsMobileConfig().getRedisMobile());
DEBUG.error("Failed to query twemproxy {} monitor info...error {} ", this.getUrl(), e);
... ... @@ -112,7 +112,7 @@ public class TwemproxyTask extends Task {
if (!testTwemproxy(twemproxyInfo)) {
this.getAlarmMsgService().sendSms("Twemproxy", "Failed to write - read from twemproxy " + this.getUrl() + " .", this.getSnsMobileConfig().getBaseMobile());
this.getAlarmMsgService().sendSms("Twemproxy", "Failed to write - read from twemproxy " + this.getUrl() + " .", this.getSnsMobileConfig().getRedisMobile());
twemproxyInfo.setState("NO-OK");
}
... ...
... ... @@ -9,5 +9,7 @@ swaith_mobile=15905144483,18751986615
dns_exception_mobile=13915992579,18751986615,15905144483
redis_exception_mobile=13515100825,15905144483,18751986615,18502542319
... ...