1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 layout_params['page_title'] = "MyOps Detail View"
4 from monitor.util import diff_time
5 from monitor import config
6 from time import mktime
7 from pcucontrol.reboot import pcu_name, model_to_object
10 <html py:layout="'sitemenu.kid'"
11 xmlns:py="http://purl.org/kid/ns#"
12 xmlns:mochi="http://www.mochi.org">
14 <div py:match="item.tag == 'content'">
15 <h3 py:if="len(sitequery) > 0">Site Status</h3>
16 <table py:if="len(sitequery) > 0" id="sub-table" border="1" width="100%">
29 <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
30 <td><a href="sitehistory?loginbase=${site.loginbase}">history</a></td>
31 <td nowrap="true"><a class="ext-link" href="${plc_site_uri_id(site.plc_siteid)}">
32 <span class="icon">${site.loginbase}</span></a>
34 <td py:content="site.enabled"></td>
35 <td id="site-${site.penalty_level}">${site.penalty_level}</td>
36 <td>${site.slices_used}/${site.slices_total}</td>
37 <td>${site.nodes_up} / ${site.nodes_total}</td>
38 <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
42 <h3 py:if="len(pcuquery) != 0" >PCU Status</h3>
43 <table py:if="len(pcuquery) != 0" id="sortable_table" class="datagrid" border="1" width="100%">
46 <th mochi:format="int"></th>
49 <th>Missing Fields</th>
50 <th nowrap='true'>DNS Status</th>
51 <th nowrap='true'>Port Status</th>
52 <th width="80%">Test Results</th>
58 <tr py:for="i,agg in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
60 <td><a href="pcuhistory?pcu_id=${agg.pcu.plc_pcuid}">history</a></td>
62 <a class="ext-link" href="${plc_pcu_uri_id(agg.pcu.plc_pcu_stats['pcu_id'])}">
63 <span class="icon">${pcu_name(agg.pcu.plc_pcu_stats)}</span>
66 <td py:content="agg.pcu.entry_complete"></td>
67 <td nowrap='true' id="dns-${agg.pcu.dns_status}" py:content="agg.pcu.dns_status"></td>
69 <span py:for="port,state in agg.ports"
70 id="port${state}" py:content="'%s, ' % port">80</span>
72 <td width="40" id="status-${agg.status}"><pre class="results" py:content="agg.pcu.reboot_trial_status"></pre></td>
73 <td py:content="agg.pcu.plc_pcu_stats['model']"></td>
74 <td py:content="len(agg.pcu.plc_pcu_stats['node_ids'])"></td>
78 <div class="oneline" id="legend" py:if="len(pcuquery) == 0">
79 <em>There are no PCUs associated with this host.</em>
81 <div class="oneline" id="legend" py:if="len(pcuquery) > 0">
83 <a class="info" href="#">DNS Status<span>
84 <table border="1" align="center" width="100%">
85 <tr><th colspan="2">Legend for 'DNS Status'</th></tr>
87 <tr><td id="dns-DNS-OK">DNS-OK</td>
88 <td>This indicates that the DNS name and registered IP address match.</td>
90 <tr><td id="dns-DNS-MISMATCH">DNS-MISMATCH</td>
91 <td>Sometimes, the registered IP and DNS IP address do not match.
92 In these cases it is not clear which is correct,
93 so an error is flagged.</td>
95 <tr><td id="dns-DNS-NOENTRY">DNS-NOENTRY</td>
96 <td>While a hostname is provided in the registration, the hostname is not actually registered in DNS.</td>
98 <tr><td id="dns-NOHOSTNAME">NOHOSTNAME</td>
99 <td>While we prefer that a hostname be registered, it is not
100 strictly required, since simply the IP address, if it is static, is enough to access the PCU.</td>
104 <a class="info" href="#">Port Status<span>
105 <table border="1" align="center" width="100%">
106 <tr><th colspan="2">Legend for 'Port Status'</th></tr>
108 <tr><td id="portopen">Open</td>
109 <td>Green port numbers are believed to be open.</td>
111 <tr><td id="portfiltered">Filtered</td>
112 <td>Gold port numbers are believed to be filtered or simply offline.</td>
114 <tr><td id="portclosed">Closed</td>
115 <td>Finally, red ports appear to be closed.</td>
119 <a class="info" href="#">Test Results<span>
120 <table border="1" align="center" width="100%">
121 <tr><th colspan="2">Legend for 'Test Results'</th></tr>
123 <tr><td id="status-0">OK</td>
124 <td>The PCU is accessible, and short of actually rebooting the node, everything appears to work.</td>
126 <tr><td id="status-NetDown">NetDown</td>
127 <td>The PCU is inaccessible from the PlanetLab address block 128.112.139.0/25, or it is simply offline.</td>
129 <tr><td id="status-Not_Run">Not_Run</td>
130 <td>Previous errors, such as DNS or an incomplete configuration prevented the actual test from begin performed.</td>
132 <tr><td id="status-error">Other Errors</td>
133 <td>Other errors are reported by the test that are more specific to the block encountered by the script.</td>
139 <p py:if="len(nodequery) == 0">
140 There are no registered nodes for this site.
142 <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
145 <th mochi:format="int"></th>
146 <th>History (scan)</th>
149 <th>last_contact (cached)</th>
150 <th>last_checked</th>
151 <th nowrap='true'>Port Status</th>
152 <th>Blocked Ports?</th>
158 <tr py:for="i,agg in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
160 <td><a href="nodehistory?hostname=${agg.node.hostname}">status</a>
161 (<a href="nodescanhistory?hostname=${agg.node.hostname}">scan</a>) history</td>
162 <td id="node-${agg.node.observed_status}" nowrap="true" >
163 <a class="ext-link" href="${plc_node_uri_id(agg.node.plc_node_stats['node_id'])}">
164 <span class="icon">${agg.node.hostname}</span></a>
166 <td py:content="agg.node.external_dns_status"></td>
167 <td py:content="diff_time(agg.node.plc_node_stats['last_contact'])"></td>
168 <td py:content="diff_time(mktime(agg.node.date_checked.timetuple()))"></td>
170 <span py:for="port,state in agg.ports"
171 id="port${state}" py:content="'%s, ' % port">80</span>
173 <td py:content="agg.node.firewall"></td>
175 <!-- TODO: add some values/code to authenticate the operation. -->
176 <!--form action="${link('pcuview', hostname=agg.node.hostname)}" name="externalscan${i}" method='post'>
177 <input type='hidden' name='hostname' value='${agg.node.hostname}'/>
178 <input type='hidden' name='type' value='ExternalScan' />
180 <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a-->
183 <!-- TODO: add some values/code to authenticate the operation. -->
184 <!--form action="${link('pcuview', hostname=agg.node.hostname)}" name="internalscan${i}" method='post'>
185 <input type='hidden' name='hostname' value='${agg.node.hostname}'/>
186 <input type='hidden' name='type' value='InternalScan' />
188 <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a-->
190 <td py:if="len(pcuquery) > 0">
191 <!-- TODO: add some values/code to authenticate the operation. -->
192 <!--form action="${link('pcuview', pcuid=pcu.plc_pcuid)}" name="reboot${i}" method='post'>
193 <input type='hidden' name='hostname' value='${agg.node.hostname}'/>
194 <input type='hidden' name='type' value='Reboot' />
196 <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a-->
201 <div class="error" py:if="exceptions is not None">
204 <div id="status_block" class="flash"
205 py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
207 <h4>Actions Over the Last ${since} Days</h4>
208 <p py:if="actions and len(actions) == 0">
209 There are no recent actions taken for this site.
211 <table py:if="actions and len(actions) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
214 <th mochi:format="int"></th>
216 <th>Action taken on</th>
223 <tr py:for="i,act in enumerate(actions)" class="${i%2 and 'odd' or 'even'}" >
225 <td py:content="act.date_created"></td>
226 <td py:if="act.hostname is not None" nowrap="true" >
227 <a class="ext-link" href="${plc_node_uri(act.hostname)}">
228 <span class="icon">${act.hostname}</span></a>
230 <td py:if="act.hostname is None" nowrap="true">
231 <a class="ext-link" href="${plc_site_uri(act.loginbase)}">
232 <span class="icon">${act.loginbase}</span></a>
234 <!--td py : content="diff_time(mktime(node.date_checked.timetuple()))"></td-->
235 <td py:content="act.action_type"></td>
236 <td><a class="ext-link" href="${plc_mail_uri(act.message_id)}">
237 <span py:if="act.message_id != 0" class="icon">${act.message_id}</span></a></td>
238 <td py:if="'bootmanager' in act.action_type or 'unknown' in act.action_type">
239 <a href="/monitorlog/bm.${act.hostname}.log">latest bm log</a>
241 <td py:if="'bootmanager' not in act.action_type">
242 <pre py:content="act.error_string"></pre></td>
247 <!-- TODO: figure out how to make this conditional by model rather than port;
248 it is convenient to have links to ilo, drac, amt, etc.
249 regardless of whether the last PCU scan was successful. -->
250 <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
251 <div py:if="len(pcuquery) != 0" class="code">
252 <span py:for="port,state in pcu.ports">
253 <span class="code" py:if="port == 22 and state == 'open'">
254 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
255 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
258 <span class="code" py:if="port == 23 and state == 'open'">
259 telnet ${pcu_name(pcu.plc_pcu_stats)}
262 <span class="code" py:if="port == 80 and state == 'open'">
263 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
266 <span class="code" py:if="port == 443 and state == 'open'">
268 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
270 curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
271 -form 'password=${pcu.plc_pcu_stats['password']}'
272 -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
274 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
275 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
277 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
278 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
279 -s ${pcu_name(pcu.plc_pcu_stats)}
280 -u ${pcu.plc_pcu_stats['username']}
281 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
283 <span class="code" py:if="port == 16992 and state == 'open'">
284 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
285 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
286 -user admin -pass '${pcu.plc_pcu_stats['password']}'