This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12a1c8d
commit ba32d7a
Showing
38 changed files
with
295 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC1091 | ||
source /data/srv/wmagent/current/apps/wmagent/etc/profile.d/init.sh | ||
python2.6 /home/cmsdataops/storeResults/cronjobs/StoreResultsAddCMSSWReleases.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
echo "Executing $1 as cmst1..." | ||
sudo -u cmst1 /bin/bashs --init-file $1 | ||
sudo -u cmst1 /bin/bashs --init-file "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
BASE_DIR=/data/unified/WmAgentScripts/ | ||
# shellcheck disable=SC2034 | ||
HTML_DIR=/var/www/html/unified/ | ||
|
||
lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock | ||
source $BASE_DIR/cycle_common.sh $lock_name | ||
# shellcheck disable=SC1090,SC2128 | ||
lock_name=$(echo "$BASH_SOURCE" | cut -f 1 -d ".").lock | ||
# shellcheck disable=SC1090 | ||
source $BASE_DIR/cycle_common.sh "$lock_name" | ||
|
||
## get sso cookie and new grid proxy | ||
# shellcheck disable=SC1090 | ||
source $BASE_DIR/credentials.sh | ||
|
||
## submit ACDCs and clones from actions submitted via new recovery tools | ||
$BASE_DIR/cWrap.sh Unified/actor.py | ||
|
||
rm -f $lock_name | ||
rm -f "$lock_name" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,74 +7,78 @@ if [ ! -d $FINAL_HTML_DIR ] ; then | |
echo "Cannot read the log destination",$FINAL_HTML_DIR | ||
exit | ||
fi | ||
cd $BASE_DIR | ||
cd $BASE_DIR||exit | ||
|
||
modulename=`echo $1 | sed 's/\.py//' | sed 's/Unified\///'` | ||
mkdir -p $HTML_DIR/logs/$modulename/ | ||
mkdir -p $FINAL_HTML_DIR/logs/$modulename/ | ||
modulename=$(echo "$1" | sed 's/\.py//' | sed 's/Unified\///') | ||
mkdir -p $HTML_DIR/logs/"$modulename"/ | ||
mkdir -p $FINAL_HTML_DIR/logs/"$modulename"/ | ||
|
||
last_log=$HTML_DIR/logs/$modulename/last.log | ||
s_dated_log=$modulename/`date +%F_%T`.log | ||
s_dated_log=$modulename/$(date +%F_%T).log | ||
dated_log=$HTML_DIR/logs/$s_dated_log | ||
log=$dated_log | ||
|
||
echo `date` > $log | ||
echo $$ >> $log | ||
# shellcheck disable=SC2005 | ||
echo "$(date)" > "$log" | ||
echo $$ >> "$log" | ||
|
||
if [ -r unified_drain ] ; then | ||
echo "System is locally draining" >> $log | ||
cp $log $last_log | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/. | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/last.log | ||
echo "System is locally draining" >> "$log" | ||
cp "$log" "$last_log" | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/. | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/last.log | ||
exit | ||
fi | ||
if [ -r /eos/cms/store/unified/unified_drain ] ; then | ||
echo "System is globally draining" >> $log | ||
cp $log $last_log | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/. | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/last.log | ||
echo "System is globally draining" >> "$log" | ||
cp "$log" "$last_log" | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/. | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/last.log | ||
exit | ||
fi | ||
|
||
|
||
echo $USER >> $log | ||
echo $HOSTNAME >> $log | ||
echo module $modulename>> $log | ||
# shellcheck disable=SC2129 | ||
echo "$USER" >> "$log" | ||
echo "$HOSTNAME" >> "$log" | ||
echo module "$modulename">> "$log" | ||
|
||
source ./set.sh | ||
|
||
echo >> $log | ||
echo >> "$log" | ||
|
||
start=`date +%s` | ||
python ssi.py $modulename $start | ||
start=$(date +%s) | ||
python ssi.py "$modulename" "$start" | ||
|
||
python $* &>> $log | ||
python "$@" &>> "$log" | ||
|
||
# shellcheck disable=SC2181 | ||
if [ $? == 0 ]; then | ||
echo "finished" >> $log | ||
echo "finished" >> "$log" | ||
else | ||
echo -e "\nAbnormal termination with exit code $?" >> $log | ||
top -n1 -o %MEM -c >> $log | ||
echo -e "\nAbnormal termination with exit code $?" >> "$log" | ||
top -n1 -o %MEM -c >> "$log" | ||
|
||
emaillog=$log.txt | ||
failed_pid=$! | ||
echo "Abnormal termination, check $log" > $emaillog | ||
echo "https://cms-unified.web.cern.ch/cms-unified/logs/$s_dated_log" >> $emaillog | ||
echo $failed_pid >> $emaillog | ||
echo $USER >> $emaillog | ||
echo $HOSTNAME >> $emaillog | ||
echo -e "module $modulename \n" >> $emaillog | ||
tail $log >> $emaillog | ||
cat $emaillog | mail -s "[Ops] module "$modulename" failed" [email protected] | ||
echo "Abnormal termination, check $log" > "$emaillog" | ||
# shellcheck disable=SC2129 | ||
echo "https://cms-unified.web.cern.ch/cms-unified/logs/$s_dated_log" >> "$emaillog" | ||
echo $failed_pid >> "$emaillog" | ||
echo "$USER" >> "$emaillog" | ||
echo "$HOSTNAME" >> "$emaillog" | ||
echo -e "module $modulename \n" >> "$emaillog" | ||
tail "$log" >> "$emaillog" | ||
# shellcheck disable=SC2002 | ||
cat "$emaillog" | mail -s "[Ops] module $modulename failed" [email protected] | ||
fi | ||
|
||
stop=`date +%s` | ||
python ssi.py $modulename $start $stop | ||
echo `date` >> $log | ||
stop=$(date +%s) | ||
python ssi.py "$modulename $start $stop" | ||
# shellcheck disable=SC2005 | ||
echo "$(date)" >> "$log" | ||
|
||
#cp $log $dated_log | ||
cp $log $last_log | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/. | ||
cp $log $FINAL_HTML_DIR/logs/$modulename/last.log | ||
# cp $log $dated_log | ||
cp "$log" "$last_log" | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/. | ||
cp "$log" $FINAL_HTML_DIR/logs/"$modulename"/last.log | ||
|
||
#rm $log | ||
# rm $log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#log the memory of all | ||
for each in 0268 0269 0272 0273 0274 0275; do | ||
lf='/data/unified/www/logs/checkmem/'`date +%F_%T`.$each.memlog | ||
date > $lf | ||
ssh vocms$each "ps -o pid,user,rss,%mem,args --sort -pmem -e | head -10" >> $lf | ||
lf='/data/unified/www/logs/checkmem/'$(date +%F_%T).$each.memlog | ||
date > "$lf" | ||
ssh vocms$each "ps -o pid,user,rss,%mem,args --sort -pmem -e | head -10" >> "$lf" | ||
done | ||
## keep it clean | ||
find /data/unified/www/logs/checkmem/ -type f -name '*.memlog' -mtime +1 -exec rm {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.