Updated with suggestions
This commit is contained in:
parent
cc21cc6acc
commit
009a4aabe0
|
@ -512,9 +512,17 @@ function _HandleLocksRemote {
|
|||
|
||||
CheckConnectivity3rdPartyHosts
|
||||
CheckConnectivityRemoteHost
|
||||
|
||||
# Check if -A exists on target
|
||||
ps -A > /dev/null 2>&1
|
||||
notExistaCapitalA=$?
|
||||
|
||||
# Create an array of all currently running pids
|
||||
read -a initiatorRunningPids <<< $(ps -a | tail -n +2 | awk '{print $1}')
|
||||
if [ "$notExistaCapitalA" == "1"]; then
|
||||
read -a initiatorRunningPids <<< $(ps -e | tail -n +2 | awk '{print $1}')
|
||||
else
|
||||
read -a initiatorRunningPids <<< $(ps -A | tail -n +2 | awk '{print $1}')
|
||||
fi
|
||||
|
||||
# passing initiatorRunningPids as litteral string (has to be run through eval to be an array again)
|
||||
$SSH_CMD env _REMOTE_TOKEN="$_REMOTE_TOKEN" \
|
||||
|
|
|
@ -767,7 +767,7 @@ function _PerfProfiler { #__WITH_PARANOIA_DEBUG
|
|||
perfString=$(ps -p $$ -o args,pid,ppid,%cpu,%mem,time,etime,state,wchan) #__WITH_PARANOIA_DEBUG
|
||||
#__WITH_PARANOIA_DEBUG
|
||||
for i in $(pgrep -P $$); do #__WITH_PARANOIA_DEBUG
|
||||
perfString="$perfString\n"$(ps -p $i -o args,pid,ppid,%cpu,%mem,time,etime,state,wchan | tail -1) #__WITH_PARANOIA_DEBUG
|
||||
perfString="$perfString\n"$(ps -p $i -o args,pid,ppid,%cpu,%mem,time,etime,state,wchan | :| tail -1) #__WITH_PARANOIA_DEBUG
|
||||
done #__WITH_PARANOIA_DEBUG
|
||||
#__WITH_PARANOIA_DEBUG
|
||||
if type iostat > /dev/null 2>&1; then #__WITH_PARANOIA_DEBUG
|
||||
|
|
Loading…
Reference in New Issue