[Linux-HA] Whats the Score!

ktomlinson at scarpgold.co.uk ktomlinson at scarpgold.co.uk
Mon Oct 29 08:29:37 MDT 2007


Here is the code. I commented out the targetrole from the cibadmin. 

#!/bin/bash
PTESTTMP=/tmp/ptest.out

ptest -LVVVVVVV > ${PTESTTMP} 2>&1
echo -e Resource\\tNode\\tScore\\t[target_role]
cat ${PTESTTMP} |grep -E "assign_node|rsc_location" |grep -w -E "[-]{0,1}[0-9]*$"|while read line
do
       node=`echo $line|cut -d ' ' -f 8|cut -d ':' -f 1`
       res=`echo $line|cut -d ' ' -f 6|tr -d ","`
       score=`echo $line|cut -d ' ' -f 9`
       #targetrole=`cibadmin -Q|grep $res|grep target_role|grep -o -E 'value=".*"'|cut -d '"' -f 2|gre
p -i stopped`
       #if [ "$targetrole" = "stopped" ]
       #then
       #        echo zScore of -1000000 is intentional when target_role=\"stopped\"
       #fi
       echo -e a$res\\t$node\\t$score\\t$targetrole
done|sort -k 1|uniq|cut -b 2-


matilda at grandel.de wrote:
> >>> <ktomlinson at scarpgold.co.uk> 29.10.2007 14:24 >>>
> > Got the script outputing but still very confusing to a newbie.
> 
> > sh /tmp/score_status
> 
> 
> Hi,
> 
> can you send this script as a mail attachment?
> 
> Thank you in advance
> Andreas Mock
> 
> 
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
> 




More information about the Linux-HA mailing list