[Linux-HA] Whats the Score!

justin.kinney at academy.com justin.kinney at academy.com
Fri Oct 26 09:53:39 MDT 2007


> Hi,
> New to Linux-HA and would like to know if its possible to display 
> the total node scores for a given resource. So you can understand at
> the time of the snapshot what scores the engine is using in its 
decisions.

> Thanks
> Kevin Tomlinson

> Version: 2.1.2

> _______________________________________________
> 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

I found the script below when searching the archives:

#!/bin/bash
echo -e Resource\\tNode\\tScore\\t[target_role]
2>&1 ptest -LVVVVVVV|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|grep -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-


Hope this helps,
Justin


More information about the Linux-HA mailing list