mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-13 06:34:42 +00:00
Update connect.py
修复 remote ip抓取问题
This commit is contained in:
parent
b7bf6b4cc0
commit
e24003df97
@ -90,8 +90,7 @@ def log_record(username, host):
|
|||||||
log_file_path = os.path.join(today_connect_log_dir, log_filename)
|
log_file_path = os.path.join(today_connect_log_dir, log_filename)
|
||||||
dept_name = User.objects.get(username=username).dept.name
|
dept_name = User.objects.get(username=username).dept.name
|
||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
pts = os.popen("ps axu | awk '$2==%s{ print $7 }'" % pid).read().strip()
|
ip_list = os.popen("who -m | awk '{ print $5 }'").read().strip('()\n')
|
||||||
ip_list = os.popen("who | awk '$2==\"%s\"{ print $5 }'" % pts).read().strip('()\n')
|
|
||||||
|
|
||||||
if not os.path.isdir(today_connect_log_dir):
|
if not os.path.isdir(today_connect_log_dir):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user