Authored by simba

Merge branch 'master' of http://git.yoho.cn/ops/monitor-service

@@ -9,200 +9,14 @@ import org.springframework.stereotype.Component; @@ -9,200 +9,14 @@ import org.springframework.stereotype.Component;
9 @Component("snsMobileConfig") 9 @Component("snsMobileConfig")
10 public class SnsMobileConfig { 10 public class SnsMobileConfig {
11 11
12 - /********************** 支付回调手机号 **********************/ 12 + @Value("${base_mobile}")
  13 + private String baseMobile;
13 14
14 - @Value("${sendsms.alarm.paycallback}")  
15 - private String payCallBack; 15 + public String getBaseMobile() {
  16 + return baseMobile;
  17 + }
16 18
17 - /********************** 支付回调手机号 ********************/  
18 -  
19 - /********************* 订单异常手机号 ***********************/  
20 -  
21 - @Value("${sendsms.alarm.mobile.orderexception}")  
22 - private String orderException;  
23 -  
24 - /********************* 订单异常手机号 ***********************/  
25 -  
26 - /******************* 用户行为异常手机号 ***************/  
27 -  
28 - @Value("${sendsms.alarm.mobile.userbehaviour}")  
29 - private String userBehaviour;  
30 -  
31 - /******************** 用户行为异常手机号 **************/  
32 -  
33 - /******************** 数据库异常手机号 *************/  
34 - @Value("${sendsms.alarm.mobile.dbexception}")  
35 - private String dbException;  
36 -  
37 - /******************* 数据库异常手机号 **************/  
38 -  
39 - /****************** 服务异常告警手机号 ***************/  
40 - @Value("${sendsms.alarm.mobile.serviceexception.product}")  
41 - private String serviceExcptnProduct;  
42 -  
43 - @Value("${sendsms.alarm.mobile.serviceexception.search}")  
44 - private String serviceExcptnSearch;  
45 -  
46 - @Value("${sendsms.alarm.mobile.serviceexception.guang}")  
47 - private String serviceExcptnGuang;  
48 -  
49 - @Value("${sendsms.alarm.mobile.serviceexception.users}")  
50 - private String serviceExcptnUsers;  
51 -  
52 - @Value("${sendsms.alarm.mobile.serviceexception.order}")  
53 - private String serviceExcptnOrder;  
54 -  
55 - @Value("${sendsms.alarm.mobile.serviceexception.sns}")  
56 - private String serviceExcptnSns;  
57 -  
58 - @Value("${sendsms.alarm.mobile.serviceexception.promotion}")  
59 - private String serviceExcptnPromotion;  
60 -  
61 - @Value("${sendsms.alarm.mobile.serviceexception.message}")  
62 - private String serviceExcptnMessage;  
63 -  
64 - @Value("${sendsms.alarm.mobile.serviceexception.resources}")  
65 - private String serviceExcptnResources;  
66 -  
67 - /******************** 服务异常告警手机号 ******************/  
68 -  
69 - /********************Monitor模块告警手机号************************/  
70 - @Value("${sendsms.alarm.mobile.monitor.exception}")  
71 - private String monitorException;  
72 - /********************Monitor模块告警手机号************************/  
73 -  
74 - /*******************Logs模块告警手机号************************/  
75 - @Value("${sendsms.alarm.mobile.logs.sns_send_failed}")  
76 - private String logsSnsSendFailed;  
77 - /*******************Logs模块告警手机号************************/  
78 -  
79 - /*********************OpsManager开发程序员 手机号***************************/  
80 - @Value("${sendsms.alarm.mobile.ops_manager.developer}")  
81 - private String opsManagerDeveloper;  
82 - /*********************OpsManager开发程序员 手机号***************************/  
83 -  
84 -  
85 - /**  
86 - * dnspod sms  
87 - */  
88 - @Value("${dnspod.mobile}")  
89 - private String dnspodMobile;  
90 -  
91 - /**  
92 - * switch nginxConfig sms  
93 - */  
94 - @Value("${nginx.config.switch.mobile}")  
95 - private String switchNginxConfigMobile;  
96 -  
97 - /**  
98 - * jmxtrans sms  
99 - */  
100 - @Value("${jmxtrans.mobile}")  
101 - private String jmxtransMobile;  
102 -  
103 - @Value("${orderinfocheck.mobile}")  
104 - private String orderinfocheckMobile;  
105 -  
106 - @Value("${base_mobile}")  
107 - private String baseMobile;  
108 -  
109 - public String getOrderinfocheckMobile() {  
110 - return orderinfocheckMobile;  
111 - }  
112 -  
113 - public String getPayCallBack() {  
114 - return payCallBack;  
115 - }  
116 -  
117 - public String getOrderException() {  
118 - return orderException;  
119 - }  
120 -  
121 - public String getUserBehaviour() {  
122 - return userBehaviour;  
123 - }  
124 -  
125 - public String getDbException() {  
126 - return dbException;  
127 - }  
128 -  
129 - public String getServiceExcptnProduct() {  
130 - return serviceExcptnProduct;  
131 - }  
132 -  
133 - public String getServiceExcptnSearch() {  
134 - return serviceExcptnSearch;  
135 - }  
136 -  
137 - public String getServiceExcptnGuang() {  
138 - return serviceExcptnGuang;  
139 - }  
140 -  
141 - public String getServiceExcptnUsers() {  
142 - return serviceExcptnUsers;  
143 - }  
144 -  
145 - public String getServiceExcptnOrder() {  
146 - return serviceExcptnOrder;  
147 - }  
148 -  
149 - public String getServiceExcptnSns() {  
150 - return serviceExcptnSns;  
151 - }  
152 -  
153 - public String getServiceExcptnPromotion() {  
154 - return serviceExcptnPromotion;  
155 - }  
156 -  
157 - public String getServiceExcptnMessage() {  
158 - return serviceExcptnMessage;  
159 - }  
160 -  
161 - public String getServiceExcptnResources() {  
162 - return serviceExcptnResources;  
163 - }  
164 -  
165 - public String getDnspodMobile() {  
166 - return dnspodMobile;  
167 - }  
168 -  
169 - public void setDnspodMobile(String dnspodMobile) {  
170 - this.dnspodMobile = dnspodMobile;  
171 - }  
172 -  
173 - public String getJmxtransMobile() {  
174 - return jmxtransMobile;  
175 - }  
176 -  
177 - public void setJmxtransMobile(String jmxtransMobile) {  
178 - this.jmxtransMobile = jmxtransMobile;  
179 - }  
180 -  
181 - public String getSwitchNginxConfigMobile() {  
182 - return switchNginxConfigMobile;  
183 - }  
184 -  
185 - public void setSwitchNginxConfigMobile(String switchNginxConfigMobile) {  
186 - this.switchNginxConfigMobile = switchNginxConfigMobile;  
187 - }  
188 -  
189 - public String getOpsManagerDeveloper() {  
190 - return opsManagerDeveloper;  
191 - }  
192 -  
193 - public String getMonitorException() {  
194 - return monitorException;  
195 - }  
196 -  
197 - public String getLogsSnsSendFailed() {  
198 - return logsSnsSendFailed;  
199 - }  
200 -  
201 - public String getBaseMobile() {  
202 - return baseMobile;  
203 - }  
204 -  
205 - public void setBaseMobile(String baseMobile) {  
206 - this.baseMobile = baseMobile;  
207 - } 19 + public void setBaseMobile(String baseMobile) {
  20 + this.baseMobile = baseMobile;
  21 + }
208 } 22 }
@@ -94,7 +94,7 @@ public class AlarmMsgServiceImpl implements AlarmMsgService { @@ -94,7 +94,7 @@ public class AlarmMsgServiceImpl implements AlarmMsgService {
94 if (result == null || !("01" .equals(result.split(",")[0]) || "00" .equals(result.split(",")[0]) || "03" .equals(result.split(",")[0]))) { 94 if (result == null || !("01" .equals(result.split(",")[0]) || "00" .equals(result.split(",")[0]) || "03" .equals(result.split(",")[0]))) {
95 logger.error("发送短信失败,短信内容|" + JSONArray.toJSONString(smsMap)); 95 logger.error("发送短信失败,短信内容|" + JSONArray.toJSONString(smsMap));
96 smsMap.put("Content", URLEncoder.encode("【有货运维】发送短信告警失败!!!", "UTF-8")); 96 smsMap.put("Content", URLEncoder.encode("【有货运维】发送短信告警失败!!!", "UTF-8"));
97 - smsMap.put("DesMobile", snsMobileConfig.getOpsManagerDeveloper()); 97 + smsMap.put("DesMobile", snsMobileConfig.getBaseMobile());
98 // 短信发送失败 发送短信给开发回来改bug 98 // 短信发送失败 发送短信给开发回来改bug
99 httpRestClientService.get(sendsmsConfig.getSendsmsUrl(), smsMap, String.class); 99 httpRestClientService.get(sendsmsConfig.getSendsmsUrl(), smsMap, String.class);
100 return false; 100 return false;
@@ -18,7 +18,7 @@ public class AlarmMsgComp { @@ -18,7 +18,7 @@ public class AlarmMsgComp {
18 SnsMobileConfig snsMobileConfig; 18 SnsMobileConfig snsMobileConfig;
19 19
20 public void doAlarm(String subject, String content) { 20 public void doAlarm(String subject, String content) {
21 - alarmMsgService.sendSms(subject, content, snsMobileConfig.getOpsManagerDeveloper()); 21 + alarmMsgService.sendSms(subject, content, snsMobileConfig.getBaseMobile());
22 } 22 }
23 23
24 } 24 }
@@ -80,7 +80,7 @@ public class ZkMonitorHandleServiceImpl implements IZkMonitorHandleService { @@ -80,7 +80,7 @@ public class ZkMonitorHandleServiceImpl implements IZkMonitorHandleService {
80 return; 80 return;
81 } 81 }
82 String alarmMsg="zookeeper"+alarmList.size()+"台连接失败,请及时查看!"; 82 String alarmMsg="zookeeper"+alarmList.size()+"台连接失败,请及时查看!";
83 - alarmMsgService.sendSms("zookeeper",alarmMsg, snsMobileConfig.getOpsManagerDeveloper()); 83 + alarmMsgService.sendSms("zookeeper",alarmMsg, snsMobileConfig.getBaseMobile());
84 log.info("task end..."); 84 log.info("task end...");
85 } 85 }
86 86
@@ -4,59 +4,7 @@ sendsms.username=yohoyw @@ -4,59 +4,7 @@ sendsms.username=yohoyw
4 sendsms.pwd=NCftHmJ9 4 sendsms.pwd=NCftHmJ9
5 sendsms.notice.productid=8 5 sendsms.notice.productid=8
6 6
7 -base_mobile=15905144483,18751986615,18652008443 7 +base_mobile=15905144483,18751986615,18502542319
8 8
9 -#------------------------------------------支付回调手机号------------------------------------------------  
10 -sendsms.alarm.paycallback=15905144483,18751986615,18652008443  
11 -#------------------------------------------支付回调手机号------------------------------------------------  
12 -  
13 -#------------------------------------------订单异常手机号------------------------------------------------  
14 -sendsms.alarm.mobile.orderexception=15905144483,13585196262,18652008443  
15 -#------------------------------------------订单异常手机号------------------------------------------------  
16 -  
17 -#------------------------------------------用户行为异常手机号------------------------------------------------  
18 -sendsms.alarm.mobile.userbehaviour=15905144483,18001582955  
19 -#------------------------------------------用户行为异常手机号------------------------------------------------  
20 -  
21 -#------------------------------------------数据库异常手机号------------------------------------------------  
22 -sendsms.alarm.mobile.dbexception=15905144483,18652008443,18751986615,13811102093  
23 -#------------------------------------------数据库异常手机号------------------------------------------------  
24 -  
25 -#-------------------------------------------服务异常告警手机号----------------------------------------------------  
26 -  
27 -sendsms.alarm.mobile.serviceexception.product=15905144483,18652925653,13451938602,18751986615,18652008443  
28 -sendsms.alarm.mobile.serviceexception.search=15905144483,18551640215,18652925653,18751986615,18652008443  
29 -sendsms.alarm.mobile.serviceexception.guang=15905144483,18001582955,18652925653,18751986615,18652008443,18551607734,15651035157,13951882433  
30 -sendsms.alarm.mobile.serviceexception.users=15905144483,18001582955,18652925653,18751986615,18652008443,13951882433,15651035157,18551607734  
31 -sendsms.alarm.mobile.serviceexception.order=15905144483,15950561359,13951634768,18652925653,18751986615,18652008443  
32 -sendsms.alarm.mobile.serviceexception.sns=15905144483,13451938602,18652925653,18751986615,18652008443  
33 -sendsms.alarm.mobile.serviceexception.promotion=15905144483,18652925653,13451938602,18751986615,18652008443  
34 -sendsms.alarm.mobile.serviceexception.message=15905144483,18001582955,18652925653,18751986615,18652008443  
35 -sendsms.alarm.mobile.serviceexception.resources=15905144483,15950561359,18652925653,18751986615,18652008443  
36 -  
37 -#-------------服务异常告警手机号-------------------  
38 -  
39 -#---------------------Monitor异常数据告警手机号------------------  
40 -sendsms.alarm.mobile.monitor.exception=15905144483,18751986615  
41 -#---------------------Monitor异常数据告警手机号------------------  
42 -  
43 -#-----------------------------Logs告警模块---------------------------  
44 -#短信发送失败量超过阀值 告警手机号  
45 -sendsms.alarm.mobile.logs.sns_send_failed=15905144483,18751986615,18652008443,18001582955  
46 -#-----------------------------Logs告警模块--------------------------  
47 -  
48 -#-----------------------------监控系统开发人员--------------------------  
49 -sendsms.alarm.mobile.ops_manager.developer=15905144483  
50 -#-----------------------------监控系统开发人员--------------------------  
51 -  
52 -dnspod.mobile=15905144483,18652008443,18751986615  
53 -  
54 -jmxtrans.mobile=15905144483,18751986615  
55 -  
56 -nginx.config.switch.mobile=15905144483,18652008443,18751986615  
57 -#订单校验失败  
58 -orderinfocheck.mobile=15905144483,18652008443,15950561359,13902496867,18511020499  
59 -  
60 -nginx.error.mobile=15905144483,18502542319,18751986615  
61 9
62 10
@@ -4,65 +4,7 @@ sendsms.username=yoho @@ -4,65 +4,7 @@ sendsms.username=yoho
4 sendsms.pwd=E 4 sendsms.pwd=E
5 sendsms.notice.productid=8 5 sendsms.notice.productid=8
6 6
7 -#---------------国都短信业务api参数----------------------  
8 -sendsms.guodu.Url=http://221.179.180.158:9007/QxtSms/QxtFirewall  
9 -sendsms.guodu.OperID=yoho  
10 -sendsms.guodu.OperPass=EMKVpwoJ  
11 -#---------------国都短信业务api参数---------------------- 7 +base_mobile=15905144483
12 8
13 -base_mobile=15905144483,18751986615,18652008443  
14 -  
15 -#------------------------------------------支付回调手机号------------------------------------------------  
16 -sendsms.alarm.paycallback=15905144483,18751986615,18652008443  
17 -#------------------------------------------支付回调手机号------------------------------------------------  
18 -  
19 -#------------------------------------------订单异常手机号------------------------------------------------  
20 -sendsms.alarm.mobile.orderexception=15905144483,13585196262,18652008443  
21 -#------------------------------------------订单异常手机号------------------------------------------------  
22 -  
23 -#------------------------------------------用户行为异常手机号------------------------------------------------  
24 -sendsms.alarm.mobile.userbehaviour=15905144483,18001582955  
25 -#------------------------------------------用户行为异常手机号------------------------------------------------  
26 -  
27 -#------------------------------------------数据库异常手机号------------------------------------------------  
28 -sendsms.alarm.mobile.dbexception=15905144483,18652008443,18751986615,13811102093  
29 -#------------------------------------------数据库异常手机号------------------------------------------------  
30 -  
31 -#-------------------------------------------服务异常告警手机号----------------------------------------------------  
32 -  
33 -sendsms.alarm.mobile.serviceexception.product=15905144483,18652925653,13451938602,18751986615,18652008443  
34 -sendsms.alarm.mobile.serviceexception.search=15905144483,18551640215,18652925653,18751986615,18652008443  
35 -sendsms.alarm.mobile.serviceexception.guang=15905144483,18001582955,18652925653,18751986615,18652008443,18551607734,15651035157,13951882433  
36 -sendsms.alarm.mobile.serviceexception.users=15905144483,18001582955,18652925653,18751986615,18652008443,13951882433,15651035157,18551607734  
37 -sendsms.alarm.mobile.serviceexception.order=15905144483,15950561359,13951634768,18652925653,18751986615,18652008443  
38 -sendsms.alarm.mobile.serviceexception.sns=15905144483,13451938602,18652925653,18751986615,18652008443  
39 -sendsms.alarm.mobile.serviceexception.promotion=15905144483,18652925653,13451938602,18751986615,18652008443  
40 -sendsms.alarm.mobile.serviceexception.message=15905144483,18001582955,18652925653,18751986615,18652008443  
41 -sendsms.alarm.mobile.serviceexception.resources=15905144483,15950561359,18652925653,18751986615,18652008443  
42 -  
43 -#-------------服务异常告警手机号-------------------  
44 -  
45 -#---------------------Monitor异常数据告警手机号------------------  
46 -sendsms.alarm.mobile.monitor.exception=15905144483,18751986615  
47 -#---------------------Monitor异常数据告警手机号------------------  
48 -  
49 -#-----------------------------Logs告警模块---------------------------  
50 -#短信发送失败量超过阀值 告警手机号  
51 -sendsms.alarm.mobile.logs.sns_send_failed=15905144483,18751986615,18652008443,18001582955  
52 -#-----------------------------Logs告警模块--------------------------  
53 -  
54 -#-----------------------------监控系统开发人员--------------------------  
55 -sendsms.alarm.mobile.ops_manager.developer=15905144483  
56 -#-----------------------------监控系统开发人员--------------------------  
57 -  
58 -dnspod.mobile=15905144483,18652008443,18751986615  
59 -  
60 -jmxtrans.mobile=15905144483,18751986615  
61 -  
62 -nginx.config.switch.mobile=15905144483,18652008443,18751986615  
63 -#订单校验失败  
64 -orderinfocheck.mobile=15905144483,18652008443,15950561359,13902496867,18511020499  
65 -  
66 -nginx.error.mobile=15905144483,18502542319,18751986615  
67 9
68 10
@@ -27,7 +27,7 @@ public class MessageTest { @@ -27,7 +27,7 @@ public class MessageTest {
27 @Test 27 @Test
28 public void testSendMsg(){ 28 public void testSendMsg(){
29 29
30 - alarmMsgService.sendSms("java_api","test", snsMobileConfig.getOpsManagerDeveloper()); 30 + alarmMsgService.sendSms("java_api","test", snsMobileConfig.getBaseMobile());
31 31
32 } 32 }
33 } 33 }