Commit 75043999 by zhangwei

修改jason日志目录配置

注销action函数里fields行。
parent 33597d53
......@@ -18,12 +18,14 @@ def action(app):
log_infos = config_infos["log_info"]
for num in range(len(log_infos)):
print num
print log_infos[num]["project_name"]
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)
#fields = dimensions.replace("$project", project_name)
# cms_post.post(ali_uid, metric_name, new_errors[0], unit, fields)
print(new_errors[0])
break
......
......@@ -27,7 +27,7 @@ def check_log(project_name):
curr_secs = times.currsecs()
Log_Change_Time = curr_secs - log_secs
fields = dimensions.replace("project",project_name)
#fields = dimensions.replace("project",project_name)
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)
......
......@@ -3,7 +3,7 @@
"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",
"tmp_dir": "/data/script/zabbix/tmp",
"log_info": [
{
"project_name": "nginx",
......
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