diff --git a/condor_check b/condor_check index ec42df4..1d67113 100755 --- a/condor_check +++ b/condor_check @@ -1,5 +1,7 @@ #!/bin/bash +# TODO: put raw outputs in json + if [ -z $glideinWMSMonitor_RELEASE_DIR ] ; then echo "ERROR: glideinWMSMonitor source code missing." exit 1 diff --git a/condor_check.sh b/condor_check.sh index 86f4a33..5836246 100755 --- a/condor_check.sh +++ b/condor_check.sh @@ -22,7 +22,7 @@ EOF # run analysis of analysis ops pool, with a time limit of 300s. COLLECTOR1=glidein-collector-2.t2.ucsd.edu COLLECTOR2=glidein-collector.t2.ucsd.edu -alarm 400 $glideinWMSMonitor_RELEASE_DIR/condor_check $COLLECTOR1 $COLLECTOR2 >> $OUTFILE +alarm 600 $glideinWMSMonitor_RELEASE_DIR/condor_check $COLLECTOR1 $COLLECTOR2 >> $OUTFILE rc=$? cat >> $OUTFILE <=T1, then it is 5% of total pledge + validityofpledge=`grep ^$site\, $PLEDGES | tail -1 | awk -F\, '{print $3}'` + totalpledge=`grep ^$site\, $PLEDGES | tail -1 | awk -F\, '{print int($2)}'` + echo $site | egrep '^T0|^T1' >> /dev/null + if [ $? -eq 0 ] ; then + analysispledge=`echo $totalpledge 0 | awk '{print int($1/10.)}'` + else + analysispledge=`echo $totalpledge 0 | awk '{print int($1/2.0)}'` + fi + + avgusageana=`grep ^$site\, $USAGEANA | awk -F\, '{print int($2)}'` + maxusageana=`grep ^$site\, $USAGEANA | awk -F\, '{print int($3)}'` + + avgusagetst=`grep ^$site\, $USAGETST | awk -F\, '{print int($2)}'` + maxusagetst=`grep ^$site\, $USAGETST | awk -F\, '{print int($3)}'` + + avgusagepro=`grep ^$site\, $USAGEPRO | awk -F\, '{print int($2)}'` + maxusagepro=`grep ^$site\, $USAGEPRO | awk -F\, '{print int($3)}'` + + avgusageall=`grep ^$site\, $USAGEALL | awk -F\, '{print int($2)}'` + maxusageall=`grep ^$site\, $USAGEALL | awk -F\, '{print int($3)}'` + + claimedana=` grep \{$site\} $CLAIMEDANA | awk '{print int($1)}'` + runningana=` grep \{$site\} $RUNNINGANA | awk '{print int($1)}'` + pressureana=`grep $site $DESIREDANA | wc -l` + exclusivepressureana=`grep $site $DESIREDANA | awk -v site=$site '$1==site{print $0}' | wc -l` + + claimedglo=` grep \{$site\} $CLAIMEDGLO | awk '{print int($1)}'` + runningglo=` grep \{$site\} $RUNNINGGLO | awk '{print int($1)}'` + pressureglo=`grep $site $DESIREDGLO | wc -l` + exclusivepressureglo=`grep $site $DESIREDGLO | awk -v site=$site '$1==site{print $0}' | wc -l` + + claimedpro=` grep \{$site\} $CLAIMEDPRO | awk '{print int($1)}'` + runningpro=` grep \{$site\} $RUNNINGPRO | awk '{print int($1)}'` + pressurepro=`grep $site $DESIREDPRO | wc -l` + exclusivepressurepro=`grep $site $DESIREDPRO | awk -v site=$site '$1==site{print $0}' | wc -l` + + unclaimed=`echo $claimed $running 0 | awk '{print int($2-$1)}'` + + # still need to remove the comma on the last one + printf ' [ "%s","%s","%s",%i,%i,' $site "$downtime" "$validityofpledge" $totalpledge $analysispledge + printf '%s,%s,' $avgusageana $maxusageana + printf '%s,%s,' $avgusagetst $maxusagetst + printf '%s,%s,' $avgusagepro $maxusagepro + printf '%s,%s,' $avgusageall $maxusageall + printf '%s,%s,%s,%s,' $claimedana $runningana $pressureana $exclusivepressureana + printf '%s,%s,%s,%s,' $claimedglo $runningglo $pressureglo $exclusivepressureglo + printf '%s,%s,%s,%s],\n' $claimedpro $runningpro $pressurepro $exclusivepressurepro +done + +# close the json file +cat < $OUTFILE +exit diff --git a/dashboard_functions.sh b/dashboard_functions.sh index 1d844ab..7b30722 100644 --- a/dashboard_functions.sh +++ b/dashboard_functions.sh @@ -72,7 +72,6 @@ dashboard_usage_by_site() { echo "$OUTPUTFILE" return 0 } -#!/bin/bash dashboard_exit_status() { # print the exit status of jobs from the dashboard by site diff --git a/make_html_page.sh b/make_html_page.sh index e72face..8a73ea4 100755 --- a/make_html_page.sh +++ b/make_html_page.sh @@ -6,7 +6,7 @@ else source $glideinWMSMonitor_RELEASE_DIR/bashrc fi -OUTFILE=$glideinWMSMonitor_OUTPUT_DIR/test2.html +OUTFILE=$glideinWMSMonitor_OUTPUT_DIR/test.html INFILE=$glideinWMSMonitor_OUTPUT_DIR/latest.txt FILES=`find $glideinWMSMonitor_OUTPUT_DIR -type f -name 'monitor-anaops-2014*.txt' -mtime -1 | sort` @@ -65,6 +65,12 @@ for file in $FILES ; do done endchart Jobs 'Number of Running and Pending Jobs (Analysis Operations Pool)' >>$OUTFILE +beginchart ProdJobs Time Running_Jobs Pending_Jobs >>$OUTFILE +for file in $FILES ; do + basename $file | awk -FZ '{print $2}' | awk -F\. '{printf(" [\x27%s\x27,",$1)}' >>$OUTFILE + grep Total $file | awk '($1=="Total"){printf("%s,%s],\n",$2,$3)}' | tail -1 >>$OUTFILE +done +endchart ProdJobs 'Number of Running and Pending Jobs (Monte Carlo Production Pool)' >>$OUTFILE beginchart Nego Time Nego_Cycle_\(s\) >>$OUTFILE for file in $FILES ; do @@ -81,45 +87,48 @@ for file in $FILES ; do done endchart Coll 'Running Job Difference Between HA Collectors (Analysis Operations Pool)' >>$OUTFILE -beginchart UNL Time Running_Jobs Pending_Jobs >>$OUTFILE -for file in $FILES ; do - basename $file | awk -FZ '{print $2}' | awk -F\. '{printf(" [\x27%s\x27,",$1)}' >>$OUTFILE - string=`grep hcc-crabserver $file | head -1` - if [ "X$string" == "X" ] ; then - printf "0,0],\n" >>$OUTFILE - else - echo $string | awk '{printf("%s,%s],\n",$3,$4)}' >>$OUTFILE - fi -done -endchart UNL 'Number of Running and Pending Jobs (hcc-crabserver.unl.edu)' >>$OUTFILE - - -beginchart sub6 Time Running_Jobs Pending_Jobs >>$OUTFILE -for file in $FILES ; do - basename $file | awk -FZ '{print $2}' | awk -F\. '{printf(" [\x27%s\x27,",$1)}' >>$OUTFILE - string=`grep submit-6 $file | head -1` - if [ "X$string" == "X" ] ; then - printf "0,0],\n" >>$OUTFILE - else - echo $string | awk '{printf("%s,%s],\n",$3,$4)}' >>$OUTFILE - fi -done -endchart sub6 'Number of Running and Pending Jobs (submit-6.t2.ucsd.edu)' >>$OUTFILE - +schedd_chart(){ + CHART_NAME=$1 + SCHEDD_NAME=$2 + cat <>$OUTFILE -for file in $FILES ; do - basename $file | awk -FZ '{print $2}' | awk -F\. '{printf(" [\x27%s\x27,",$1)}' >>$OUTFILE - string=`grep submit-4 $file | head -1` - if [ "X$string" == "X" ] ; then - printf "0,0],\n" >>$OUTFILE - else - echo $string | awk '{printf("%s,%s],\n",$3,$4)}' >>$OUTFILE - fi -done -endchart sub4 'Number of Running and Pending Jobs (submit-4.t2.ucsd.edu)' >>$OUTFILE + var options = { + title: 'Pending and Running Jobs on $SCHEDD_NAME', + hAxis: {title: 'Last 24h', titleTextStyle: {color: '#333'}}, + vAxis: {minValue: 0} + }; + var chart = new google.visualization.AreaChart(document.getElementById('chart_${CHART_NAME}')); + chart.draw(data, options); + } +EOF +} +schedd_chart sub4 submit-4 >>$OUTFILE +schedd_chart sub5 submit-5 >>$OUTFILE +schedd_chart sub6 submit-6 >>$OUTFILE +schedd_chart unl hcc-crabserver >>$OUTFILE +schedd_chart vo20 vocms20 >>$OUTFILE +schedd_chart vo83 vocms83 >>$OUTFILE +schedd_chart vo95 crab3test-2 >>$OUTFILE +schedd_chart vo96 crab3test-3 >>$OUTFILE +schedd_chart v109 crab3test-4 >>$OUTFILE cat >>$OUTFILE < @@ -129,12 +138,8 @@ cat >>$OUTFILE <CMS Analysis Monitoring for glideinWMS (remoteGlidein)
-
-
-
-
-
-
+
+
 EOF
@@ -143,6 +148,19 @@ cat $INFILE >>$OUTFILE
 
 cat >>$OUTFILE <
+  
+
+
+
+
+
+
+
+
+
+
+
+
EOF diff --git a/weekly_report.sh b/weekly_report.sh new file mode 100755 index 0000000..91d0070 --- /dev/null +++ b/weekly_report.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ -z $glideinWMSMonitor_OUTPUT_DIR ] ; then + echo "Error, glideinWMSMonitor_OUTPUT_DIR not defined!" + exit 1 +else + source $glideinWMSMonitor_RELEASE_DIR/bashrc +fi +OUTFILE=$glideinWMSMonitor_OUTPUT_DIR/weekly-report.txt +dashboard_report 7 6 > $OUTFILE +exit