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'] = "Monitor PCU 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%">
28 <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
29 <td nowrap="true"><a class="ext-link" href="${plc_site_uri(site.loginbase)}">
30 <span class="icon">${site.loginbase}</span></a>
32 <td py:content="site.enabled"></td>
34 <td>${site.slices_used}/${site.slices_total}</td>
35 <td>${site.nodes_up} / ${site.nodes_total}</td>
36 <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
40 <h3 py:if="len(pcuquery) != 0" >PCU Status</h3>
41 <table py:if="len(pcuquery) != 0" id="sortable_table" class="datagrid" border="1" width="100%">
44 <th mochi:format="int"></th>
46 <th>Missing Fields</th>
48 <th nowrap='true'>Port Status</th>
49 <th width="80%">Test Results</th>
55 <tr py:for="i,pcu in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
58 <a class="ext-link" href="${plc_pcu_uri_id(pcu.plc_pcu_stats['pcu_id'])}">
59 <span class="icon">${pcu_name(pcu.plc_pcu_stats)}</span>
62 <td py:content="pcu.entry_complete"></td>
63 <td id="dns-${pcu.dns_status}" py:content="pcu.dns_status"></td>
65 <span py:for="port,state in pcu.ports"
66 id="port${state}" py:content="'%s, ' % port">80</span>
68 <td width="40" id="status-${pcu.status}"><pre class="results" py:content="pcu.reboot_trial_status"></pre></td>
69 <td py:content="pcu.plc_pcu_stats['model']"></td>
70 <td py:content="len(pcu.plc_pcu_stats['node_ids'])"></td>
74 <div class="oneline" id="legend" py:if="len(pcuquery) == 0">
75 <em>There no PCUs associated with this host.</em>
77 <div class="oneline" id="legend" py:if="len(pcuquery) > 0">
79 <a class="info" href="#">DNS Status<span>
80 <table border="1" align="center" width="100%">
81 <tr><th colspan="2">Legend for 'DNS Status'</th></tr>
83 <tr><td id="dns-DNS-OK">DNS-OK</td>
84 <td>This indicates that the DNS name and registered IP address match.</td>
86 <tr><td id="dns-DNS-MISMATCH">DNS-MISMATCH</td>
87 <td>Sometimes, the registered IP and DNS IP address do not match.
88 In these cases it is not clear which is correct,
89 so an error is flagged.</td>
91 <tr><td id="dns-DNS-NOENTRY">DNS-NOENTRY</td>
92 <td>While a hostname is provided in the registration, the hostname is not actually registered in DNS.</td>
94 <tr><td id="dns-NOHOSTNAME">NOHOSTNAME</td>
95 <td>While we prefer that a hostname be registered, it is not
96 strictly required, since simply the IP address, if it is static, is enough to access the PCU.</td>
100 <a class="info" href="#">Port Status<span>
101 <table border="1" align="center" width="100%">
102 <tr><th colspan="2">Legend for 'Port Status'</th></tr>
104 <tr><td id="portopen">Open</td>
105 <td>Green port numbers are believed to be open.</td>
107 <tr><td id="portfiltered">Filtered</td>
108 <td>Gold port numbers are believed to be filtered or simply offline.</td>
110 <tr><td id="portclosed">Closed</td>
111 <td>Finally, red ports appear to be closed.</td>
115 <a class="info" href="#">Test Results<span>
116 <table border="1" align="center" width="100%">
117 <tr><th colspan="2">Legend for 'Test Results'</th></tr>
119 <tr><td id="status-0">OK</td>
120 <td>The PCU is accessible, and short of actually rebooting the node, everything appears to work.</td>
122 <tr><td id="status-NetDown">NetDown</td>
123 <td>The PCU is inaccessible from the PlanetLab address block 128.112.139.0/25, or it is simply offline.</td>
125 <tr><td id="status-Not_Run">Not_Run</td>
126 <td>Previous errors, such as DNS or an incomplete configuration prevented the actual test from begin performed.</td>
128 <tr><td id="status-error">Other Errors</td>
129 <td>Other errors are reported by the test that are more specific to the block encountered by the script.</td>
135 <p py:if="len(nodequery) == 0">
136 There are no registered nodes for this site.
138 <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
141 <th mochi:format="int"></th>
143 <th>last_contact</th>
144 <th>Last_checked</th>
145 <th nowrap='true'>Port Status</th>
152 <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
154 <td id="node-${node.observed_status}" nowrap="true" >
155 <a class="ext-link" href="${plc_node_uri(node.hostname)}">
156 <span class="icon">${node.hostname}</span></a>
158 <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
159 <td py:content="diff_time(mktime(node.date_checked.timetuple()))"></td>
161 <span py:for="port,state in node.ports"
162 id="port${state}" py:content="'%s, ' % port">80</span>
165 <!-- TODO: add some values/code to authenticate the operation. -->
166 <form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
167 <input type='hidden' name='hostname' value='${node.hostname}'/>
168 <input type='hidden' name='type' value='ExternalScan' />
170 <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a>
173 <!-- TODO: add some values/code to authenticate the operation. -->
174 <form action="${link('pcuview', hostname=node.hostname)}" name="internalscan${i}" method='post'>
175 <input type='hidden' name='hostname' value='${node.hostname}'/>
176 <input type='hidden' name='type' value='InternalScan' />
178 <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a>
180 <td py:if="len(pcuquery) > 0">
181 <!-- TODO: add some values/code to authenticate the operation. -->
182 <form action="${link('pcuview', pcuid=pcu.plc_pcuid)}" name="reboot${i}" method='post'>
183 <input type='hidden' name='hostname' value='${node.hostname}'/>
184 <input type='hidden' name='type' value='Reboot' />
186 <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a>
191 <div class="error" py:if="exceptions is not None">
194 <div id="status_block" class="flash"
195 py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
196 <h4 py:if="len(pcuquery) > 0">Convenience Calls</h4>
198 if len(pcuquery) == 0: pcu = None
200 <div py:if="pcu is not None" class="code">
201 <span py:for="port,state in pcu.ports">
202 <span class="code" py:if="port == 22 and state == 'open'">
203 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
204 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
206 <span class="code" py:if="port == 23 and state == 'open'">
207 telnet ${pcu_name(pcu.plc_pcu_stats)}
209 <span class="code" py:if="port == 80 and state == 'open'">
210 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
212 <span class="code" py:if="port == 443 and state == 'open'">
214 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
216 curl -s --form 'user=${pcu.plc_pcu_stats['username']}'
217 --form 'password=${pcu.plc_pcu_stats['password']}'
218 --insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
220 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
221 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
223 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
224 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
225 -s ${pcu_name(pcu.plc_pcu_stats)}
226 -u ${pcu.plc_pcu_stats['username']}
227 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
229 <span class="code" py:if="port == 16992 and state == 'open'">
230 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
231 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
232 -user admin -pass '${pcu.plc_pcu_stats['password']}'