diff --git a/source/tools/combine/ossre_client/ossre_set/tools/cgroupcheck.py b/source/tools/combine/ossre_client/ossre_set/tools/cgroupcheck.py index 2b9d00df6621543244062b58cce175ca82593374..6b843e4874fac8402b712dda0b38c6cc85d45855 100644 --- a/source/tools/combine/ossre_client/ossre_set/tools/cgroupcheck.py +++ b/source/tools/combine/ossre_client/ossre_set/tools/cgroupcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # @Author: shiyan diff --git a/source/tools/combine/ossre_client/ossre_set/tools/newoomcheck.py b/source/tools/combine/ossre_client/ossre_set/tools/newoomcheck.py index 0eb3e383ff74086dd10b02277f60f5243790a135..df53fa5f68644e42ab13e5bb5c1a2dfd1ebd7943 100644 --- a/source/tools/combine/ossre_client/ossre_set/tools/newoomcheck.py +++ b/source/tools/combine/ossre_client/ossre_set/tools/newoomcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # @Author: changjun diff --git a/source/tools/combine/ossre_client/ossre_set/tools/oomcheck.py b/source/tools/combine/ossre_client/ossre_set/tools/oomcheck.py index 9dd57610af05ac57fe1f476f190cc3a942fb39a2..3c0b3aabb6acb8b32391b79e06261698ac97ae02 100644 --- a/source/tools/combine/ossre_client/ossre_set/tools/oomcheck.py +++ b/source/tools/combine/ossre_client/ossre_set/tools/oomcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # @Author: shiyan diff --git a/source/tools/detect/cgtool/cgcheck/cgcheck.py b/source/tools/detect/cgtool/cgcheck/cgcheck.py index 8ca41d6bbe5d4e4f225ee225e85ce35d20322141..06c562970a7f405cb03f732c508768ce0e67940f 100755 --- a/source/tools/detect/cgtool/cgcheck/cgcheck.py +++ b/source/tools/detect/cgtool/cgcheck/cgcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # @Author: shiyan diff --git a/source/tools/detect/sysconf/confcheck/confcheck.py b/source/tools/detect/sysconf/confcheck/confcheck.py old mode 100755 new mode 100644 index 24bd132310208d14d0635fea1c11c1f661103793..1d24a1203958f63b3cef944a77a95c5e5ae3461d --- a/source/tools/detect/sysconf/confcheck/confcheck.py +++ b/source/tools/detect/sysconf/confcheck/confcheck.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 #coding:utf-8 import re @@ -21,6 +21,8 @@ pagecache_bk_dirty_bytes = "/proc/sys/vm/dirty_background_bytes" pagecache_bk_dirty_ratio = "/proc/sys/vm/dirty_background_ratio" meminfo = "/proc/meminfo" +syslog_conf_dir = "/etc/syslog-ng" + def exectue_cmd(command): command=command.replace("\n", "") command_fd = os.popen(command, "r") @@ -90,6 +92,11 @@ def check_etc_config(): if dict_paraments[parament] == match_parament.group(1): print("kernel.unprivileged_bpf_disabled应该配置成1") alinux3_etc_fd.close() + + syslog_conf_cmd = 'grep "/var/log/messages" -rn /etc/syslog-ng |wc -l' + syslog_conf_num = exectue_cmd(syslog_conf_cmd) + if syslog_conf_num.strip('\n') != "1": + print("syslog重复配置/var/log/messages,可能导致重复打印日志!") return def check_file_config(): @@ -119,4 +126,4 @@ def main(): check_pagecache_config() if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/source/tools/monitor/mmaptrace/mmaptrace.py b/source/tools/monitor/mmaptrace/mmaptrace.py index a2241e27063a17eab36727135553075ec67e6049..1e4506925e786938784a2d2e85a091142cd94b96 100644 --- a/source/tools/monitor/mmaptrace/mmaptrace.py +++ b/source/tools/monitor/mmaptrace/mmaptrace.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 #coding:utf-8 import re diff --git a/source/tools/monitor/sched/schedtrace/schedtrace.py b/source/tools/monitor/sched/schedtrace/schedtrace.py index e4c583fb869b9b5ac4cf142551aece4c184ce79c..de1ae812f34c884d65035e824ba49af066b76f61 100755 --- a/source/tools/monitor/sched/schedtrace/schedtrace.py +++ b/source/tools/monitor/sched/schedtrace/schedtrace.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # -*- coding: UTF-8 -*- import sys,os