Skip to content

Commit

Permalink
Updates and some new multi-core monitoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesletts committed Mar 26, 2015
1 parent 92f0f0d commit 7cced1b
Show file tree
Hide file tree
Showing 3 changed files with 305 additions and 1 deletion.
19 changes: 19 additions & 0 deletions CompareCollectors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
COLLECTOR1=$1
COLLECTOR2=$2

list_all_glidein_names() {
condor_status -pool $COLLECTOR1 -format '%s\n' Name
condor_status -pool $COLLECTOR2 -format '%s\n' Name
}


unique=`list_all_glidein_names | sort | uniq | wc -l`
regto2=`list_all_glidein_names | sort | uniq -c | awk '($1==2){print $0}' | wc -l`
pct=$[$[$unique-$regto2]*100/$unique]

echo Unique pilots on either collector: $unique
echo Pilots registered to both collectors: $regto2
echo ... troublesome pilots = $pct \%

exit 0
2 changes: 1 addition & 1 deletion condor_check
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ echo
# Frontend ClassAds in the Collector:
echo Frontend ClassAds in the Collector:
condor_status -pool $COLLECTOR1 -any \
-const '(GlideinMyType=?=\"glideresource\")' \
-const '(GlideinMyType=?="glideresource")' \
-format '%s\n' GlideClientName | sort | uniq -c
echo

Expand Down
285 changes: 285 additions & 0 deletions multi-core-t1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
#!/bin/sh

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


writeoutjsonfile() {

COLLECTOR=$1

echo "{"
echo " \"Multi-core pilot monitoring\": {"
echo " \"Collector\": \"$COLLECTOR\","
echo " \"Time\": `/bin/date +%s`,"


echo " \"Partitionable glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Partitionable")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Partitionable glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Partitionable")' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Partitionable retiring glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Partitionable")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Partitionable retiring glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Partitionable")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Dynamic glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Dynamic")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Dynamic glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Dynamic")' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Dynamic retiring glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Dynamic")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Dynamic retiring glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Dynamic")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static retiring glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static retiring glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static multi-core glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-format '%s ' Name -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static multi-core glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-format '%s ' Name -format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 " " $4 }' | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static multi-core retiring glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' Name -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Static multi-core retiring glidein Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-const '(SlotType=?="Static")' \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' Name -format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 " " $4 }' | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Total glideins\": {"
echo " \"header\": [\"State\",\"Activity\",\"glideins\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-format '%s ' State -format '%s\n' Activity \
| sort |uniq -c \
| awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"


echo " \"Total Cpus\": {"
echo " \"header\": [\"State\",\"Activity\",\"Cpus\"],"
echo " \"data\": ["
condor_status -pool $COLLECTOR \
-const '(regexp("T1_",GLIDEIN_CMSSite)=?=True)' \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity \
| awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort |uniq -c \
| awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " }"


echo " }"
echo "}"


return
}

JSONFILE=${glideinWMSMonitor_OUTPUT_DIR}-json/monitor-multicore-t1-global-`/bin/date +%F-Z%R -u`.json
writeoutjsonfile vocms097.cern.ch > $JSONFILE

exit

0 comments on commit 7cced1b

Please sign in to comment.