Showing
8 changed files
with
24 additions
and
8 deletions
@@ -13,10 +13,6 @@ | @@ -13,10 +13,6 @@ | ||
13 | <version>1.0-SNAPSHOT</version> | 13 | <version>1.0-SNAPSHOT</version> |
14 | 14 | ||
15 | <dependencies> | 15 | <dependencies> |
16 | - <dependency> | ||
17 | - <groupId>org.influxdb</groupId> | ||
18 | - <artifactId>influxdb-java</artifactId> | ||
19 | - </dependency> | ||
20 | 16 | ||
21 | <dependency> | 17 | <dependency> |
22 | <groupId>monitor-service</groupId> | 18 | <groupId>monitor-service</groupId> |
@@ -26,7 +22,6 @@ | @@ -26,7 +22,6 @@ | ||
26 | <dependency> | 22 | <dependency> |
27 | <groupId>commons-codec</groupId> | 23 | <groupId>commons-codec</groupId> |
28 | <artifactId>commons-codec</artifactId> | 24 | <artifactId>commons-codec</artifactId> |
29 | - <version>1.10</version> | ||
30 | </dependency> | 25 | </dependency> |
31 | 26 | ||
32 | <dependency> | 27 | <dependency> |
1 | package com.monitor.other.dns.service.impl; | 1 | package com.monitor.other.dns.service.impl; |
2 | 2 | ||
3 | +import com.monitor.other.dns.common.DNSConfig; | ||
3 | import com.monitor.other.dns.service.IDNSMonitorService; | 4 | import com.monitor.other.dns.service.IDNSMonitorService; |
5 | +import org.springframework.beans.factory.annotation.Autowired; | ||
4 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
5 | 7 | ||
6 | /** | 8 | /** |
@@ -9,15 +11,20 @@ import org.springframework.stereotype.Service; | @@ -9,15 +11,20 @@ import org.springframework.stereotype.Service; | ||
9 | @Service("dnsMonitorService") | 11 | @Service("dnsMonitorService") |
10 | public class DNSMonitorServiceImpl implements IDNSMonitorService{ | 12 | public class DNSMonitorServiceImpl implements IDNSMonitorService{ |
11 | 13 | ||
14 | + @Autowired | ||
15 | + DNSConfig dnsConfig; | ||
12 | 16 | ||
13 | /** | 17 | /** |
14 | * 监控DNS域名解析是否出现异常 | 18 | * 监控DNS域名解析是否出现异常 |
15 | */ | 19 | */ |
16 | @Override | 20 | @Override |
17 | public void monitor() { | 21 | public void monitor() { |
18 | - | ||
19 | //TODO 从配置文件中获取需要遍历的组合 host + uid | 22 | //TODO 从配置文件中获取需要遍历的组合 host + uid |
20 | 23 | ||
24 | + System.out.println(dnsConfig.getUids().length + " " + dnsConfig.getUids()[0] + " " + dnsConfig.getUids()[1]); | ||
25 | + System.out.println(dnsConfig.getHosts()); | ||
26 | + System.out.println(dnsConfig.getServices()); | ||
27 | + | ||
21 | //TODO step1 判断host + uid 是否返回一组有效的ip地址 | 28 | //TODO step1 判断host + uid 是否返回一组有效的ip地址 |
22 | //TODO step2 判断通过dns解析后的ip地址调取服务 是否返回正常相应 200码 | 29 | //TODO step2 判断通过dns解析后的ip地址调取服务 是否返回正常相应 200码 |
23 | } | 30 | } |
@@ -5,6 +5,6 @@ | @@ -5,6 +5,6 @@ | ||
5 | http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> | 5 | http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> |
6 | 6 | ||
7 | <bean id="dnsConfig" class="com.monitor.other.dns.common.DNSConfig"> | 7 | <bean id="dnsConfig" class="com.monitor.other.dns.common.DNSConfig"> |
8 | - <constructor-arg name="url" value="${dns.config.url}"/> | 8 | + <constructor-arg name = "url" value="${dns.config.url}"/> |
9 | </bean> | 9 | </bean> |
10 | </beans> | 10 | </beans> |
@@ -47,6 +47,10 @@ | @@ -47,6 +47,10 @@ | ||
47 | <artifactId>monitor-service-user</artifactId> | 47 | <artifactId>monitor-service-user</artifactId> |
48 | </dependency> | 48 | </dependency> |
49 | <dependency> | 49 | <dependency> |
50 | + <groupId>monitor-service</groupId> | ||
51 | + <artifactId>monitor-service-other</artifactId> | ||
52 | + </dependency> | ||
53 | + <dependency> | ||
50 | <groupId>junit</groupId> | 54 | <groupId>junit</groupId> |
51 | <artifactId>junit</artifactId> | 55 | <artifactId>junit</artifactId> |
52 | <version>4.11</version> | 56 | <version>4.11</version> |
1 | +# ******************** dns monitor common configs ******************** | ||
2 | +dns.config.url=api.yoho.cn/?method=app.resources.config.clientInitConfig&client_secret=bf8f49754dc7058349146f922640000c&client_type=android;service.yoho.cn/?method=app.resources.config.clientInitConfig&client_secret=bf8f49754dc7058349146f922640000c&client_type=android;m.yohobuy.com/boys | ||
3 | +#dns.config.hosts=api.yoho.cn;service.yoho.cn;m.yohobuy.com | ||
4 | +#dns.config.services=/?method=app.resources.config.clientInitConfig&client_secret=bf8f49754dc7058349146f922640000c&client_type=android;/operations/api/v5/resource/get?app_version=3.9.0.1512170008&client_secret=00be285c73a816177652240fea5a4a54&client_type=iphone&content_code=a7989369aa86681c678bc40f171b8f1d&os_version=9.2&screen_size=375x667&v=7;/boys |
@@ -17,4 +17,4 @@ cron_task_rabbit_monit=0 0 0 * * ? | @@ -17,4 +17,4 @@ cron_task_rabbit_monit=0 0 0 * * ? | ||
17 | cron_task_rabbit_scan=0 0 0 * * ? | 17 | cron_task_rabbit_scan=0 0 0 * * ? |
18 | 18 | ||
19 | #cron_task_dns_monit=0 0/2 * * * ? | 19 | #cron_task_dns_monit=0 0/2 * * * ? |
20 | -cron_task_dns_monit=0 0 0 * * ? | ||
20 | +#cron_task_dns_monit=0 0 0 * * ? |
@@ -106,6 +106,11 @@ | @@ -106,6 +106,11 @@ | ||
106 | </dependency> | 106 | </dependency> |
107 | <dependency> | 107 | <dependency> |
108 | <groupId>monitor-service</groupId> | 108 | <groupId>monitor-service</groupId> |
109 | + <artifactId>monitor-service-other</artifactId> | ||
110 | + <version>${project-version}</version> | ||
111 | + </dependency> | ||
112 | + <dependency> | ||
113 | + <groupId>monitor-service</groupId> | ||
109 | <artifactId>monitor-service-middleware</artifactId> | 114 | <artifactId>monitor-service-middleware</artifactId> |
110 | <version>${project-version}</version> | 115 | <version>${project-version}</version> |
111 | </dependency> | 116 | </dependency> |
@@ -129,6 +134,7 @@ | @@ -129,6 +134,7 @@ | ||
129 | <artifactId>jackson-mapper-asl</artifactId> | 134 | <artifactId>jackson-mapper-asl</artifactId> |
130 | <version>${jackson-version}</version> | 135 | <version>${jackson-version}</version> |
131 | </dependency> | 136 | </dependency> |
137 | + | ||
132 | </dependencies> | 138 | </dependencies> |
133 | </dependencyManagement> | 139 | </dependencyManagement> |
134 | 140 |
-
Please register or login to post a comment