Commit c8db9588 by zhangwei

Merge branch 'master' of https://git.neoteched.com/zhangwei/ops

# Conflicts:
#	checklist/checkitems.pyc
#	checklist/tools.pyc
parent 028312e9
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="useProjectProfile" value="false" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.13 (D:\Python27\python.exe)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cms_log.iml" filepath="$PROJECT_DIR$/.idea/cms_log.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="8028c0c1-95ab-4dac-89ff-d1b1d4fe5d37" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1936" />
<option name="height" value="1056" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="8028c0c1-95ab-4dac-89ff-d1b1d4fe5d37" name="Default" comment="" />
<created>1484619813229</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1484619813229</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="false" />
<layout>
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="processedProjectFiles" value="true" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
</project>
\ No newline at end of file
# -*- coding:utf8 -*-
from util import db
from util import times
from util import cms_config
from util import cms_post
import sys
reload(sys)
sys.setdefaultencoding('utf8')
#测试环境
host = "192.168.2.26"
port = 3306
user = "root"
password = "yaochizaocan"
#线网环境
'''
host = "mysql.in.shenlancity.com"
port = 3306
user = "summer_hill"
password = "xytXdnZMGr4B7BVd"
'''
def action(failure_count):
config_infos = cms_config.load_config_check_pay_failure()
ali_uid = config_infos["ali_uid"]
metric_name = config_infos["metric_name"]
unit = config_infos["unit"]
dimensions = config_infos["dimensions"]
fields = dimensions.replace("project","summer-hill")
print ali_uid,metric_name,unit,dimensions,fields,failure_count
#cms_post.post(ali_uid, metric_name, failure_count, unit, fields)
if __name__ == '__main__':
dbname="summer_hill"
# timestamp 起始时间戳,定义为当前一小时内,3600秒。
timestamp=times.currsecs()-3600
#timestamp = times.currsecs() - 86400
d=db.openMysql(host,port,user,password,dbname)
sql='''select
t.sum,user_id,truename
from
(select
user_id,state,ctime,mtime,money,count(user_id) as sum,u.truename
from
summer_hill.`order` o,summer_hill.`user` u
where ctime>%d and state='closed' and o.user_id=u.id
group by user_id) t
order by
t.sum desc;''' % (timestamp)
#print sql
c=d.cursor()
c.execute(sql)
rs=c.fetchall()
d.close()
if len(rs)>0:
for line in rs:
print("[sum]:%s,[user_id]:%s,[truename]:%s") % (line[0], line[1], line[2])
action(line[0])
else:
action(0)
\ No newline at end of file
# -*- coding:utf8 -*-
from util import db
from util import times
from optparse import OptionParser
from util import cms_post
from util import cms_config
import sys
#测试环境
host = "192.168.2.26"
port = 3306
user = "root"
password = "yaochizaocan"
#线网环境
'''
host = "mysql.in.shenlancity.com"
port = 3306
user = "summer_hill"
password = "xytXdnZMGr4B7BVd"
'''
def get_interval(db_time):
curtime=times.currsecs()
interval=curtime-db_time
return interval
def action(interval):
config_infos = cms_config.load_config_check_pay_stat()
ali_uid = config_infos["ali_uid"]
metric_name = config_infos["metric_name"]
unit = config_infos["unit"]
dimensions = config_infos["dimensions"]
fields = dimensions.replace("project","summer-hill")
print ali_uid,metric_name,unit,dimensions,fields,interval
#cms_post.post(ali_uid, metric_name, interval, unit, fields)
if __name__ == '__main__':
user_info={}
dbname="summer_hill"
d=db.openMysql(host,port,user,password,dbname)
sql='''select id,product_id,user_id,state,ctime,mtime from summer_hill.order where state='closed';'''
c=d.cursor()
c.execute(sql)
rs=c.fetchall()
d.close()
if len(rs) > 0:
for line in rs:
print("[product_id]:%s,[user_id]:%s,[state]:%s") % (line[1],line[2],line[3])
interval=get_interval(line[4])
action(interval)
else:
interval=0
action(interval)
\ No newline at end of file
# -*- coding:utf8 -*-
import sys
from optparse import OptionParser
from util import cms_post
from util import comm
from util import times
from util import cms_config
def action(app):
new_errors = 0
config_infos = cms_config.load_config_check_log()
ali_uid = config_infos["ali_uid"]
metric_name = config_infos["metric_name"]
unit = config_infos["unit"]
dimensions = config_infos["dimensions"]
tmp_dir = config_infos["tmp_dir"]
log_infos = config_infos["log_info"]
for num in range(len(log_infos)):
if log_infos[num]["project_name"] == app:
log_file = log_infos[num]["log_file"]
check_string = log_infos[num]["check_string"]
if comm.exist_file(log_file):
new_errors = comm.analysis_log(log_file, app, tmp_dir, check_string)
fields = dimensions.replace("$project", project_name)
# cms_post.post(ali_uid, metric_name, new_errors[0], unit, fields)
print(new_errors[0])
break
else:
continue
def main():
global opts, args
parser = OptionParser()
parser.add_option("--type", dest="type", choices=['book', 'jumpera','summer',
'userc', 'videoc','nginx','php']
, help="The type,'[book,jumper-admin,summer-hill,\
user-center,video-center,nginx,php]'")
(opts, args) = parser.parse_args()
if (opts.type is None):
parser.print_help()
sys.exit(0)
action()
if __name__ == '__main__':
sys.exit(action(sys.argv[1]))
# -*- coding:utf8 -*-
import sys
from optparse import OptionParser
from util import cms_post
from util import comm
from util import times
from util import cms_config
def action():
new_errors = 0
config_infos = cms_config.load_config_check_log()
ali_uid = config_infos["ali_uid"]
metric_name = config_infos["metric_name"]
unit = config_infos["unit"]
dimensions = config_infos["dimensions"]
tmp_dir = config_infos["tmp_dir"]
log_infos = config_infos["log_info"]
for num in range(len(log_infos)):
log_file = log_infos[num]["log_file"]
check_string = log_infos[num]["check_string"]
project_name = log_infos[num]["project_name"]
if comm.exist_file(log_file):
new_errors = comm.analysis_log(log_file, project_name, tmp_dir, check_string)
if new_errors[0] > 0:
fields = dimensions.replace("$project",project_name)
#alarm_info = fields.replace("$time", new_errors[1])
#cms_post.post(ali_uid, metric_name, new_errors[0], unit, alarm_info)
cms_post.post(ali_uid, metric_name, new_errors[0], unit, fields)
#strlog = '|%s|%s|%d|%s|%s|' % (ali_uid, metric_name, new_errors[0], unit, alarm_info)
#print strlog
def main():
global opts, args
parser = OptionParser()
parser.add_option("--type", dest="type", choices=['book', 'jumpera','summer',
'userc', 'videoc','nginx','php']
, help="The type,'[book,jumper-admin,summer-hill,\
user-center,video-center,nginx,php]'")
(opts, args) = parser.parse_args()
if (opts.type is None):
parser.print_help()
sys.exit(0)
action()
if __name__ == '__main__':
sys.exit(action())
#!/bin/bash
cd /opt/neo/script/cms_log/
#(nginx php book video-center user-center summer-hill)
/usr/bin/python cms_check_log.py $1
# -*- coding:utf8 -*-
import sys
from optparse import OptionParser
from util import cms_post
from util import comm
from util import times
from util import cms_config
def check_log(project_name):
Log_Change_Time = 0
config_infos = cms_config.load_config()
log_dir = config_infos["log_dir"]
log_exten = config_infos["log_exten"]
ali_uid = config_infos["ali_uid"]
metric_name = config_infos["metric_name"]
unit = config_infos["unit"]
dimensions = config_infos["dimensions"]
log_file = log_dir + "/" + project_name + log_exten
if comm.exist_file(log_file):
last_line = comm.read_file_last_line(log_file)
log_secs = times.currsecs()
if last_line != "":
log_time = comm.parser_log_time(last_line)
log_secs = times.str2secs(log_time)
curr_secs = times.currsecs()
Log_Change_Time = curr_secs - log_secs
fields = dimensions.replace("project",project_name)
#print("time: "+str(Log_Change_Time))
print(Log_Change_Time)
#cms_post.post(ali_uid, metric_name, Log_Change_Time, unit, fields)
#strlog = '|%s|%s|%d|%s|%s|' % (ali_uid, metric_name, Log_Change_Time, unit, fields)
#print strlog
def action():
# book books go sks userc users videocs
project_name = "sk.shenlan"
if opts.type == 'book' : #图书平台
project_name = "book"
elif opts.type == 'books' :
project_name = "book.shenlan"
elif opts.type == 'go' : #URL跳转管理
project_name = "go"
elif opts.type == 'sks' : #学习平台
project_name = "sk.shenlan"
elif opts.type == 'userc' : #用户中心
project_name = "user-center"
elif opts.type == 'users' : #用户中心-深蓝学城
project_name = "user.shenlan"
elif opts.type == 'videocs': # 视频-深蓝学城
project_name = "video-center.shenlan"
check_log(project_name)
def main():
global opts, args
parser = OptionParser()
parser.add_option("--type", dest="type", choices=['book', 'books', 'go','users',
'sks', 'userc', 'videocs']
, help="The type,'[book,book.shenlan,go,sk.shenlan,\
user.shenlan, user-center,video-center.shenlan]'")
(opts, args) = parser.parse_args()
if (opts.type is None):
parser.print_help()
sys.exit(0)
action()
if __name__ == '__main__':
sys.exit(main())
#!/bin/bash
cd /opt/neo/script/cms_log/
#name=(book books go sks userc users videocs)
/usr/bin/python cms_log.py --type $1
{
"ali_uid": "1723542903757723",
"metric_name": "check_pay_failure",
"unit": "Count",
"dimensions": "pay_failure=project-pay-failure"
}
\ No newline at end of file
{
"ali_uid": "1723542903757723",
"metric_name": "check_pay",
"unit": "Seconds",
"dimensions": "pay_stat=project-pay-stat"
}
\ No newline at end of file
{
"ali_uid": "1723542903757723",
"metric_name": "check_log",
"unit": "Seconds",
"dimensions": "log_active=project-log-active",
"log_dir": "/usr/local/nginx/logs",
"log_exten": ".access.log"
}
{
"ali_uid": "1723542903757723",
"metric_name": "check_error_log",
"unit": "Count",
"dimensions": "error_log_alarm=$project-log-had-new-error-info",
"tmp_dir": "/opt/neo/script/cms_log/tmp",
"log_info": [
{
"project_name": "nginx",
"log_file": "/usr/local/nginx/logs/error.log",
"check_string": "'error'"
},
{
"project_name": "php",
"log_file": "/usr/local/php7/var/log/php_errors.log",
"check_string": "'PHP Fatal error'"
},
{
"project_name": "book",
"log_file": "/web/shenlan/book/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "video-center",
"log_file": "/web/shenlan/video-center/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "user-center",
"log_file": "/web/shenlan/user-center/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "summer-hill",
"log_file": "/web/shenlan/summer-hill/protected/runtime/app.log",
"check_string": "'error'"
}
]
}
{
"ali_uid": "1723542903757723",
"metric_name": "check_error_log",
"unit": "Count",
"dimensions": "error_log_alarm=$project log alarm time is $time",
"tmp_dir": "/opt/neo/script/cms_log/tmp",
"log_info": [
{
"project_name": "nginx",
"log_file": "/usr/local/nginx/logs/error.log",
"check_string": "'error'"
},
{
"project_name": "php",
"log_file": "/usr/local/php7/var/log/php_errors.log",
"check_string": "'PHP Fatal error'"
},
{
"project_name": "book",
"log_file": "/web/shenlan/book/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "video-center",
"log_file": "/web/shenlan/video-center/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "user-center",
"log_file": "/web/shenlan/user-center/protected/runtime/app.log",
"check_string": "'error'"
},
{
"project_name": "summer-hill",
"log_file": "/web/shenlan/summer-hill/protected/runtime/app.log",
"check_string": "'error'"
}
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
[2016-12-09T06:08:21+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/book-1.1.1/protected/x2ts/rpc/RPC.php(85) with message: Socket error: could not connect to host.
[2016-12-09T06:08:21+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/book-1.1.1/protected/x2ts/rpc/RPC.php(85) with message: Socket error: could not connect to host.
2016/12/28 07:52:58 [error] 3405#0: recv() failed (104: Connection reset by peer) while requesting certificate status, responder: ocsp.comodoca.com
2016/12/28 07:52:58 [error] 3405#0: OCSP responder prematurely closed connection while requesting certificate status, responder: ocsp.comodoca.com
2016/12/28 08:32:40 [error] 3405#0: *688795 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 202.97.144.51, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/2.0", host: "www.shenlancity.com"
2016/12/28 08:32:40 [error] 3405#0: *688795 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 202.97.144.51, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/2.0", host: "www.shenlancity.com"
2016/12/28 09:06:05 [error] 3405#0: *689203 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 124.207.127.67, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:06:05 [error] 3405#0: *689204 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 124.207.127.67, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
2016/12/28 09:20:05 [error] 3405#0: *689410 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:23:03 [error] 3405#0: *689454 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:23:35 [error] 3405#0: *689470 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:42:19 [error] 3405#0: *689888 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:42:20 [error] 3405#0: *689892 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
2016/12/28 09:42:23 [error] 3405#0: *689888 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com", referrer: "http://shenlancity.com/"
2016/12/28 10:38:13 [error] 3405#0: *691274 open() "/web/shenlan/www/webroot/cgi-bin/test-cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/test-cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:38:14 [error] 3405#0: *691275 open() "/web/shenlan/www/webroot/cgi-bin/nph-test-cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/nph-test-cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:38:14 [error] 3405#0: *691278 open() "/web/shenlan/www/webroot/cgi-bin/test.cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/test.cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:57:39 [error] 3406#0: *692090 open() "/web/neo/webroot/favicon.ico" failed (2: No such file or directory), client: 114.249.239.64, server: neoteched.com, request: "GET /favicon.ico HTTP/1.1", host: "neoteched.com", referrer: "http://neoteched.com/"
2016/12/28 11:18:14 [error] 3406#0: *692742 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 210.12.30.146, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
2016/12/28 11:23:06 [error] 3406#0: *692902 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 210.12.30.146, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com", referrer: "https://www.shenlancity.com/"
2016/12/28 07:52:58 [error] 3405#0: recv() failed (104: Connection reset by peer) while requesting certificate status, responder: ocsp.comodoca.com
2016/12/28 07:52:58 [error] 3405#0: OCSP responder prematurely closed connection while requesting certificate status, responder: ocsp.comodoca.com
2016/12/28 08:32:40 [error] 3405#0: *688795 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 202.97.144.51, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/2.0", host: "www.shenlancity.com"
2016/12/28 08:32:40 [error] 3405#0: *688795 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 202.97.144.51, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/2.0", host: "www.shenlancity.com"
2016/12/28 09:06:05 [error] 3405#0: *689203 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 124.207.127.67, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:06:05 [error] 3405#0: *689204 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 124.207.127.67, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
2016/12/28 09:20:05 [error] 3405#0: *689410 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:23:03 [error] 3405#0: *689454 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:23:35 [error] 3405#0: *689470 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 61.176.213.154, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:42:19 [error] 3405#0: *689888 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com"
2016/12/28 09:42:20 [error] 3405#0: *689892 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
2016/12/28 09:42:23 [error] 3405#0: *689888 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 39.64.34.20, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "shenlancity.com", referrer: "http://shenlancity.com/"
2016/12/28 10:38:13 [error] 3405#0: *691274 open() "/web/shenlan/www/webroot/cgi-bin/test-cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/test-cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:38:14 [error] 3405#0: *691275 open() "/web/shenlan/www/webroot/cgi-bin/nph-test-cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/nph-test-cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:38:14 [error] 3405#0: *691278 open() "/web/shenlan/www/webroot/cgi-bin/test.cgi" failed (2: No such file or directory), client: 31.193.128.228, server: www.shenlancity.com, request: "GET /cgi-bin/test.cgi HTTP/1.1", host: "60.205.156.216"
2016/12/28 10:57:39 [error] 3406#0: *692090 open() "/web/neo/webroot/favicon.ico" failed (2: No such file or directory), client: 114.249.239.64, server: neoteched.com, request: "GET /favicon.ico HTTP/1.1", host: "neoteched.com", referrer: "http://neoteched.com/"
2016/12/28 11:18:14 [error] 3406#0: *692742 open() "/web/shenlan/www/webroot/favicon.ico" failed (2: No such file or directory), client: 210.12.30.146, server: www.shenlancity.com, request: "GET /favicon.ico HTTP/1.1", host: "www.shenlancity.com"
[2016-12-23T11:48:28+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-23T16:54:16+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-23T16:54:22+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-24T02:03:38+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-26T10:44:51+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T12:00:07+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T12:16:40+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-26T12:16:46+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-26T16:46:42+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T16:46:42+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T16:46:44+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T18:09:59+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-27T10:57:12+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-27T12:24:00+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-27T16:39:37+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-23T11:48:28+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-23T16:54:16+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-23T16:54:22+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-24T02:03:38+08:00][error][x2ts\app\Action::run]model\StartLearnException is thrown at /web/shenlan/summer-hill-3.3.6/protected/model/LearntCard.php(61) with message: 非法开启卡片
[2016-12-26T10:44:51+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T12:00:07+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T12:16:40+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-26T12:16:46+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-26T16:46:42+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T16:46:42+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T16:46:44+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-26T18:09:59+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-27T10:57:12+08:00][error][x2ts\app\Action::run]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot add or update a child row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_rev_eq` FOREIGN KEY (`revision_id`) REFERENCES `exam_question_revision` (`id`) ON UPDATE CASCADE)
[2016-12-27T12:24:00+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-27T16:39:37+08:00][error][action\admin_api\content\ExamPoint::httpDelete]x2ts\db\DataBaseException is thrown at /web/shenlan/summer-hill-3.3.6/protected/x2ts/db/MySQL.php(113) with message: Cannot delete or update a parent row: a foreign key constraint fails (`summer_hill`.`exam_question`, CONSTRAINT `fk_ep_eq` FOREIGN KEY (`id`) REFERENCES `exam_point` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE)
[2016-12-13T15:58:19+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:24+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:30+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:38+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:43+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:49+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-19T20:00:40+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-20T10:38:41+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-20T20:21:14+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-23T10:40:50+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-24T10:22:30+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-28T10:59:14+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-28T10:59:44+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-28T10:59:49+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:19+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:24+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:30+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:38+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:43+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-13T15:58:49+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-19T20:00:40+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-20T10:38:41+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-20T20:21:14+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-23T10:40:50+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-24T10:22:30+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-28T10:59:14+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
[2016-12-28T10:59:44+08:00][error][x2ts\app\Action::run]AMQPConnectionException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/RPC.php(87) with message: Socket error: could not connect to host.
[2016-12-28T10:59:49+08:00][error][x2ts\app\Action::run]AMQPQueueException is thrown at /web/shenlan/user-center-1.2.5/protected/x2ts/rpc/Response.php(50) with message: Consumer timeout exceed
# -*- coding: utf-8 -*-
__version__ = '1.0'
__author__ = 'wanglixiao'
__about__ = """
neoteched check project logs
"""
\ No newline at end of file
# -*- coding: utf-8 -*-
import os
import json
CONFIG_FILE = '/config/cms_config.json'
CONFIG_CHECK_LOG_FILE = '/config/cms_config_check_log.json'
CONFIG_CHECK_PAY_STAT_FILE = '/config/check_pay_stat.json'
CONFIG_CHECK_PAY_FAILURE_FILE = '/config/check_pay_failure.json'
# load profile
def load_config(config_file=None):
# type: (object) -> object
"""
读取配置文件
"""
if (config_file == None):
dir_name = os.getcwd()
#config_file = dir_name.rpartition("/")[0] + CONFIG_FILE
config_file = dir_name + CONFIG_FILE
fs = open(config_file, "rb")
json_data = ""
try:
json_data = fs.read()
finally:
fs.close()
config_infos = json.loads(json_data)
return config_infos
# load profile
def load_config_check_log( ):
"""
读取错误日志信息告警配置文件
"""
dir_name = os.getcwd()
config_file = dir_name + CONFIG_CHECK_LOG_FILE
config_infos = load_config(config_file)
return config_infos
def load_config_check_pay_stat( ):
"""
读取错误日志信息告警配置文件
"""
dir_name = os.getcwd()
config_file = dir_name + CONFIG_CHECK_PAY_STAT_FILE
config_infos = load_config(config_file)
return config_infos
def load_config_check_pay_failure( ):
"""
读取错误日志信息告警配置文件
"""
dir_name = os.getcwd()
config_file = dir_name + CONFIG_CHECK_PAY_FAILURE_FILE
config_infos = load_config(config_file)
return config_infos
#!/usr/bin/python
# ########################################
# Function: CMS self-defined monitor SDK
# Usage: python cms_post.py ali_uid, metric_name, value, fields
# Author: CMS Dev Team
# Company: Aliyun Inc.
# Version: 1.0
# Description: Since Python 2.6, please check the version of your python interpreter
# ########################################
import sys
import time
import socket
import random
import urllib
import httplib
import json
import logging
from logging.handlers import RotatingFileHandler
REMOTE_HOST = 'open.cms.aliyun.com'
REMOTE_PORT = 80
REMOTE_MONITOR_URI = "/metrics/put"
def post(ali_uid, metric_name, metric_value, unit, fields):
# init logger
logger = logging.getLogger('post')
logger.setLevel(logging.INFO)
#handler = RotatingFileHandler(filename="/tmp/post.log", mode='a', maxBytes=1024 * 1024, backupCount=3)
handler = RotatingFileHandler(filename="./post.log", mode='a', maxBytes=1024 * 1024, backupCount=3)
formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
socket.setdefaulttimeout(10)
# convert dimensions
kv_array = fields.split(',')
dimensions = {}
for kv in kv_array:
kv_array = kv.split('=')
#print "dimensions:%s=%s" %(kv_array[0],kv_array[1])
dimensions[kv_array[0]] = kv_array[1]
json_str = json.dumps(dimensions)
#current timestamp
timestamp = int(time.time() * 1000)
#concate to metrics
metrics = '[{"metricName": "%s","timestamp": %s,"value": %s, "unit": "%s", "dimensions": %s}]' % (
metric_name,str(timestamp),str(metric_value),unit, json_str)
params = {"userId": ali_uid, "namespace": "acs/custom/%s" % ali_uid, "metrics": metrics}
print params
#report at random 5 seconds
interval = random.randint(0, 5000)
time.sleep(interval / 1000.0)
data = urllib.urlencode(params)
headers = {"Content-Type": "application/x-www-form-urlencoded", "Connection": "close"}
exception = None
http_client = None
try:
http_client = httplib.HTTPConnection(REMOTE_HOST, REMOTE_PORT)
try:
http_client.request(method="POST", url=REMOTE_MONITOR_URI, body=data, headers=headers)
response = http_client.getresponse()
if response.status == 200:
print "upload metric succeed!"
return
else:
print "response code %d, content %s " % (response.status, response.read())
logger.warn("response code %d, content %s " % (response.status, response.read()))
except Exception, e:
exception = e
finally:
if http_client:
http_client.close()
if exception:
logger.error(exception)
if __name__ == '__main__':
#print len(sys.argv)
#for arg in sys.argv:
# print arg
if len(sys.argv) != 6:
print "argv format should be: aliuid, metricName, metricValue, unit, kvpairs"
print """
for example:
python cms_post.py 1736511134389110 'Perm_Generation' 10 'Percent' 'instanceId=cmssiteprobeqd115029112222'
"""
exit(1)
post(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5])
#!/bin/bash
#########################################
#Usage: sh cms_post.sh
#Author: CMS Dev Team
#Company: Aliyun Inc.
#Version: 1.0
#########################################
#parameters instructions
# $1: ali_uid, $2: metric_name, $3: metric_value, $4:fields
#convert current time to milliseconds
if [[ ! "$#" -eq 4 ]];then
echo "usage: $0 userId, metricName, value, dimensions"
echo " --multiple dimensions like 'ip=111.111.111.111,hostname=cms'"
exit 1
fi
#biz time
timestamp=`date +%s%N | cut -b1-13`
#build dimensions json
arr=(${4//,/ })
dimensions="{"
for i in "${arr[@]}"; do
kv=(${i//=/ })
dimensions=${dimensions}'"'${kv[0]}'":"'${kv[1]}'",'
done
dimensions=${dimensions%,*}
dimensions=${dimensions}'}'
#build namespace and metrics
userId="$1"
namespace="acs/custom/$1"
metrics='[{"metricName":"'"$2"'","value":'"$3"',"unit":"None","timestamp":'"$timestamp"',"dimensions":'"$dimensions"'}]'
url="http://open.cms.aliyun.com/metrics/put"
params="userId=$userId&namespace=$namespace&metrics=$metrics"
echo "params: ${params}"
curl -v ${url} --data ${params}
# -*- coding:utf8 -*-
import os
import re
def exist_file(file_name):
if (os.path.exists(file_name) == False):
return False
if (os.path.isfile(file_name) == False):
return False
return True
def read_file_last_linei2(file_name):
last_line = ''
with open(file_name, 'r') as f:
off = -512
while True:
f.seek(off, 2)
lines = f.readlines()
if len(lines) >= 2:
last_line = lines[-1]
break
off *= 2
return last_line
def read_file_last_line(file_name):
last_line = ''
file_size = os.path.getsize(file_name)
if file_size > 512:
with open(file_name, 'r') as f:
off = -512
while True:
f.seek(off, 2)
lines = f.readlines()
if len(lines) >= 2:
last_line = lines[-1]
break
off *= 2
elif file_size > 0:
with open(file_name, 'r') as f:
lines = f.readlines()
last_line = lines[-1]
return last_line
def parser_log_time(log_line):
log_part = log_line.split("[")[1]
return log_part.split("+")[0].replace("T", " ")
def analysis_log(log_file, project_name, tmp_dir, check_string):
old_tmp_file = tmp_dir + "/" + project_name + ".old"
new_tmp_file = tmp_dir + "/" + project_name + ".new"
if exist_file(new_tmp_file):
os.rename(new_tmp_file, old_tmp_file)
new_error_num = 0
new_error_time = ''
cmd_line = "grep -a " + check_string + " " + log_file + " | grep '\[error\]' > " + new_tmp_file
if project_name == 'php':
cmd_line = "grep -a " + check_string + " " + log_file + " > " + new_tmp_file
os.system(cmd_line)
if exist_file(old_tmp_file):
cmd_line = "diff " + old_tmp_file + " " + new_tmp_file
diff_arr = os.popen(cmd_line).readlines()
new_error_num = len(diff_arr)
if new_error_num > 0:
if project_name == 'nginx':
mt = re.match(r'(\D+\S+\d+/\d+/\d+ \d+:\d+:\d+)', diff_arr[1])
elif project_name == 'php':
mt = re.match(r'\D+\s\[(\d+-\w+-\d+ \d+:\d+:\d+)', diff_arr[1])
else:
mt = re.match(r'\D+\S+\[(\d+-\d+-\d+\w\d+:\d+:\d+)', diff_arr[1])
if str(mt) != 'None':
new_error_time = mt.groups()[0]
return [new_error_num, new_error_time]
def match_log_line(long_line):
mt = re.match(r'^\[(\d+)-(\d+)-(\d+)(\w)(\d+):(\d+):(\d+)\+(\d+)\:(\d+)\]', long_line)
if str(mt) == 'None':
return False
return True
if __name__=='__main__':
import sys
if exist_file(sys.argv[1]):
print read_file_last_line(sys.argv[1])
import MySQLdb
import times
import sys
'''
host = "192.168.2.26"
port = 3306
user = "root"
password = "yaochizaocan"
dbname = "summer_hill"
'''
def openMysql(host,port,user,password,dbname):
try:
db = MySQLdb.connect(host=host,port=port,user=user,passwd=password,db=dbname,charset='utf8')
return db
except Exception,e:
print("[+]:ERROR: %s" % (e) )
sys.exit(1)
'''
if __name__ == '__main__':
db = openMysql(host,port,user,password,dbname)
c = db.cursor()
sql = "select id,product_id,user_id,state,ctime,mtime from summer_hill.order where state='closed';"
c.execute(sql)
curtime = times.currsecs()
print (curtime-c.fetchone()[5])
'''
# -*- coding:utf8 -*-
import time
import datetime
def str2secs(s_time):
if s_time is None:
return 0
times = time.strptime(s_time,"%Y-%m-%d %H:%M:%S")
return int(time.mktime(times))
def secs2str(s_secs):
if int(s_secs) <=0:
return None
return str(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(s_secs)))
def strf_curr_time():
return str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
def currsecs():
return int(time.time())
if __name__=='__main__':
import sys
s = int(sys.argv[1])
print secs2str(s)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment