This file is indexed.

/usr/bin/condor_pool_job_report is in htcondor 8.6.8~dfsg.1-2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/bin/sh
##**************************************************************
##
## Copyright (C) 1990-2014, Condor Team, Computer Sciences Department,
## University of Wisconsin-Madison, WI.
## 
## Licensed under the Apache License, Version 2.0 (the "License"); you
## may not use this file except in compliance with the License.  You may
## obtain a copy of the License at
## 
##    http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
##**************************************************************


# condor_startd_history_report
#  Run this daily on a machine like the central manager that has ADMIN permission to all of the startds
#  It will condor_fetchlog the startd job history from all the startds in the collector, and make a report
#  about job runtimes, and mail it to the CONDOR_ADMIN.

MAILTO=`condor_config_val CONDOR_ADMIN`

PATH=/usr/sbin:/usr/bin:/bin:$PATH
MAX_RUNTIME=25200

mv hosts hosts.last
mv histories.gz histories.last.gz

rm -f JobReport
rm -f JobReport.csv

echo -n "HTCondor Job Durations report running at " >> JobReport
date >> JobReport

for host in `condor_status -const 'opsys == "LINUX"' -af Machine | sort -u`
do

	echo "$host" >> hosts
	condor_fetchlog $host STARTD_HISTORY

done 2> histories.errors | 
condor_history -forward -f /dev/stdin -const 'formattime(CompletionDate, "%j") == formattime(time() - (24 * 3600), "%j")' -l | sed -e 's/^$/\*\*\*/' | gzip > histories.gz

GoodStartds=`wc -l hosts`
echo "Got data from $GoodStartds" >> JobReport

echo >> JobReport
echo >> JobReport

gunzip < histories.gz | condor_history -forward -f /dev/stdin -const 'owner =!= "boinc" && JobUniverse == 5 && RemoteWallClockTime > 252000' -af User -af RemoteWallClockTime | grep -v Warning: > MaxJobPreemptedJobsDaily


gunzip < histories.gz | condor_history -forwards -f /dev/stdin -const 'JobStatus == 4 && ExitBySignal == false && RemoteWallClockTime < 251000' -af User -af RemoteWallClockTime | grep -v Warning: > CompletedJobTimesDaily

gunzip < histories.gz | condor_history -forwards -f /dev/stdin -const 'JobStatus =!= 4 && RemoteWallClockTime < 251000' -af User -af RemoteWallClockTime | grep -v Warning: | awk '{user[$1]+=$2} END {for (i in user) {print i, int(user[i]/3600)}}' > RemovedJobTimesDaily

gunzip < histories.gz | condor_history -forwards -f /dev/stdin -const 'JobStatus == 4 && ExitBySignal == false && RemoteWallClockTime < 251000 && WantGlidein' -af User -af RemoteWallClockTime | grep -v Warning: | awk '{user[$1]+=$2} END {for (i in user) {print i, int(user[i]/3600)}}' > UserWantedGlidein

gunzip < histories.gz | condor_history -forwards -f /dev/stdin -const 'JobStatus == 4 && ExitBySignal == false && RemoteWallClockTime < 251000' -format "%s " User -format "%d." ClusteriD -format "%d\n" ProcId | grep -v Warning: | sort | uniq -c | awk '{print $2}' | sort | uniq -c > UserDistinctJobs

TotalJobs=`wc -l < CompletedJobTimesDaily`
TotalHours=`awk '{s+=$2} END {print int(s/3600)}' < CompletedJobTimesDaily`

printf "%-12s %30s %8s %8s %8s %6s %6s %8s  %8s  %8s %8s %8s %8s %8s\n" User Schedd Starts Restarted Total Short OSGable Removed 1st Median 3rd Max Mean SD >> JobReport
printf "%-12s %30s %8s %8s %8s %6s %6s %8s  %8s  %8s %8s %8s %8s %8s\n" "" "" "" Jobs Hours Jobs Hours Hours Quartile Runtime Quartile Runtime Runtime >> JobReport
echo >> JobReport

printf "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" User Schedd Starts Restarted Total Short OSGable Removed 1st Median 3rd Max Mean SD >> JobReport.csv

for user in `awk '{print $1}' CompletedJobTimesDaily | sort -u`
do
	PerUserTotalStarts=0
	PerUserMin=0
	PerUser25th=0
	PerUser50th=0
	PerUser75th=0
	PerUserMax=0

	PerUserTotalStarts=`grep -c "^$user " < CompletedJobTimesDaily`
	PerUserMin=`grep "^$user " < CompletedJobTimesDaily | sort -n -k 2 | awk '{print $2}' | sed -ne 1p`

	line=$(($PerUserTotalStarts/4))
	if [ $line -eq 0 ]
	then
		line=1
	fi
	PerUser25th=`grep "^$user " CompletedJobTimesDaily | sort -n -k 2 | awk '{print $2}' | sed -ne "${line}p"`

	line=$(($PerUserTotalStarts/2))
	if [ $line -eq 0 ]
	then
		line=1
	fi
	PerUser50th=`grep "^$user " CompletedJobTimesDaily | sort -n -k 2 | awk '{print $2}' | sed -ne "${line}p"`

	line=$(($PerUserTotalStarts/4 * 3))
	if [ $line -eq 0 ]
	then
		line=1
	fi
	PerUser75th=`grep "^$user " CompletedJobTimesDaily | sort -n -k 2 | awk '{print $2}' | sed -ne "${line}p"`
	PerUserMax=`grep "^$user " < CompletedJobTimesDaily | sort -n -k 2 | awk '{print $2}' | sed -ne '$p'`

	PerUserMean=0
	PerUserMean=`grep "^$user " < CompletedJobTimesDaily | awk '{sum += $2} END {print int(sum/NR)}'`
	PerUserSD=`grep "^$user " < CompletedJobTimesDaily | awk '{sum += $2;sumsq+=$2*$2} END {print int(sqrt(sumsq/NR - (sum/NR)**2))}'`

	PerUserTotal=`grep "^$user " < CompletedJobTimesDaily | awk '{sum += $2} END {print sum}'`

	PerUserShort=`grep "^$user " CompletedJobTimesDaily | awk '{if ($2 < 60) {print}}' | wc -l`

	h=$(($PerUser25th/3600))
	m=$((($PerUser25th - $h * 3600) / 60))
	s=$(($PerUser25th%60))
	PerUser25thStr=`printf "%02d:%02d" $h $m`

	h=$(($PerUser50th/3600))
	m=$((($PerUser50th - $h * 3600) / 60))
	s=$(($PerUser50th%60))
	PerUser50thStr=`printf "%02d:%02d" $h $m`

	h=$(($PerUser75th/3600))
	m=$((($PerUser75th - $h * 3600) / 60))
	s=$(($PerUser75th%60))
	PerUser75thStr=`printf "%02d:%02d" $h $m`

	h=$(($PerUserMax/3600))
	m=$((($PerUserMax - $h * 3600) / 60))
	s=$(($PerUserMax%60))
	PerUserMaxStr=`printf "%02d:%02d" $h $m`

	h=$(($PerUserMean/3600))
	m=$((($PerUserMean - $h * 3600) / 60))
	s=$(($PerUserMean%60))
	PerUserMeanStr=`printf "%02d:%02d" $h $m`

	h=$(($PerUserSD/3600))
	m=$((($PerUserSD - $h * 3600) / 60))
	s=$(($PerUserSD%60))
	PerUserSDStr=`printf "%02d:%02d" $h $m`

	PerUserTotalStr=$(($PerUserTotal/3600))
	
	AccountingUser=${user%%@*}
	AccountingSubmit=${user##${AccountingUser}}

	PerUserPotentialGlidein=`grep "^$user " <  UserWantedGlidein | awk '{print $2}'`
	if [ ${PerUserPotentialGlidein}"0" -eq "0" ]
	then
		PerUserPotentialGlidein=0
	fi

	PerUserDistinctJobs=`grep " $user\$" <  UserDistinctJobs | awk '{print $1}'`
	if [ ${PerUserDistinctJobs}"0" -eq "0" ]
	then
		PerUserDistinctJobs=0
	fi
	PerUserRestartedJobs=$(($PerUserTotalStarts - $PerUserDistinctJobs))

	PerUserRemovedHours=`grep "^$user " <  RemovedJobTimesDaily | awk '{print $2}'`
	if [ ${PerUserRemovedHours}"0" -eq "0" ]
	then
		PerUserRemovedHours=0
	fi

	printf "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" $AccountingUser $AccountingSubmit $PerUserTotalStarts $PerUserRestartedJobs $PerUserTotalStr $PerUserShort $PerUserPotentialGlidein $PerUserRemovedHours $PerUser25th $PerUser50th $PerUser75th $PerUserMax $PerUserMean $PerUserSD  | tr -d '@' >> JobReport.csv

	printf "%-12s %30s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s\n" $AccountingUser $AccountingSubmit $PerUserTotalStarts $PerUserRestartedJobs $PerUserTotalStr $PerUserShort $PerUserPotentialGlidein $PerUserRemovedHours $PerUser25thStr $PerUser50thStr $PerUser75thStr $PerUserMaxStr $PerUserMeanStr $PerUserSDStr 
done | tr -d '@' | sort -k 5n >> JobReport


echo >> JobReport
echo "Total completed jobs yesterday: $TotalJobs" >> JobReport
echo "Using a total of $TotalHours hours" >> JobReport


cat >> JobReport <<EOF

The following users have run vanilla jobs that have hit the MaxJobRetirementTime limit yesterday.

# of	User
Jobs
----	----
EOF

awk '{print $1}' MaxJobPreemptedJobsDaily | sort | uniq -c | sort -n >> JobReport

/bin/mailx -a JobReport.csv -s "HTCondor Job Durations Report" $MAILTO < JobReport

exit 0