Commit 8bbce896 authored by Edita Kizinevic's avatar Edita Kizinevic
Browse files

Check failover list

parent fc26e7a2
......@@ -2,7 +2,7 @@
shopt -s expand_aliases
SCRIPT_REVISION="2019-08-26, Dave Dykstra and Edita Kizinevic"
SCRIPT_REVISION="2019-09-17, Dave Dykstra and Edita Kizinevic"
# Source the CMS environment
if [ -n "$OSG_GRID" ] ; then
......@@ -70,6 +70,14 @@ fi
echo "script version: $SCRIPT_REVISION"
echo
# Get site name
site_local_config_file=${CMS_PATH}/SITECONF/local/JobConfig/site-local-config.xml
if [ ! -f "$site_local_config_file" ] ; then
echo "ERROR: file ${site_local_config_file} does not exist"
exit $SAME_ERROR
fi
site=`grep -oP '(?<=site name=").*(?=")' $site_local_config_file`
# Create Working Directory
mkdir squid
cd squid
......@@ -77,6 +85,21 @@ current=`pwd`
echo "Current directory is: ${current}"
echo
# Get information from failover monitor
failover=false
if [ ! -z "$site" ] ; then
site_summary_file=site_summary.txt
url=http://wlcg-squid-monitor.cern.ch/failover/failoverCMS/$site_summary_file
wget -q $url
if [ -f "$site_summary_file" ] ; then
if grep -q $site $site_summary_file ; then
failover=true
fi
else
echo "$site_summary_file file is not retrieved from $url"
fi
fi
# Set up CMSSW
echo "Set up CMSSW ... starting"
CMSREL="`scram l | grep -B 1 "cms.cern.ch" | grep " CMSSW" | tail -1 | awk '{print $2}'`"
......@@ -156,16 +179,33 @@ found_proxy=false
check_proxies "$FNCONNECT"
#Check test results
if [ "$ever_failed" == false ] && [ "$ever_succeeded" == true ]; then
echo "Proxy test is OK."
exit $SAME_OK
elif [ "$ever_failed" == true ] && [ "$ever_succeeded" == true ]; then
echo "At least one of proxies is FAILED."
exit $SAME_WARNING
elif [ "$found_proxy" == false ]; then
echo "No proxies are found."
exit $SAME_OK
if [ "$failover" == true ]; then
message="many database queries from your site have connected directly to the Frontier Server Groups, with a high rate of queries not going through your local squid(s)."
if [ "$ever_failed" == false ] && [ "$ever_succeeded" == true ]; then
echo "Proxy test is OK, however $message"
exit $SAME_WARNING
elif [ "$ever_failed" == true ] && [ "$ever_succeeded" == true ]; then
echo "At least one of proxies is FAILED and $message"
exit $SAME_WARNING
elif [ "$found_proxy" == false ]; then
echo "No proxies are found and $message"
exit $SAME_WARNING
else
echo "Proxy test is FAILED and $message"
exit $SAME_ERROR
fi
else
echo "Proxy test is FAILED."
exit $SAME_ERROR
if [ "$ever_failed" == false ] && [ "$ever_succeeded" == true ]; then
echo "Proxy test is OK."
exit $SAME_OK
elif [ "$ever_failed" == true ] && [ "$ever_succeeded" == true ]; then
echo "At least one of proxies is FAILED."
exit $SAME_WARNING
elif [ "$found_proxy" == false ]; then
echo "No proxies are found."
exit $SAME_OK
else
echo "Proxy test is FAILED."
exit $SAME_ERROR
fi
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment