• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revision1a3454fa87fd5605c24ec3de0ec7db5c2aae3a0b (tree)
Time2008-04-23 17:57:18
Author <root@dkte...>

Log Message

Contrib: showscores

Change Summary

Incremental Difference

diff -r 309aba03baf5 -r 1a3454fa87fd contrib/showscores.sh
--- a/contrib/showscores.sh Wed Apr 23 11:16:18 2008 +0200
+++ b/contrib/showscores.sh Wed Apr 23 10:57:18 2008 +0200
@@ -1,6 +1,6 @@
11 #!/bin/bash
22
3-# Mar 2008, Dominik Klein
3+# Apr 2008, Dominik Klein
44 # Display scores of Linux-HA resources
55
66 # Known issues:
@@ -8,6 +8,9 @@
88 # if those values are configured as meta attributes of the master/slave or clone resource
99 # instead of as meta attributes of the encapsulated primitive
1010
11+tmpfile=/tmp/dkshowscorestmpfiledk
12+tmpfile2=/tmp/dkshowscorestmpfile2dk
13+
1114 if [ `crmadmin -D | cut -d' ' -f4` != `uname -n|tr "[:upper:]" "[:lower:]"` ]
1215 then echo "Warning: Script is not running on DC. This will be slow."
1316 fi
@@ -18,15 +21,18 @@
1821 export default_stickiness=`cibadmin -Q -o crm_config 2>/dev/null|grep "default[_-]resource[_-]stickiness"|grep -o -E 'value ?= ?"[^ ]*"'|cut -d '"' -f 2|grep -v "^$"`
1922 export default_failurestickiness=`cibadmin -Q -o crm_config 2>/dev/null|grep "resource[_-]failure[_-]stickiness"|grep -o -E 'value ?= ?"[^ ]*"'|cut -d '"' -f 2|grep -v "^$"`
2023
21-# Heading
22-printf "%-20s%-10s%-16s%-11s%-9s%-16s\n" "Resource" "Score" "Node" "Stickiness" "#Fail" "Fail-Stickiness"
2324
24-2>&1 ptest -LVs | grep -v group | while read line
25-do
26- node=`echo $line|cut -d "=" -f 1|sed 's/ *$//g'|grep -o -E "[^\ ]*$"|grep -o "[^\.]*$"|sed 's/\.$//'`
27- res=`echo $line|cut -d "=" -f 1|sed 's/ *$//g'|grep -o -E "[^\ ]*$"|grep -o "^.*\."|sed 's/\.$//'`
28- score=`echo $line|grep -o -E "[-0-9]*$"|sed 's/1000000/INFINITY/g'`
25+2>&1 ptest -LVs | grep -v group | sed 's/dump_node_scores\:\ //' > $tmpfile
2926
27+parseline() {
28+ line="$1"
29+ node=`echo $line|cut -d " " -f 9|sed 's/://'`
30+ res=`echo $line|cut -d " " -f 5`
31+ score=`echo $line|cut -d " " -f 10`
32+}
33+
34+get_stickiness() {
35+ res="$1"
3036 # get meta attribute resource_stickiness
3137 if ! stickiness=`crm_resource -g resource_stickiness -r $res --meta 2>/dev/null`
3238 then
@@ -44,17 +50,47 @@
4450 # if that doesnt exist, use the default value
4551 failurestickiness="$default_failurestickiness"
4652 fi
53+}
4754
48- failcount=`crm_failcount -G -r $res -U $node 2>/dev/null|grep -o -E 'value ?= ?INFINITY|value ?= ?[0-9]*'|cut -d '=' -f 2|grep -v "^$"`
55+get_failcount() {
56+ res="$1"
57+ node="$2"
58+ failcount=`crm_failcount -G -r $res -U $node 2>/dev/null|grep -o -E 'value ?= ?INFINITY|value ?= ?[0-9]*'|cut -d '=' -f 2|grep -v "^$"`
59+}
4960
50- if echo $line | grep -q clone_color
61+# display allocation scores
62+grep -v master_color $tmpfile | grep -v clone_color | while read line
63+do
64+ unset node res score stickiness failcount failurestickiness
65+ parseline "$line"
66+ get_stickiness $res
67+ get_failcount $res $node
68+ printf "%-20s%-10s%-16s%-11s%-9s%-16s\n" $res $score $node $stickiness $failcount $failurestickiness
69+done >> $tmpfile2
70+
71+# display promotion scores
72+grep master_color $tmpfile | while read line
73+do
74+ unset node res score stickiness failcount failurestickiness
75+ parseline "$line"
76+ inflines=`grep master_color $tmpfile | grep $res | grep 1000000 | wc -l`
77+ if [ $inflines -eq 1 ]
5178 then
52- res=$res"_(master)"
53- else if echo $res | grep -q -E ':[0-9]{1,2}'
54- then
55- res=$res"_(clone)"
56- fi
79+ # [10:24] <beekhof> the non INFINITY values are the true ones
80+ # [10:25] <kleind> except for when the actually resulting score is [-]INFINITY
81+ # [10:25] <beekhof> yeah
82+ actualline=`grep master_color $tmpfile | grep $res | grep -v 1000000`
83+ parseline "$actualline"
5784 fi
85+ get_stickiness $res
86+ get_failcount $res $node
87+ res=$res"_(master)"
88+ printf "%-20s%-10s%-16s%-11s%-9s%-16s\n" $res $score $node $stickiness $failcount $failurestickiness
89+done | sort | uniq >> $tmpfile2
5890
59- printf "%-20s%-10s%-16s%-11s%-9s%-16s\n" $res $score $node $stickiness $failcount $failurestickiness
60-done|sort -k $sortby
91+# Heading
92+printf "%-20s%-10s%-16s%-11s%-9s%-16s\n" "Resource" "Score" "Node" "Stickiness" "#Fail" "Fail-Stickiness"
93+
94+sort -k $sortby $tmpfile2
95+
96+rm $tmpfile $tmpfile2
Show on old repository browser