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 <h4>Actions Over the Last ${since} Days</h4>
109 <p py:if="actions and len(actions) == 0">
110 There are no recent actions taken for this site.
112 <table py:if="actions and len(actions) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
115 <th mochi:format="int"></th>
117 <th>Action taken on</th>
124 <tr py:for="i,act in enumerate(actions)" class="${i%2 and 'odd' or 'even'}" >
126 <td py:content="act.date_created"></td>
127 <td py:if="act.hostname is not None" nowrap="true" >
128 <a class="ext-link" href="${plc_node_uri(act.hostname)}">
129 <span class="icon">${act.hostname}</span></a>
131 <td py:if="act.hostname is None" nowrap="true">
132 <a class="ext-link" href="${plc_site_uri(act.loginbase)}">
133 <span class="icon">${act.loginbase}</span></a>
135 <!--td py : content="diff_time(mktime(node.date_checked.timetuple()))"></td-->
136 <td py:content="act.action_type"></td>
137 <td><a class="ext-link" href="${plc_mail_uri(act.message_id)}">
138 <span py:if="act.message_id != 0" class="icon">${act.message_id}</span></a></td>
139 <td py:if="'bootmanager' in act.action_type or 'unknown' in act.action_type">
140 <a href="/monitorlog/bm.${act.hostname}.log">latest bm log</a>
142 <td py:if="'bootmanager' not in act.action_type">
143 <pre py:content="act.error_string"></pre></td>
148 <!-- TODO: figure out how to make this conditional by model rather than port;
149 it is convenient to have links to ilo, drac, amt, etc.
150 regardless of whether the last PCU scan was successful. -->
151 <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
152 <div py:if="len(pcuquery) != 0" class="code">
153 <span py:for="port,state in pcu.ports">
154 <span class="code" py:if="port == 22 and state == 'open'">
155 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
156 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
159 <span class="code" py:if="port == 23 and state == 'open'">
160 telnet ${pcu_name(pcu.plc_pcu_stats)}
163 <span class="code" py:if="port == 80 and state == 'open'">
164 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
167 <span class="code" py:if="port == 443 and state == 'open'">
169 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
171 curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
172 -form 'password=${pcu.plc_pcu_stats['password']}'
173 -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
175 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
176 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
178 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
179 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
180 -s ${pcu_name(pcu.plc_pcu_stats)}
181 -u ${pcu.plc_pcu_stats['username']}
182 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
184 <span class="code" py:if="port == 16992 and state == 'open'">
185 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
186 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
187 -user admin -pass '${pcu.plc_pcu_stats['password']}'