Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
1387e295
Commit
1387e295
authored
9 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决cpu占用过大问题
parent
32ab051b
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
lagacy-0.4.0
node_service
password
rbac
restrict_access
test
v52
wph
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
0.3.3
0.3.2
0.3.2-rc2
0.3.1
0.3.0-beta
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
log_handler.py
log_handler.py
+23
-1
No files found.
log_handler.py
View file @
1387e295
...
...
@@ -69,7 +69,7 @@ def run():
try
:
file_time
=
int
(
os
.
stat
(
log_path
)
.
st_ctime
)
now_time
=
int
(
time
.
time
())
if
now_time
-
file_time
>
1
80
00
:
if
now_time
-
file_time
>
1
08
00
:
if
psutil
.
pid_exists
(
pid
):
kill_pid
(
pid
)
set_finish
(
pid_id
)
...
...
@@ -77,7 +77,29 @@ def run():
except
OSError
:
pass
#function erorcheck is added by Lin to resolve CPU filled issue 2015.08.24
def
errorcheck
():
f
=
os
.
popen
(
"ps auxr | grep -v auxr|sed -n 2p"
)
a
=
f
.
read
()
.
strip
()
f
.
close
()
pid
=
0
try
:
if
a
is
not
None
:
b
=
a
.
split
(
" "
)
if
b
[
-
1
]
==
'/opt/jumpserver/connect.py'
and
b
[
-
2
]
==
'python'
and
b
[
-
8
]
==
'R'
and
int
(
b
[
-
3
]
.
split
(
':'
)[
0
])
>
100
:
for
i
,
j
in
enumerate
(
b
):
if
i
==
0
or
j
==
''
:
continue
else
:
pid
=
int
(
j
)
break
kill_pid
(
pid
)
except
:
pass
if
__name__
==
'__main__'
:
while
True
:
run
()
time
.
sleep
(
5
)
errorcheck
()
This diff is collapsed.
Click to expand it.
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