From 0bbbffbd387609bc1519bbb5ad16b23e6dd1d67f Mon Sep 17 00:00:00 2001 From: Hui Xiang Date: Fri, 19 Dec 2014 19:08:16 +0800 Subject: [PATCH] fix scripts. --- files/monitor_neutron_ha.sh | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/files/monitor_neutron_ha.sh b/files/monitor_neutron_ha.sh index 73d7bec9..a208cddc 100755 --- a/files/monitor_neutron_ha.sh +++ b/files/monitor_neutron_ha.sh @@ -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 -