forked from CMSCompOps/WmAgentScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
condor_global_overview.py
executable file
·73 lines (63 loc) · 2.13 KB
/
condor_global_overview.py
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
#!/usr/bin/env python
from condor_overview import *
try:
import htcondor
except ImportError:
print "You do not have a proper environment, please source the following:"
print "source /data/srv/wmagent/current/apps/wmagent/etc/profile.d/init.sh"
sys.exit(1)
global_pool = 'vocms099.cern.ch' #"vocms97.cern.ch"
# production schedd's
schedds = ["vocms0304.cern.ch",
"vocms0308.cern.ch",
"vocms0309.cern.ch",
"vocms0310.cern.ch",
"vocms0311cern.ch",
"cmssrv217.fnal.gov",
"cmssrv218.fnal.gov",
"cmssrv219.fnal.gov",
"cmsgwms-submit1.fnal.gov",
"cmsgwms-submit2.fnal.gov",
]
def main():
overview_running = {}
overview_pending = {}
overview_other = {}
overview_running48 = {}
overview_numjobstart = {}
overview_removereason = {}
jobs_48 = {}
jobs_maxwall = {}
jobs_numjobstart = {}
jobs_removereason = {}
# global pool collector
coll = htcondor.Collector(global_pool)
schedd_ads = coll.query(htcondor.AdTypes.Schedd, 'CMSGWMS_Type=?="prodschedd"', ['Name', 'MyAddress', 'ScheddIpAddr'])
# all schedds
for ad in schedd_ads:
if ad["Name"] not in schedds:
continue
print "getting jobs from %s"%ad["Name"]
#fill the overview
get_overview(overview_running,
overview_pending,
overview_other,
overview_running48,
overview_numjobstart,
overview_removereason,
jobs_48,
jobs_maxwall,
jobs_numjobstart,
jobs_removereason,
ad)
print_results(overview_running,
overview_pending,
overview_running48,
overview_numjobstart,
overview_removereason,
jobs_48,
jobs_maxwall,
jobs_numjobstart,
jobs_removereason)
if __name__ == "__main__":
main()