Skip to content

Commit

Permalink
Updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesletts committed May 4, 2014
1 parent c0e2c73 commit 35f93a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
18 changes: 16 additions & 2 deletions condor_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,30 @@ condor_history_dump() {
condor_exit_codes() {
# Function to extract the possible matching CMSSW error codes given the %256
# ExitCode from HTCondor. The CMSSW exit codes can be found in the $URL but
# it is not publically visible yet.
# it is not publically visible yet. Later you can download periodically to
# the release directory.
#
# Usage:
# condor_error_codes $CONDOR_EXIT_CODE
# Output:
# CMSSW exit code matches and text explanations.
#
CONDOR_EXIT_CODE=$1
URL=https://twiki.cern.ch/twiki/bin/viewauth/CMS/JobExitCodes
#
# Exit code explanation file, check its age and download a new one if too old:
#
FILE=$glideinWMSMonitor_RELEASE_DIR/JobExitCodes.html
NOW=`/bin/date +%s`
FILE_created=`date -r $FILE +%s`
age_of_FILE=`echo $NOW $FILE_created | awk '{print int(($1-$2)/86400.)}'`
if [ $age_of_FILE -gt 30 ] ; then
URL=https://twiki.cern.ch/twiki/bin/viewauth/CMS/JobExitCodes
echo "Please update $FILE from $URL !"
# wget -o $FILE $URL
fi
#
# grep the explanation of a particular code(s).
#
grep \- $FILE | grep -o [0-9]*\ \-\ .* | sed 's/<.*>//g' \
| awk -F\- -v code=$CONDOR_EXIT_CODE '(code==$1%256){print $0}'
return 0
Expand Down
4 changes: 2 additions & 2 deletions debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export TZ=UTC0
echo
echo "====================================== BEGIN DEBUG ======================================="
echo
echo $FILE
echo HISTORY FILE: $FILE
echo
printf "%-35s %8s %-35s\n" "schedd Name" "Jobs" "Earliest Entry Time"
printf "%-35s %8s %-35s\n" "schedd Name" "#Jobs" "Earliest Entry Time"
SCHEDDS=`condor_status -schedd -format '%s\n' Name`
for SCHEDD in $SCHEDDS ; do
n=` cat $FILE | grep $SCHEDD\# | wc -l`
Expand Down

0 comments on commit 35f93a9

Please sign in to comment.