| Server IP : 112.74.42.100 / Your IP : 216.73.216.142 Web Server : nginx/1.20.2 System : Linux iZwz96lx4pjqiy84w4hni7Z 5.10.134-17.3.al8.x86_64 #1 SMP Thu Oct 31 14:29:57 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/sysak/.sysak_components/tools/ossre_set/rules/ |
Upload File : |
# -*- coding: utf-8 -*-
# @Author: lichen
import os
import sys
import time
import subprocess
import re
import json
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append("%s/../"%(os.path.dirname(os.path.abspath(__file__))))
import collect_data
import crash
import utils
if sys.version[0] == '2':
reload(sys)
sys.setdefaultencoding('utf8')
# Return one line to indentify this issue, this description will be
# displayed as a title for user to match the issue.
# Like "3.10: io hang in nvme盘"
def get_description():
return '[systemd]systemd内存泄漏'
# Return some keywords of this issue, these keywords will be queried based on user's input
# Like ["IO hang", "nvme", "3.10", "io util 100%", "hung task", "大量D任务", "load高"]
def get_issue_keywords():
return ['systemd','systemd 内存泄漏']
# Return some input hints of this issue
# Like ["hung task", "io util 100%", "大量D任务", "load高","IO hang"]
def get_input_hints():
return ''
# Return some categories of this issue, these categories will be used by ossre.
# Available categories: ['HIGHSYS','HIGHLOAD','HANG','MEMLEAK','DEADLOCK','SOFTLOCKUP','CONFIG'
# 'HUNGTASK','RCUSTALL','DATA_CORRUPTION','RESOURCE_LEAK','REFERENCE_LEAK','NET_DROP'...]
def get_category():
return ['MEMLEAK']
def query(sn, data):
ret = utils.get_script_result(sn,data)
if ret:
return ret
ret = {}
ret['return'] = False
ret['solution'] = "Not match"
# Check memory leakage
vmrss = collect_data.get_cmddata(sn, data, "cat /proc/1/status | grep VmRSS | awk '{print $2}'")
try:
vmrss = int(vmrss)
if vmrss > 2000000:
ret['return'] = True
ret['solution'] = utils.format_result(desc=(
"systemd used more than 2G memory, it may have memory leak."),
solution=("Please upgrade systemd to latest version,\n"
" you can run 'sudo systemctl daemon-reexec' as a temp workaround."))
except:
pass
utils.cache_script_result(sn,data,ret)
print( __name__,':',ret)
return ret
def main():
sn = ''
data = {}
ret = query(sn, data)
if ret['return']:
result = {os.path.basename(__file__)[:-3]:ret['solution']}
utils.post_ossre_diag(json.dumps(result,ensure_ascii=False))
if __name__ == "__main__":
main()