From 9d2660704474ec0367e9c874d49f21e128907936 Mon Sep 17 00:00:00 2001 From: Chethan Jain Date: Tue, 26 Oct 2021 17:47:05 +0530 Subject: [PATCH] Update common_sls.py Fix for https://github.com/ppc64le/sls-tool/issues/60 --- common_sls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common_sls.py b/common_sls.py index f8c748f..4801279 100755 --- a/common_sls.py +++ b/common_sls.py @@ -1003,7 +1003,7 @@ def OOMKill(log, slog): command = "kill -9 %s" % (pid) RunCommand(command, log, 0) - command = "ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head|awk -F' ' '{print $1\":\"$2\" \"$3}'|tr '/' ' '|awk -F' ' '{print $1\" \"$NF}'|tr ':' ' ' | awk '{ print $3}' |grep -v CMD|tr '\n' '^'" + command = "ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head|awk -F' ' '{print $1\":\"$2\" \"$3}'|tr '/' ' '|awk -F' ' '{print $1\" \"$NF}'|tr ':' ' ' | awk '{ print $3}' |grep -vE \"CMD|sshd|ssh\"|tr '\n' '^'" output = RunCommand(command, log, 2, 0) ship = output.split('^') ship = [i for i in ship if i] @@ -1011,7 +1011,7 @@ def OOMKill(log, slog): boat = boat.replace('[','').replace(']','') if boat == 'sh': continue - command = "grep -w %s /opt/ltp/runtest/*|grep -v 'grep'|wc -l" % boat + command = "grep -w %s /opt/ltp/runtest/*|grep -vE \"grep|ssh|sshd\"|wc -l" % boat if int(RunCommand(command, log, 2, 0)) != 0: line = "Calling killall -I %s" % boat lg(slog, line, 0)