Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
ops
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangwei
ops
Commits
c86808b8
Commit
c86808b8
authored
Mar 20, 2017
by
zhangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改zabbix用户无法导入数据库模块的问题
parent
2b5bb08a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
10 deletions
+19
-10
check_pay_failure.py
cms_log/cms_log/check_pay_failure.py
+5
-4
cms_check_log.py
cms_log/cms_log/cms_check_log.py
+2
-1
cms_log.py
cms_log/cms_log/cms_log.py
+2
-2
cms_config.json
cms_log/cms_log/config/cms_config.json
+3
-2
db.py
cms_log/cms_log/util/db.py
+7
-1
No files found.
cms_log/cms_log/check_pay_failure.py
View file @
c86808b8
...
@@ -31,6 +31,7 @@ def action(failure_count):
...
@@ -31,6 +31,7 @@ def action(failure_count):
#cms_post.post(ali_uid, metric_name, failure_count, unit, fields)
#cms_post.post(ali_uid, metric_name, failure_count, unit, fields)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
count
=
0
dbname
=
"summer_hill"
dbname
=
"summer_hill"
# timestamp 起始时间戳,定义为当前一小时内,3600秒。
# timestamp 起始时间戳,定义为当前一小时内,3600秒。
timestamp
=
times
.
currsecs
()
-
3600
timestamp
=
times
.
currsecs
()
-
3600
...
@@ -55,6 +56,6 @@ order by
...
@@ -55,6 +56,6 @@ order by
if
len
(
rs
)
>
0
:
if
len
(
rs
)
>
0
:
for
line
in
rs
:
for
line
in
rs
:
#print("[sum]:%s,[user_id]:%s,[truename]:%s") % (line[0], line[1], line[2])
#print("[sum]:%s,[user_id]:%s,[truename]:%s") % (line[0], line[1], line[2])
print
(
line
[
0
])
if
line
[
0
]
>
1
:
else
:
count
=
count
+
1
print
(
0
)
print
(
count
)
\ No newline at end of file
\ No newline at end of file
cms_log/cms_log/cms_check_log.py
View file @
c86808b8
...
@@ -46,4 +46,4 @@ def main():
...
@@ -46,4 +46,4 @@ def main():
action
()
action
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
sys
.
exit
(
action
(
sys
.
argv
[
1
]))
sys
.
exit
(
action
(
sys
.
argv
[
1
]))
\ No newline at end of file
cms_log/cms_log/cms_log.py
View file @
c86808b8
...
@@ -51,7 +51,6 @@ def action():
...
@@ -51,7 +51,6 @@ def action():
project_name
=
"user.shenlan"
project_name
=
"user.shenlan"
elif
opts
.
type
==
'videocs'
:
# 视频-深蓝学城
elif
opts
.
type
==
'videocs'
:
# 视频-深蓝学城
project_name
=
"video-center.shenlan"
project_name
=
"video-center.shenlan"
check_log
(
project_name
)
check_log
(
project_name
)
def
main
():
def
main
():
...
@@ -70,4 +69,4 @@ def main():
...
@@ -70,4 +69,4 @@ def main():
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
sys
.
exit
(
main
())
sys
.
exit
(
main
())
\ No newline at end of file
cms_log/cms_log/config/cms_config.json
View file @
c86808b8
...
@@ -4,5 +4,5 @@
...
@@ -4,5 +4,5 @@
"unit"
:
"Seconds"
,
"unit"
:
"Seconds"
,
"dimensions"
:
"log_active=project-log-active"
,
"dimensions"
:
"log_active=project-log-active"
,
"log_dir"
:
"/usr/local/nginx/logs"
,
"log_dir"
:
"/usr/local/nginx/logs"
,
"log_exten"
:
".access.log"
"log_exten"
:
"
shenlan
.access.log"
}
}
\ No newline at end of file
cms_log/cms_log/util/db.py
View file @
c86808b8
import
MySQLdb
import
os
import
times
import
times
import
sys
import
sys
#zabbix用户import MySQLdb
try
:
import
MySQLdb
except
:
os
.
environ
[
"PYTHON_EGG_CACHE"
]
=
"/tmp/.python-eggs"
import
MySQLdb
'''
'''
host = "192.168.2.26"
host = "192.168.2.26"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment