This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMS6MachineStatus.html
201 lines (200 loc) · 10.6 KB
/
CMS6MachineStatus.html
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
197
198
199
200
201
## -*- coding: utf-8 -*-
<%inherit file="/module_base.html" />
<%def name="content()">
<script type="text/javascript">
function ${module.instance_name}_row_button(name) {
$('#${module.instance_name}_plot_form :hidden').remove();
counter = 1;
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="filter" value="site,'+name+'" />');
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="legend" value="0" />');
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="title" value='+name+' />');
$('input[id*="${module.instance_name}_variable"]').each(function(idx, item){
if(item.checked){
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="curve_'+counter+'" value="${module.instance_name},plot,'+item.value+','+item.value+'" />');
counter++;
}});
$('#${module.instance_name}_plot_form').submit();
}
function ${module.instance_name}_col_button(name) {
$('#${module.instance_name}_plot_form :hidden').remove();
counter = 1;
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="legend" value="0" />');
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="title" value='+name+' />');
$('input[id*="${module.instance_name}_entry_"]').each(function(idx, item){
if(item.checked){
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="curve_'+counter+'" value="${module.instance_name},plot,'+name+','+item.value+'" />');
$('#${module.instance_name}_plot_form').append('<input type="hidden" name="filter_'+counter+'" value="site,'+item.value+'" />');
counter++;
}});
$('#${module.instance_name}_plot_form').submit();
}
</script>
<form id="${module.instance_name}_plot_form" method="get" action="${hf.plotgenerator.getTimeseriesUrl()}" target="_blank">
% if module.dataset['error'] == 1:
<table>
<tr>
<td class="warning"> ${module.dataset['error_msg']}</td>
</tr>
</table>
% else:
<table class="TableData">
<tr class="TableHeader">
<th width = "16%">Total Slots </th>
<th width = "16%">Machines running </th>
<th width = "16%"> Claimed Slots</th>
<th width = "16%"> Unclaimed Slots</th>
<th width = "16%">Load below ${float(module.config['weak_threshold'])*100} % </th>
<th width = "16%">Avg Condor Load </th>
</tr>
<tr>
<td width = "16%" >${module.dataset['slots']} </td>
<td width = "16% ">${module.dataset['machines']} </td>
<td width = "16%" >${module.dataset['claimed_slots']} </td>
<td width = "16%" >${module.dataset['unclaimed_slots']} </td>
% if "of working slots have a load below" in module.dataset['error_msg']:
<td class=critical
% else:
<td class=ok
% endif
<td width = "16%" >${module.dataset['weak_slots']} </td>
<td width = "16%" >${module.dataset['condor_load']} % </td>
</tr>
</table>
<img src=${module.dataset["filename_plot"].getArchiveUrl()} />
<div>
<input type="button" value="Show Details" onfocus="this.blur()" onclick="$('#${module.instance_name}_plot').toggle()" />
<input type="button" value="show all Slots" onfocus="this.blur()" onclick="$('#${module.instance_name}_details').toggle()" />
<input type="button" value="Error Message" onfocus="this.blur()" onclick="$('#${module.instance_name}_error').toggle()" />
<input type="button" value="Condor Versions" onfocus="this.blur()" onclick="$('#${module.instance_name}_condor').toggle()" />
</div>
<div class="DetailedInfo" id="${module.instance_name}_plot" style="display:none;">
<table style="font: bold 0.7em sans-serif; font-color: #ddd; width:800px; background-color: #ddd; border: 1px #ddd;">
<tr>
<td>Start:</td>
<td>
<%
import datetime
backintime = run['time']-datetime.timedelta(days=2)
%>
<input name="start_date" type="text" size="10" style="text-align:center;" value="${backintime.strftime('%Y-%m-%d')}" />
<input name="start_time" type="text" size="5" style="text-align:center;" value="${backintime.strftime('%H:%M')}" />
</td>
<td>End:</td>
<td>
<input name="end_date" type="text" id="datepicker" size="10" style="text-align:center;" value="${run['time'].strftime('%Y-%m-%d')}" />
<input name="end_time" type="text" size="5" style="text-align:center;" value="${run['time'].strftime('%H:%M')}" />
</td>
</tr>
</table>
<table class="TableData">
<tr class="TableHeader">
<td width = "25%">Site</td>
<!--
<td><input type="checkbox" id="${module.instance_name}_variable_0" value="machines" checked="checked" />Machines running</td>
<td><input type="checkbox" id="${module.instance_name}_variable_1" value="claimed" checked="checked" />Claimed Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_2" value="unclaimed" checked="checked" />Unclaimed Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_3" value="claimed_avg" checked="unchecked" />Average Load claimed Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_4" value="unclaimed_avg" checked="unchecked" />Average Load unclaimed Slots</td>
<td>Plot jobs</td>
-->
<td><input type="checkbox" id="${module.instance_name}_variable_0" value="machines" checked="checked" />Machines running</td>
<td><input type="checkbox" id="${module.instance_name}_variable_1" value="idle" checked="checked" />Idle Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_2" value="busy" checked="checked" />Busy Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_3" value="suspended" checked="unchecked" />Suspended Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_4" value="retiring" checked="unchecked" />Retiring Slots</td>
<td><input type="checkbox" id="${module.instance_name}_variable_5" value="blocked" checked="unchecked" />Blocked Slots</td>
<td>Plot jobs</td>
<tr class="TableHeader">
<td> </td>
<td><button onfocus="this.blur()" group="total" onclick="${module.instance_name}_col_button('machines')">Plot Col</button></td>
<td><button onfocus="this.blur()" onclick="${module.instance_name}_col_button('idle')">Plot Col</button></td>
<td><button onfocus="this.blur()" onclick="${module.instance_name}_col_button('busy')">Plot Col</button></td>
<td><button onfocus="this.blur()" onclick="${module.instance_name}_col_button('suspended')">Plot Col</button></td>
<td><button onfocus="this.blur()" onclick="${module.instance_name}_col_button('retiring')">Plot Col</button></td>
<td><button onfocus="this.blur()" onclick="${module.instance_name}_col_button('blocked')">Plot Col</button></td>
<td> </td>
</tr>
</tr>
<% i = 1 %>
% for entry in plot:
% if entry['claimed_avg'] < float(module.config['weak_threshold']) and entry['claimed'] > 0:
<tr class=critical>
% elif entry['unclaimed_avg'] > float(module.config['weak_threshold'])and entry['unclaimed'] > 0:
<tr class=critical>
% else:
<tr class=ok>
% endif
<!--
<td><input type="checkbox" id="${'%s_entry_%i' %(module.instance_name, i)}" value="${entry['site']}" checked="checked" />${entry['site']}</td>
<td class="TableThirdCol" width="10%">${entry['machines']}</td>
<td class="TableSecondCol" width="10%">${entry['claimed']}</td>
<td class="TableThirdCol" width="10%">${entry['unclaimed']}</td>
<td class="TableThirdCol" width="15%">${entry['claimed_avg']}</td>
<td class="TableThirdCol" width="15%">${entry['unclaimed_avg']}</td>
<td><input type="button" onclick="${module.instance_name}_row_button('${entry['site']}')" value="Plot Row" name="Plot Row" /></td>
-->
<td><input type="checkbox" id="${'%s_entry_%i' %(module.instance_name, i)}" value="${entry['site']}" checked="checked" />${entry['site']}</td>
<td >${entry['machines']}</td>
<td >${entry['idle']}</td>
<td >${entry['busy']}</td>
<td >${entry['suspended']}</td>
<td >${entry['retiring']}</td>
<td >${entry['blocked']}</td>
<td><input type="button" onclick="${module.instance_name}_row_button('${entry['site']}')" value="Plot Row" name="Plot Row" /></td>
</tr>
<% i += 1 %>
%endfor
</table>
</div>
</form>
% if dataset['error_msg'] != '':
<div id="${module.instance_name}_error" style="display:none;">
<h3>Error Message:</h3>
% if dataset['status'] == 0.5:
<p class=warning
% else:
<p class=critical
% endif
style="position: relative; margin-right: 240px">${module.dataset['error_msg']}</p>
</div>
% endif
<div id="${module.instance_name}_condor" style="display:none;">
<table class="TableData">
<tr class="TableHeader">
<th > Site </th>
<th > Version </th>
<th > Value </th>
</tr>
% for entry in condor:
<tr>
<td>${entry['site']}</td>
<td>${entry['condor_version']}</td>
<td>${entry['value']} </td>
</tr>
% endfor
</table>
</div>
<div class="DetailedInfo" id="${module.instance_name}_details" style="display:none;">
<table class="TableData">
<tr class="TableHeader">
<th class="TableFirstCol" width="60%"> SlotID </th>
<th class="TableSecondCol" width="15%"> Activity</th>
<th class="TableForthCol" width="10%"> LoadAvg </th>
</tr>
%for entry in statistics:
% if "Claimed" in entry['status'] and float(entry['LoadAvg']) < float(module.config['weak_threshold']):
<tr class=critical>
% elif "Unclaimed" in entry['status'] and float(entry['LoadAvg']) > float(module.config['weak_threshold']):
<tr class=critical>
% else:
<tr class=ok>
% endif
<td class="TableFirstCol" width="60%">${entry['mid']}</td>
<td class="TableSecondCol" width="15%">${entry['activity']}</td>
<td class="TableForthCol" width="10%">${entry['LoadAvg']}</td>
</tr>
%endfor
</table>
</div>
% endif
</%def>