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 <div py:if="len(sitequery) == 0">
16 <p>Your 'quick jump' query failed to find a matching site or hostname.</p>
17 <p>MyOps recognizes three types of expressions:
19 <li>Site names, e.g. princeton, utah, nyu, etc</li>
20 <li>Host names, e.g. planetlab-1.cs.princeton.edu, pl1.university.edu, etc</li>
21 <li>Prefix a pattern with "site:" or "node:" to return all sites or
22 nodes that match a pattern. e.g. site:mlab* node:*redclara*</li>
26 <div py:if="len(sitequery) != 0">
27 <h3 py:if="len(sitequery) > 0">Site Status</h3>
28 <table py:if="len(sitequery) > 0" id="sub-table" border="1" width="100%">
39 <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
40 <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
41 <td id="site-${site.status}" nowrap="true"><a class="ext-link" href="${plc_site_uri_id(site.plc_siteid)}">
42 <span class="icon">${site.loginbase}</span></a>
44 <td py:content="site.enabled"></td>
45 <td id="site-${site.penalty_level}">${site.penalty_level}</td>
46 <td>${site.slices_used}/${site.slices_total}</td>
47 <td nowrap="true" width="70em"><a href="${link('detailview', loginbase=site.loginbase)}">More Details</a></td>
51 <h3 py:if="len(pcuquery) != 0" >PCU Status</h3>
52 <table py:if="len(pcuquery) != 0" id="sortable_table" class="datagrid" border="1" width="100%">
62 <tr py:for="i,agg in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
63 <td id="site-${agg.pcuhist.status}" py:content="diff_time(mktime(agg.pcuhist.last_changed.timetuple()))"></td>
64 <td nowrap="true" id="status-${agg.status}">
65 <a class="ext-link" href="${plc_pcu_uri_id(agg.pcu.plc_pcu_stats['pcu_id'])}">
66 <span class="icon">${pcu_name(agg.pcu.plc_pcu_stats)}</span>
69 <td py:content="agg.pcu.plc_pcu_stats['model']"></td>
70 <td py:content="len(agg.pcu.plc_pcu_stats['node_ids'])"></td>
71 <td nowrap="true" width="70em"><a href="${link('detailview', pcuid=agg.pcu.plc_pcuid)}">More Details</a></td>
75 <div class="oneline" id="legend" py:if="len(pcuquery) == 0">
79 <p py:if="len(nodequery) == 0">
80 There are no registered nodes for this site.
82 <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
91 <tr py:for="i,agg in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
92 <td id="site-${agg.history.status}" py:content="diff_time(mktime(agg.history.last_changed.timetuple()))"></td>
93 <td id="node-${agg.node.observed_status}" nowrap="true" >
94 <a class="ext-link" href="${plc_node_uri_id(agg.node.plc_node_stats['node_id'])}">
95 <span class="icon">${agg.node.hostname}</span></a>
97 <td py:content="diff_time(mktime(agg.node.date_checked.timetuple()))"></td>
98 <td nowrap="true" width="70em"><a href="${link('detailview', hostname=agg.node.hostname)}">More Details</a></td>
102 <div class="error" py:if="exceptions is not None">
105 <div id="status_block" class="flash"
106 py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
108 ${actionlist_widget.display(since=since, actions=actions)}
109 <!-- TODO: figure out how to make this conditional by model rather than port;
110 it is convenient to have links to ilo, drac, amt, etc.
111 regardless of whether the last PCU scan was successful. -->
112 <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
113 <div py:if="len(pcuquery) != 0" class="code">
114 <span py:for="port,state in pcu.ports">
115 <span class="code" py:if="port == 22 and state == 'open'">
116 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
117 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
120 <span class="code" py:if="port == 23 and state == 'open'">
121 telnet ${pcu_name(pcu.plc_pcu_stats)}
124 <span class="code" py:if="port == 80 and state == 'open'">
125 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
128 <span class="code" py:if="port == 443 and state == 'open'">
130 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
132 curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
133 -form 'password=${pcu.plc_pcu_stats['password']}'
134 -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
136 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
137 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
139 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
140 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
141 -s ${pcu_name(pcu.plc_pcu_stats)}
142 -u ${pcu.plc_pcu_stats['username']}
143 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
145 <span class="code" py:if="port == 16992 and state == 'open'">
146 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
147 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
148 -user admin -pass '${pcu.plc_pcu_stats['password']}'