Commit b134f0e3 authored by Edita Kizinevic's avatar Edita Kizinevic
Browse files

Merge branch 'master' into 'master'

Check failover list

See merge request !15
parents 340a9859 9cba8cb8
......@@ -2,7 +2,7 @@
shopt -s expand_aliases
SCRIPT_REVISION="2019-08-26, Dave Dykstra and Edita Kizinevic"
SCRIPT_REVISION="2019-09-18, 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,22 @@ 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 -O $site_summary_file $url
if [ -f "$site_summary_file" ] ; then
result="`grep -P "$site[, \t]" $site_summary_file`"
if [ ! -z "$result" ] ; 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 +180,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 the site have connected directly to the Frontier servers or backup proxies, with a high rate of queries not going through the local squid(s):\n'$result
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
Supports Markdown
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