Authored by Xu

大手术,配置文件不全,从ops里面都拷贝过来了

上报错误总数超过1W,才发短信
... ... @@ -9,22 +9,24 @@ public class ReportCount {
private static final AtomicInteger atomicInteger = new AtomicInteger(1);
// private static int last = 0;
public static int getAndIncrement() {
return atomicInteger.getAndIncrement();
}
public static int getIncrement() {
return atomicInteger.get();
}
// int count = atomicInteger.get();
// if (count == 0) {
// return 0;
// }
// int increate = count - last;
// last = count;
// return increate;
/**
* 错误总次数
*/
private static final AtomicInteger errorSum = new AtomicInteger(1);
public static int getErrorSum() {
return errorSum.getAndIncrement();
}
public static void setErrorSum(int i) {
errorSum.set(i);
}
}
\ No newline at end of file
... ...
... ... @@ -58,8 +58,9 @@ public class ClientReportErrorServiceImpl implements ClientReportErrorService {
int count = ReportCount.getIncrement();
int increate = count - alarmlast;
alarmlast = count;
if (lastNum != 0 && increate != 0 && increate > flag && increate > 2 * lastNum) {
if (lastNum != 0 && increate != 0 && increate > flag && increate > 2 * lastNum && ReportCount.getErrorSum() > 10000) {
alarm(InfluxDBName.AWS, increate, minute);
ReportCount.setErrorSum(0);
}
lastNum = increate;
... ... @@ -69,8 +70,9 @@ public class ClientReportErrorServiceImpl implements ClientReportErrorService {
if (yestodayCount == 0) {
return;
}
if (increate > yestodayCount * 3) {
if ((increate > yestodayCount * 3) && (ReportCount.getErrorSum() > 10000)) {
alarm(increate, minute, yestodayCount);
ReportCount.setErrorSum(0);
}
}
... ...
... ... @@ -3,6 +3,16 @@ system.envi=product
bigdata.uid.location.url=http://172.31.6.98:8080/ds/member/getUidLocation/
dnswrite.task.num=5
aws.redis.proxy.address=172.31.31.170
aws.redis.proxy.port=6379
aws.redis.proxy.auth=
qq.redis.proxy.address=10.66.4.25
qq.redis.proxy.port=6379
qq.redis.proxy.auth=
client.redis.proxy.address=10.66.4.81
client.redis.proxy.port=6379
client.redis.proxy.auth=
kafka.servers=172.31.80.214:9092
\ No newline at end of file
... ...
default.times=20
diff.service=user.login
\ No newline at end of file
... ...
... ... @@ -58,6 +58,24 @@
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="ORDER_INFO_CHECK" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.home}/logs/orderinfocheck/order_info_check.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${catalina.home}/logs/orderinfocheck/order_info_check.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<MaxHistory>30</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - %msg%n</pattern>
</encoder>
</appender>
<!-- root级别 DEBUG -->
<root level="INFO">
<!-- 文件输出 -->
... ... @@ -65,4 +83,9 @@
<appender-ref ref="WARN" />
</root>
<logger name="ordercheckLogger" additivity="false">
<level value="INFO"/>
<appender-ref ref="ORDER_INFO_CHECK"/>
</logger>
</configuration>
\ No newline at end of file
... ...
# ******************** monitor common configs ********************
#--------------------------------定时支付回调监控------------------------------------
#支付回调监控 每天9:00到24:00 每5分钟
cron.task.paycallback.alipay=0 0/5 10-20 * * ?
alram.paycallback.alipay.time_period=5
#支付回调监控 每天9:00到24:00 每30分钟
cron.task.paycallback.wechat=0 0/30 9-23 * * ?
alram.paycallback.wechat.time_period=30
#支付回调监控 每天9:00到24:00 整点
cron.task.paycallback.unionpay=0 0 9-23 * * ?
alram.paycallback.union.time_period=60
#--------------------------------定时支付回调监控------------------------------------
#-------------------------------------定时读写任务------------------------------
#执行一次对于event写入任务的时间间隔
cron.task.influxdb.dbaccess.event.write=0 0/10 * * * ?
#进行一次对于statement写入任务 时间间隔
influxdb.dbaccess.event.write.time_period=10
#每15分钟执行一次对于statement写入任务
cron.task.influxdb.dbaccess.statement.write=0 0/15 * * * ?
#进行一次对于statement写入任务 时间间隔
influxdb.dbaccess.statement.write.time_period=15
#每15分钟执行一次对于src写入任务
cron.task.influxdb.dbaccess.src_service_name.write=0 0/15 * * * ?
#进行一次对于statement写入任务 时间间隔
influxdb.dbaccess.src_service_name.write.time_period=15
#每10分钟执行一次对server_access表group by event的写入任务
cron.task.influxdb.service_access.event.write=0 6/10 * * * ?
influxdb.service_access.event.write.time_period=10
#每15分钟执行一次对server_access表group by event的写入任务
cron.task.influxdb.gateway_access.event.write=0 3/15 * * * ?
influxdb.gateway_access.event.write.time_period=15
#--------------------------------定时读写任务------------------------------------
#--------------------------------用户行为监控------------------------------------
#用户注册异常信息监控时间cron表达式
alarm.cron.user.register.exception=0 0/15 * * * ?
#用户登录异常信息监控时间cron表达式
alarm.cron.user.login.exception=0 0/15 * * * ?
#用户无注册信息监控时间cron表达式
alarm.cron.user.register=0 0/15 9-22 * * ?
alarm.cron.user.register.qcloud=0 0 9-22 * * ?
#用户无注册时间查询间隔
alarm.user.register.time_period=15
alarm.user.register.time_period.qcloud=60
#注册异常数量告警阀值 查询间隔
alram.user.register.exception.threshold_count=5
alram.user.register.exception.time_period=15
#登录异常数量告警阀值 查询间隔
alram.user.login.exception.threshold_count=5
alram.user.login.exception.time_period=15
#--------------------------------用户行为监控------------------------------------
#---------------------------------数据库监控-----------------------------------
#数据库异常监控 定时任务cron表达式 时间间隔 告警阀值
alarm.cron.database.exception=0 0/3 * * * ?
alarm.database.exception.time_period=3
alarm.database.exception.threshold_count=50
#--------------------------------数据库监控------------------------------------
#--------------------------------服务监控------------------------------------
#服务异常监控 定时任务cron表达式 时间间隔
alarm.cron.service.exception=0 0/2 * * * ?
alarm.database.service.exception.time_period=2
#--------------------------------服务监控------------------------------------
#--------------------------------订单模块监控------------------------------------
#订单提交失败定时任务cron表达式 时间间隔
cron.task.order.submitfailed=0 0/5 * * * ?
alram.order.submitfailed.time_period=5
#订单支付失败定时任务cron表达式 时间间隔
cron.task.order.payfailed=0 0/5 * * * ?
alram.order.payfailed.time_period=5
#--------------------------------订单模块监控-----------------------------------
#----------------------------Monitor告警模块--------------------------------
cron.task.monitor.exception=0 0/2 * * * ?
alarm.monitor.exception.time_period=2
#----------------------------Monitor告警模块--------------------------------
#----------------------------yh_logs告警模块--------------------------------
#发送短信失败告警
cron.task.logs.sns_send_failed=0 0/2 * * * ?
alarm.logs.sns_send_failed.time_period=2
alarm.logs.sns_send_failed.threshold_count=5
#----------------------------yh_logs告警模块--------------------------------
#------------jmxtrans----------------
cron.task.jmxtrans.memory=0 0/5 * * * ?
jmxtrans.memory.time_period=5
jmxtrans.memory.flag=3500000000
cron.task.jmxtrans.thread=0 0/5 * * * ?
jmxtrans.thread.time_period=5
jmxtrans.thread.flag=1500
#------------jmxtrans----------------
#------------orderinfocheck----------------
cron.task.orderinfocheck=0 0/2 * * * ?
cron.task.refundAchange=0 0/5 * * * ?
#------------jmxtrans----------------
#------------nginx----------------
cron.nginx.countCheck=0 0/2 * * * ?
cron.nginx.countCheck_period=2
cron.nginx.countCheck_number=2000
#------------nginx----------------
#------------client----------------
cron.client.countCheck=0 0/3 * * * ?
cron.client.countCheck_period=3
... ... @@ -8,4 +135,14 @@ cron.task.influxdb.client.hour=0 0 0/1 * * ?
cron.task.influxdb.client.day=0 0 0 0/1 * ?
cron.task.influxdb.clientreport.peroid=5
#------------client----------------
#-----logs----
cron.task.logs=0 0/2 * * * ?
alarm.logs.time_period=2
#-----logs----
cron.task.client.dns=0 0 0/1 * * ?
#-------search
cron.task.search.exception=0 0/5 * * * ?
cron.task.search.log=0 0/10 * * * ?
cron.task.search.log.period=10
cron.task.search.time_period=5
\ No newline at end of file
... ...
order.system.url=http://172.31.70.205:8084/order
erp.system.url=http://api.erp.yohobuy.com
\ No newline at end of file
... ...
rabbit_host=172.31.50.188:5672
rabbit_user=yoho
rabbit_password=yoho
rabbit_vhost=yoho
\ No newline at end of file
... ...
... ... @@ -7,6 +7,62 @@ sendsms.notice.productid=8
qcloud_sms_url=https://yun.tim.qq.com/v3/tlssmssvr/sendmultisms2?sdkappid=1400021400&random=124
qcloud_sms_key=6e56f948f6f1c0a1bc359e23f7acc140
base_mobile=18751986615,18652008443
base_mobile=18751986615,18652008443,13515100825,18252034289
clien_error_mobile=18751986615,18652008443,18915961598,18252034289,13515100825
\ No newline at end of file
#------------------------------------------支付回调手机号------------------------------------------------
sendsms.alarm.paycallback=18751986615,18652008443,13515100825,18252034289
#------------------------------------------支付回调手机号------------------------------------------------
#------------------------------------------订单异常手机号------------------------------------------------
sendsms.alarm.mobile.orderexception=13585196262,13951634768,15950561359,18751986615,18652008443,13515100825,18252034289
#------------------------------------------订单异常手机号------------------------------------------------
#------------------------------------------用户行为异常手机号------------------------------------------------
sendsms.alarm.mobile.userbehaviour=18751986615,18652008443,13515100825,18252034289
#------------------------------------------用户行为异常手机号------------------------------------------------
#------------------------------------------数据库异常手机号------------------------------------------------
sendsms.alarm.mobile.dbexception=18652008443,18751986615,13811102093,13451938602,13515100825,18252034289
#------------------------------------------数据库异常手机号------------------------------------------------
#-------------------------------------------服务异常告警手机号----------------------------------------------------
sendsms.alarm.mobile.serviceexception.product=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.search=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.guang=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.users=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.order=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.sns=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.promotion=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.message=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.resources=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
sendsms.alarm.mobile.serviceexception.brower=18751986615,18652008443,18001582955,15950561359,13451938602,13515100825,18252034289
#-------------服务异常告警手机号-------------------
#---------------------Monitor异常数据告警手机号------------------
sendsms.alarm.mobile.monitor.exception=18751986615,18652008443,13515100825,18252034289
#---------------------Monitor异常数据告警手机号------------------
#-----------------------------Logs告警模块---------------------------
#短信发送失败量超过阀值 告警手机号
sendsms.alarm.mobile.logs.sns_send_failed=18751986615,18652008443,13515100825,18252034289
#-----------------------------Logs告警模块--------------------------
#-----------------------------监控系统开发人员--------------------------
sendsms.alarm.mobile.ops_manager.developer=13951685157
#-----------------------------监控系统开发人员--------------------------
dnspod.mobile=18751986615,18652008443,13515100825,18252034289
jmxtrans.mobile=18751986615,18652008443,13515100825,18252034289
nginx.config.switch.mobile=18751986615,18652008443,13515100825,18252034289
#订单校验失败
orderinfocheck.mobile=15950561359,13951882433,18751986615,18652008443,13515100825,18252034289,13552738725,13902496867,18511020499
nginx.error.mobile=18751986615,18652008443,13515100825,18252034289
log.order.error.mobile=18751986615,18652008443,13515100825,18252034289
search.mobile=18751986615,18652008443,13515100825,18252034289
clien_error_mobile=18751986615,18652008443,13515100825,18252034289
\ No newline at end of file
... ...
... ... @@ -6,7 +6,7 @@ jdbc.users=yh_test
jdbc.passwords=yh_test
local.jdbc.url=jdbc:mysql://172.16.6.246:3306/yh_ops?characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
local.jdbc.url=jdbc:mysql://172.16.6.61:3306/yh_ops?characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
local.jdbc.user=root
local.jdbc.password=123456
#---------jdbc config----------
\ No newline at end of file
... ...
... ... @@ -4,5 +4,6 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
%>
<html>
<body>
Hello!
</body>
</html>
... ...