Browse Source

the alert module is modified in english (#1195)

* add ConnectionFactoryTest and ConnectionFactory read datasource from appliction.yml

* .escheduler_env.sh to dolphinscheduler_env.sh

* dao yml assembly to conf directory

* table name modify

* entity title table  name modify

* logback log name modify

* running through the big process

* running through the big process error modify

* logback log name modify

* data_source.properties rename

* logback log name modify

* install.sh optimization

* install.sh optimization

* command count modify

* command state update

* countCommandState sql update

* countCommandState sql update

* remove application.yml file

* master.properties modify

* install.sh modify

* install.sh modify

* api server startup modify

* the current user quits and the session is completely emptied. bug fix

* remove pom package resources

* checkQueueNameExist method update

* checkQueueExist

* install.sh error output update

* signOut error update

* ProcessDao is null bug fix

* install.sh add mail.user

* request url variables replace

* process define import bug fix

* process define import export bug fix

* processdefine import export bug fix

* down log suffix format modify

* import export process define contains crontab error bug fix

* add Flink local mode

* ProcessDao is null bug fix

* loadAverage display problem bug fix

* MasterServer rename Server

* rollback .env

* rollback .env

* MasterServer rename Server

* the task is abnormal and task is running bug fix

* owners and administrators can delete

* dockerfile optimization

* dockerfile optimization

* dockerfile optimization

* remove application-alert.properties

* task log print worker log bug fix

* remove .escheduler_env.sh

* change dockerfile email address

* dockerfile dao application.properties and install.sh modify

* application.properties modify

* application.properties modify

* dockerfile startup.sh modify

* remove docs

* nginx conf modify

* dockerfile application.properties modify

* dockerfile email address change

* the alert module is modified in English.

* alert server comment and chinese modify
pull/2/head
qiaozhanwei 5 years ago committed by bao liang
parent
commit
03ec04b700
  1. 16
      dolphinscheduler-alert/pom.xml
  2. 2
      dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java
  3. 6
      dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java
  4. 20
      dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java
  5. 31
      dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java

16
dolphinscheduler-alert/pom.xml

@ -100,22 +100,6 @@
</dependencies>
<build>
<!--<resources>-->
<!--<resource>-->
<!--<directory>src/main/java</directory>-->
<!--<includes>-->
<!--<include>**/*.xml</include>-->
<!--</includes>-->
<!--<filtering>false</filtering>-->
<!--</resource>-->
<!--<resource>-->
<!--<directory>src/main/resources</directory>-->
<!--<includes>-->
<!--<include>**/*.*</include>-->
<!--</includes>-->
<!--<filtering>false</filtering>-->
<!--</resource>-->
<!--</resources>-->
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>

2
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java

@ -57,7 +57,7 @@ public class AlertServer {
}
public void start(){
logger.info("Alert Server ready start!");
logger.info("alert server ready start ");
while (Stopper.isRunning()){
try {
Thread.sleep(Constants.ALERT_SCAN_INTERVEL);

6
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java

@ -66,12 +66,6 @@ public class PropertyUtils {
}
}
/*
public static PropertyUtils getInstance(){
return propertyUtils;
}
*/
/**
* get property value
*

20
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java

@ -78,19 +78,19 @@ public class EnterpriseWeChatUtilsTest {
public void testSendSingleUserWeChat() {
try {
String token = EnterpriseWeChatUtils.getToken();
String msg = EnterpriseWeChatUtils.makeUserSendMsg(listUserId.stream().findFirst().get(), agentId, "您的会议室已经预定,稍后会同步到`邮箱` \n" +
">**事项详情** \n" +
"> 项:<font color='info'>开会</font> <br>" +
">组织者:@miglioguan \n" +
">参与者:@miglioguan、@kunliu、@jamdeezhou、@kanexiong、@kisonwang \n" +
String msg = EnterpriseWeChatUtils.makeUserSendMsg(listUserId.stream().findFirst().get(), agentId, "your meeting room has been booked and will be synced to the 'mailbox' later \n" +
">**matter details** \n" +
">matter:<font color='info'>meeting</font> <br>" +
">organizer:@miglioguan \n" +
">participant:@miglioguan、@kunliu、@jamdeezhou、@kanexiong、@kisonwang \n" +
"> \n" +
">会议室:<font color='info'>广州TIT 1楼 301</font> \n" +
"> 期:<font color='warning'>2018年5月18日</font> \n" +
"> 间:<font color='comment'>上午9:00-11:00</font> \n" +
">meeting room:<font color='info'>Guangzhou TIT 1st Floor 301</font> \n" +
">date:<font color='warning'>May 18, 2018</font> \n" +
">time:<font color='comment'>9:00-11:00 am</font> \n" +
"> \n" +
">请准时参加会议。 \n" +
">please attend the meeting on time\n" +
"> \n" +
">如需修改会议信息,请点击:[修改会议信息](https://work.weixin.qq.com)\"");
">to modify the meeting information, please click: [Modify Meeting Information](https://work.weixin.qq.com)\"");
String resp = EnterpriseWeChatUtils.sendEnterpriseWeChat("utf-8", msg, token);

31
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java

@ -48,12 +48,12 @@ public class MailUtilsTest {
private static final Logger logger = LoggerFactory.getLogger(MailUtilsTest.class);
@Test
public void testSendMails() {
String[] receivers = new String[]{"825193156@qq.com"};
String[] receiversCc = new String[]{"825193156@qq.com"};
String[] receivers = new String[]{"xxx@qq.com"};
String[] receiversCc = new String[]{"xxx@qq.com"};
String content ="[\"id:69\"," +
"\"name:UserBehavior-0--1193959466\"," +
"\"Job name: 启动工作流\"," +
"\"Job name: Start workflow\"," +
"\"State: SUCCESS\"," +
"\"Recovery:NO\"," +
"\"Run time: 1\"," +
@ -63,7 +63,7 @@ public class MailUtilsTest {
"\"Notify group :4\"]";
Alert alert = new Alert();
alert.setTitle("Mysql异常");
alert.setTitle("Mysql Exception");
alert.setShowType(ShowType.TEXT);
alert.setContent(content);
alert.setAlertType(AlertType.EMAIL);
@ -89,18 +89,18 @@ public class MailUtilsTest {
public String list2String(){
LinkedHashMap<String, Object> map1 = new LinkedHashMap<>();
map1.put("mysql服务名称","mysql200");
map1.put("mysql地址","192.168.xx.xx");
map1.put("端口","3306");
map1.put("期间内没有使用索引的查询数握","80");
map1.put("数据库客户端连接数","190");
map1.put("mysql service name","mysql200");
map1.put("mysql address","192.168.xx.xx");
map1.put("port","3306");
map1.put("no index of number","80");
map1.put("database client connections","190");
LinkedHashMap<String, Object> map2 = new LinkedHashMap<>();
map2.put("mysql服务名称","mysql210");
map2.put("mysql地址","192.168.xx.xx");
map2.put("端口","3306");
map2.put("期间内没有使用索引的查询数握","10");
map2.put("数据库客户端连接数","90");
map2.put("mysql service name","mysql210");
map2.put("mysql address","192.168.xx.xx");
map2.put("port","3306");
map2.put("no index of number","10");
map2.put("database client connections","90");
List<LinkedHashMap<String, Object>> maps = new ArrayList<>();
maps.add(0,map1);
@ -135,7 +135,8 @@ public class MailUtilsTest {
Alert alert = new Alert();
alert.setTitle("Mysql Exception");
alert.setShowType(ShowType.TEXT);
alert.setContent("[\"告警时间:2018-02-05\", \"服务名:MYSQL_ALTER\", \"告警名:MYSQL_ALTER_DUMP\", \"获取告警异常!,接口报错,异常信息:timed out\", \"请求地址:http://blog.csdn.net/dreamInTheWorld/article/details/78539286\"]");
alert.setContent("[\"alarm time:2018-02-05\", \"service name:MYSQL_ALTER\", \"alarm name:MYSQL_ALTER_DUMP\", " +
"\"get the alarm exception.!,interface error,exception information:timed out\", \"request address:http://blog.csdn.net/dreamInTheWorld/article/details/78539286\"]");
alert.setAlertType(AlertType.EMAIL);
alert.setAlertGroupId(1);
alertDao.addAlert(alert);

Loading…
Cancel
Save