fix scripts.

This commit is contained in:
Hui Xiang 2014-12-19 19:08:16 +08:00
parent 0850089b94
commit 0bbbffbd38

View File

@ -28,26 +28,25 @@ if [[ $CRM_notify_node == $hostname ]]; then
logger "CRM_notify_task: $CRM_notify_task, CRM_notify_desc: $CRM_notify_desc"
logger "CRM_notify_rsc: $CRM_notify_rsc, CRM_notify_node: $CRM_notify_node"
logger " ******************************************************************* "
fi
if [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'start' && \
$CRM_notify_node == $hostname ]]; then
if [[ ${CRM_notify_desc} == 'OK' || ${CRM_notify_desc} == 'ok' ]]; then
check_pid
if [ $? -ne 0 ]; then
logger "Executing monitor to reschedule Neutron agents..."
sudo python /usr/local/bin/monitor.py --config-file /tmp/monitor.conf \
--log-file /tmp/monitor.log >> /dev/null 2>&1 & echo $!
sleep 3
if [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'start' && \
$CRM_notify_node == $hostname ]]; then
if [[ ${CRM_notify_desc} == 'OK' || ${CRM_notify_desc} == 'ok' ]]; then
check_pid
if [ $? -ne 0 ]; then
logger "Executing monitor to reschedule Neutron agents..."
sudo python /usr/local/bin/monitor.py --config-file /tmp/monitor.conf \
--log-file /tmp/monitor.log >> /dev/null 2>&1 & echo $!
sleep 3
fi
fi
elif [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'stop' ]]; then
if [[ ${CRM_notify_desc} == 'OK' || ${CRM_notify_desc} == 'ok' ]]; then
clean_pid
fi
elif [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'monitor' ]]; then
if [[ ${CRM_notify_desc} == 'unknown error' ]]; then
logger "TODO"
fi
fi
elif [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'stop' ]]; then
if [[ ${CRM_notify_desc} == 'OK' || ${CRM_notify_desc} == 'ok' ]]; then
clean_pid
fi
elif [[ $CRM_notify_rsc == 'res_PingCheck' && ${CRM_notify_task} == 'monitor' ]]; then
if [[ ${CRM_notify_desc} == 'unknown error' ]]; then
logger "TODO"
fi
fi