Authored by qinchao

Merge branch 'dev_gml'

... ... @@ -6,6 +6,7 @@ import com.monitor.common.service.HttpRestClientService;
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 java.util.HashMap;
... ... @@ -16,8 +17,10 @@ import java.util.Map;
*/
@Service
public class DingDingServiceImpl implements DingDingService {
@Value("${ddRobotUrl}")
private String ddRobotUrl;
final String ddRobotUrl="https://oapi.dingtalk.com/robot/send?access_token=31cf1a526c98862b7945e561c5a0d857a069350dbee0e807074b83b39fa1e1af";
// final String ddRobotUrl="https://oapi.dingtalk.com/robot/send?access_token=31cf1a526c98862b7945e561c5a0d857a069350dbee0e807074b83b39fa1e1af";
@Autowired
private HttpRestClientService httpRestClientService;
... ...
package com.monitor.other.sms.service.impl;
import com.model.SMSLogs;
import com.monitor.common.service.AlarmMsgService;
import com.monitor.common.util.ApplicationUtil;
import com.monitor.common.util.ZkClientUtil;
import com.monitor.model.domain.PageBean;
import com.monitor.model.page.PageRequest;
... ... @@ -8,6 +10,7 @@ import com.monitor.model.response.BaseResponse;
import com.monitor.model.response.PageResponse;
import com.monitor.mysql.mapper.SMSLogsMapper;
import com.monitor.other.sms.service.SmsLogService;
import com.util.GetUsersInfoUtil;
import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -30,6 +33,9 @@ public class SmsLogServiceImpl implements SmsLogService {
@Autowired
private ZkClientUtil zkClient;
@Autowired
private AlarmMsgService alarmMsgService;
private String ZK_PATH = "/yh/config/";
private String smsSendSwitch="ops.sendsms.open";
private String smsSendVoiceSwitch="ops.sendvoicesms.open";
... ... @@ -69,6 +75,21 @@ public class SmsLogServiceImpl implements SmsLogService {
String value="true";
if("off".equals(key)){
value="false";
GetUsersInfoUtil getUsersInfoUtil = (GetUsersInfoUtil) ApplicationUtil.getBean(GetUsersInfoUtil.class);
String mobiles = getUsersInfoUtil.getMobileByAlarmGroup("告警开关切换组");
String content = "";
switch (pathCode){
case "ops.sendsms.open":
content = "运维ops短信告警开关is off";
break;
case "ops.sendvoicesms.open":
content = "运维ops语音告警开关is off";
break;
case "devops.sendsms.open":
content = "监控dev短信告警开关is off";
break;
}
alarmMsgService.sendSms("msgSwitch", content, "", mobiles);
}
Stat stat=zkClient.getCuratorFramework().checkExists().forPath(ZK_PATH + pathCode);
// Stat 就是对zonde所有属性的一个映射, stat=null表示节点不存在!
... ...
... ... @@ -50,4 +50,6 @@ check_bigdata=true
auto.task.test.url=http://qmc.yohops.com:9999/autoTask/executeFromGongDan
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=true
\ No newline at end of file
auto.fetchScaling.open=true
#钉钉访问地址
ddRobotUrl=https://oapi.dingtalk.com/robot/send?access_token=31cf1a526c98862b7945e561c5a0d857a069350dbee0e807074b83b39fa1e1af
\ No newline at end of file
... ...
... ... @@ -46,4 +46,6 @@ spark.read.data.url=http://172.31.50.139:8082/malicious/
check_bigdata=true
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=true
\ No newline at end of file
auto.fetchScaling.open=true
#钉钉访问地址
ddRobotUrl=https://oapi.dingtalk.com/robot/send?access_token=31cf1a526c98862b7945e561c5a0d857a069350dbee0e807074b83b39fa1e1af
\ No newline at end of file
... ...
... ... @@ -49,4 +49,6 @@ check_bigdata=false
auto.task.test.url=http://192.168.103.71:8075/autoTask/executeFromGongDan
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=false
\ No newline at end of file
auto.fetchScaling.open=false
#钉钉访问地址
ddRobotUrl=test
\ No newline at end of file
... ...