Skip to content

Commit

Permalink
Updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesletts committed Apr 30, 2014
1 parent 483e94f commit f949a7f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
1 change: 0 additions & 1 deletion bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export glideinWMSMonitor_OUTPUT_DIR="/crabprod/CSstoragePath/Monitor"

# Discover the directory where the software sits:
export glideinWMSMonitor_RELEASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $glideinWMSMonitor_RELEASE_DIR

# source the functions to discover SiteDB, HTCondor and CMS Dashboard information
source $glideinWMSMonitor_RELEASE_DIR/sitedb_functions.sh
Expand Down
24 changes: 14 additions & 10 deletions condor_check.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
#!/bin/bash

if [ -z $glideinWMSMonitor_RELEASE_DIR ] ; then
echo "ERROR: glideinWMSMonitor source code missing."
exit 1
else
source $glideinWMSMonitor_RELEASE_DIR/bashrc
fi


# put a time limit on a command
alarm() { perl -e 'alarm shift; exec @ARGV' "$@"; }

# location of the output file
OUTLOCATION=/crabprod/CSstoragePath/Monitor
OUTFILE=$OUTLOCATION/monitor-anaops-`/bin/date +%F-Z%R -u`.txt

OUTFILE=$glideinWMSMonitor_OUTPUT_DIR/monitor-anaops-`/bin/date +%F-Z%R -u`.txt

cat >> $OUTFILE <<EOF
======================================================= ANAOPS POOL =======================================================
EOF
# run analysis of analysis ops pool, with a time limit of 300s.
alarm 300 /home/letts/scripts/condor_check glidein-collector-2.t2.ucsd.edu >> $OUTFILE
alarm 300 $glideinWMSMonitor_RELEASE_DIR/condor_check glidein-collector-2.t2.ucsd.edu >> $OUTFILE
rc=$?



cat >> $OUTFILE <<EOF
======================================================= GLOBAL POOL =======================================================
EOF
# run analysis of global pool, with a time limit of 300s.
alarm 300 /home/letts/scripts/condor_check vocms097.cern.ch short >> $OUTFILE
alarm 300 $glideinWMSMonitor_RELEASE_DIR/condor_check vocms097.cern.ch short >> $OUTFILE

cat >> $OUTFILE <<EOF
===================================================== PRODUCTION POOL =====================================================
EOF
alarm 300 /home/letts/scripts/condor_check vocms97.cern.ch short >> $OUTFILE

alarm 300 $glideinWMSMonitor_RELEASE_DIR/condor_check vocms97.cern.ch short >> $OUTFILE

# if everything ran correctly, then update the latest file:
if [ $rc -eq 0 ] ; then
LINKNAME=$OUTLOCATION/latest.txt
LINKNAME=$glideinWMSMonitor_OUTPUT_DIR/latest.txt
rm $LINKNAME
ln -s $OUTFILE $LINKNAME
fi
Expand Down
3 changes: 2 additions & 1 deletion condor_history_analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ POOLNAME=$1
if [ -z $glideinWMSMonitor_RELEASE_DIR ] ; then
echo "ERROR: glideinWMSMonitor source code missing."
exit 1
else
source $glideinWMSMonitor_RELEASE_DIR/bashrc
fi

# get the latest dumped history file from the web server:
FILE=$glideinWMSMonitor_OUTPUT_DIR/`ls -1rt /crabprod/CSstoragePath/Monitor \
| grep ^monitor-anaops-history | grep \.txt$ | tail -1`
FILE=$glideinWMSMonitor_OUTPUT_DIR/monitor-anaops-history-2014-04-29-Z18:59.txt
NOW=`ls -l --time-style=+%s $FILE | awk '{print $6}'`

cat <<EOF
Expand Down
7 changes: 7 additions & 0 deletions condor_history_dump.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash

if [ -z $glideinWMSMonitor_RELEASE_DIR ] ; then
echo "ERROR: glideinWMSMonitor source code missing."
exit 1
else
source $glideinWMSMonitor_RELEASE_DIR/bashrc
fi

POOLNAME="glidein-collector-2.t2.ucsd.edu"

OUTFILE=$glideinWMSMonitor_OUTPUT_DIR/monitor-anaops-history-`/bin/date +%F-Z%R -u`.txt
Expand Down

0 comments on commit f949a7f

Please sign in to comment.