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 id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
32 <td id="site-${site.status}" nowrap="true"><a class="ext-link" href="${plc_site_uri_id(site.plc_siteid)}">
33 <span class="icon">${site.loginbase}</span></a>
35 <td py:content="site.enabled"></td>
36 <td id="site-${site.penalty_level}">${site.penalty_level}</td>
37 <td>${site.slices_used}/${site.slices_total}</td>
38 <td>${site.nodes_up} / ${site.nodes_total}</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%">
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'}" >
59 <td><a href="pcuhistory?pcu_id=${agg.pcu.plc_pcuid}">history</a></td>
60 <td nowrap="true" id="site-${agg.pcuhist.status}" py:content="diff_time(mktime(agg.pcuhist.last_changed.timetuple()))"></td>
61 <td nowrap="true" id="status-${agg.status}">
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>History (scan)</th>
146 <th>Status Since</th>
150 <th>last_contact (cached)</th>
151 <th>Last Checked</th>
152 <th nowrap='true'>Port Status</th>
153 <th>Blocked Ports?</th>
157 <span py:for="i,agg in enumerate(nodequery)">
158 <tr class="${i%2 and 'odd' or 'even'}" >
159 <td><a href="nodehistory?hostname=${agg.node.hostname}">status</a>
160 (<a href="nodescanhistory?hostname=${agg.node.hostname}">scan</a>)</td>
161 <td id="site-${agg.history.status}" py:content="diff_time(mktime(agg.history.last_changed.timetuple()))"></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="agg.node.ssh_status"></td>
168 <td py:content="diff_time(agg.node.plc_node_stats['last_contact'])"></td>
169 <td py:content="diff_time(mktime(agg.node.date_checked.timetuple()))"></td>
171 <span py:for="port,state in agg.ports"
172 id="port${state}" py:content="'%s, ' % port">80</span>
174 <td py:content="agg.node.firewall"></td>
179 <td colspan="3" py:content="agg.kernel"> </td>
184 <td colspan="3"><pre py:content="agg.node.dns_status"> </pre></td>
189 <td colspan="3"><pre py:content="agg.node.traceroute"> </pre></td>
194 <div class="error" py:if="exceptions is not None">
197 <div id="status_block" class="flash"
198 py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
200 ${actionlist_widget.display(since=since, actions=actions)}
202 <!-- TODO: figure out how to make this conditional by model rather than port;
203 it is convenient to have links to ilo, drac, amt, etc.
204 regardless of whether the last PCU scan was successful. -->
205 <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
206 <div py:if="len(pcuquery) != 0" class="code">
207 <span py:for="port,state in pcu.ports">
208 <span class="code" py:if="port == 22 and state == 'open'">
209 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
210 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
213 <span class="code" py:if="port == 23 and state == 'open'">
214 telnet ${pcu_name(pcu.plc_pcu_stats)}
217 <span class="code" py:if="port == 80 and state == 'open'">
218 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
221 <span class="code" py:if="port == 443 and state == 'open'">
223 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
225 curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
226 -form 'password=${pcu.plc_pcu_stats['password']}'
227 -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
229 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
230 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
232 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
233 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
234 -s ${pcu_name(pcu.plc_pcu_stats)}
235 -u ${pcu.plc_pcu_stats['username']}
236 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
238 <span class="code" py:if="port == 16992 and state == 'open'">
239 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
240 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
241 -user admin -pass '${pcu.plc_pcu_stats['password']}'