File pacemaker-HealthCPU-top-percent-sign.patch of Package pacemaker.3577

commit e8b884997f2d49871c6a19b36095a66e377f54e4
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Thu Dec 3 15:29:14 2015 -0600

    Fix: resources: allow for top output with or without percent sign in HealthCPU
    
    Problem found and patch provided by Malcome Cowe <malcolm.j.cowe@intel.com>.

diff --git a/extra/resources/HealthCPU b/extra/resources/HealthCPU
index d320320..1ceaa01 100644
--- a/extra/resources/HealthCPU
+++ b/extra/resources/HealthCPU
@@ -136,7 +136,7 @@ dummy_monitor() {
 	
 	if [ -f ${OCF_RESKEY_state} ]; then
 
-	  IDLE=`top -b -n2 | grep Cpu | tail -1 | awk -F",|\.[0-9]%id" '{ print $4 }'`
+	  IDLE=`top -b -n2 | grep Cpu | tail -1 | awk -F",|.[0-9][ %]id" '{ print $4 }'`
 	  # echo "System idle: " $IDLE
 	  # echo "$OCF_RESKEY_red_limit"
 	  # echo $OCF_RESKEY_yellow_limit
openSUSE Build Service is sponsored by