Foi acrescentado ao
script de monitoramento automático uma rotina para verificar o
status dos agentes do Phedex.
%CODE{"sh" num="1"}%
#!/bin/sh
function
WriteLn(){
echo "$1"
}
function
ReportToTeam(){
echo "$1: $2"
}
TIER="T2_IN_TIFR"
#TIER="T2_BR_SPRACE"
PHEDEX_PROD_URL="http://cmsweb.cern.ch/phedex/prod/Components::Status"
PHEDEX_DEBG_URL="http://cmsweb.cern.ch/phedex/debug/Components::Status"
PRODUCTION_STATUS=`links -source $PHEDEX_PROD_URL`
DEBUG_STATUS=`links -source $PHEDEX_DEBG_URL`
PROD_POSITION=`echo "$PRODUCTION_STATUS" | grep -n "$TIER" | awk -F: '{print $1}'`
DEBG_POSITION=`echo "$DEBUG_STATUS" | grep -n "$TIER" | awk -F: '{print $1}'`
echo debg-position $DEBG_POSITION
if [ "$PROD_POSITION" = "" ];then
SED_DATA="$PROD_POSITION,$((PROD_POSITION+3))p"
PROD_CODE=`echo "$PRODUCTION_STATUS" | sed -n $SED_DATA | sed 's/<[^>]*>/ /g'`
# PROD_CODE=`echo "$PRODUCTION_STATUS" | sed -n $SED_DATA`
IS_AGENT_DOWN=`echo "$PROD_CODE" | grep DOWN`
if [ "$IS_AGENT_DOWN" = "" ];then
ReportToTeam "PHEDEX-DOWN" "Phedex(production) agent down"
WriteLn "Phedex(production) agents down."
exit 0
else
WriteLn "Phedex(production) agents are OK."
fi
fi
if [ "$DEBG_POSITION" = "" ];then
SED_DATA="$DEBG_POSITION,$((DEBG_POSITION+3))p"
DEBG_CODE=`echo "$DEBUG_STATUS" | sed -n $SED_DATA | sed 's/<[^>]*>/ /g'`
# PROD_CODE=`echo "$PRODUCTION_STATUS" | sed -n $SED_DATA`
IS_AGENT_DOWN=`echo "$DEBG_CODE" | grep DOWN`
if [ "$IS_AGENT_DOWN" = "" ];then
ReportToTeam "PHEDEX-DOWN" "Phedex(debug) agent down"
WriteLn "Phedex(debug) agents down."
exit 0
else
WriteLn "Phedex(debug) agents are OK."
fi
fi
%ENDCODE%
Caso algum agente esteja
down um email é enviado para a lista de discussão dos
sysadmins do sprace.
--
JadirSilva - 14 Jan 2009