diff --git a/glusterhealth/reports/process_status.sh b/glusterhealth/reports/process_status.sh index 72dbc37..0099990 100755 --- a/glusterhealth/reports/process_status.sh +++ b/glusterhealth/reports/process_status.sh @@ -2,16 +2,11 @@ good=80 -pid=`gluster v status test | awk '/Self-heal/ {print $NF}'` -value=`ps -p $pid -o %cpu | grep -v CPU` | cut -d'.' -f1 +pid=`gluster v status| grep localhost|awk '/Self-heal/ {print $NF}'|uniq` +value=`ps -p $pid -o %cpu | grep -v CPU | cut -d'.' -f1` echo $value if (( $(echo "$value $good" | awk '{print ($1 > $2)}') )) then echo "High CPU usage by Self-heal $value" fi - - - - -