Skip to content

Commit 10783f2

Browse files
전원 절체 스크립트 HA랑 구분 지어 변경
1 parent 36bb175 commit 10783f2

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

python/gfs/gfs_alert_manage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# 4월 이후로 해당 코드 사용하지 않음. alert_file.sh 로 전원 절체 진행중
2+
13
import json
24
import os
35
import re

shell/host/alert_file.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ case $CRM_alert_kind in
8383
# CRM_alert_rc
8484
#
8585
echo "${tstamp}Fencing ${CRM_alert_desc}" >> "${CRM_alert_recipient}"
86+
if [[ "$CRM_alert_desc" == *"Error"* ]]; then
87+
sleep 7
88+
hostname=$(grep -w $CRM_alert_node /etc/hosts | awk '{print $2}')
89+
90+
echo "${tstamp}Confirming stonith for $CRM_alert_node" >> "${CRM_alert_recipient}"
91+
pcs stonith confirm "$CRM_alert_node" --force >> "${CRM_alert_recipient}"
92+
93+
echo "${tstamp}Disabling fence-$hostname" >> "${CRM_alert_recipient}"
94+
pcs stonith disable "fence-$hostname" >> "${CRM_alert_recipient}"
95+
96+
echo "${tstamp}Executing stonith for $CRM_alert_node ($hostname)" >> "${CRM_alert_recipient}"
97+
fi
8698
;;
8799
resource)
88100
# Other keys:
@@ -121,17 +133,17 @@ case $CRM_alert_kind in
121133
;;
122134
esac
123135

124-
case $CRM_alert_desc in
125-
lost)
126-
sleep 7
127-
hostname=$(grep -w $CRM_alert_node /etc/hosts | awk '{print $2}')
136+
# case $CRM_alert_desc in
137+
# lost)
138+
# sleep 7
139+
# hostname=$(grep -w $CRM_alert_node /etc/hosts | awk '{print $2}')
128140

129-
echo "${tstamp}Confirming stonith for $CRM_alert_node" >> "${CRM_alert_recipient}"
130-
pcs stonith confirm "$CRM_alert_node" --force >> "${CRM_alert_recipient}"
141+
# echo "${tstamp}Confirming stonith for $CRM_alert_node" >> "${CRM_alert_recipient}"
142+
# pcs stonith confirm "$CRM_alert_node" --force >> "${CRM_alert_recipient}"
131143

132-
echo "${tstamp}Disabling fence-$hostname" >> "${CRM_alert_recipient}"
133-
pcs stonith disable "fence-$hostname" >> "${CRM_alert_recipient}"
144+
# echo "${tstamp}Disabling fence-$hostname" >> "${CRM_alert_recipient}"
145+
# pcs stonith disable "fence-$hostname" >> "${CRM_alert_recipient}"
134146

135-
echo "${tstamp}Executing stonith for $CRM_alert_node ($hostname)" >> "${CRM_alert_recipient}"
136-
;;
137-
esac
147+
# echo "${tstamp}Executing stonith for $CRM_alert_node ($hostname)" >> "${CRM_alert_recipient}"
148+
# ;;
149+
# esac

0 commit comments

Comments
 (0)