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%">
27 <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
28 <td id="site-${site.status}" py:content="diff_time(mktime(site.last_changed.timetuple()))"></td>
29 <td id="site-${site.status}" nowrap="true"><a class="ext-link" href="${plc_site_uri_id(site.plc_siteid)}">
30 <span class="icon">${site.loginbase}</span></a>
32 <td py:content="site.enabled"></td>
33 <td id="site-${site.penalty_level}">${site.penalty_level}</td>
34 <td>${site.slices_used}/${site.slices_total}</td>
35 <td nowrap="true" width="70em"><a href="${link('detailview', loginbase=site.loginbase)}">More Details</a></td>
39 <h3 py:if="len(pcuquery) != 0" >PCU Status</h3>
40 <table py:if="len(pcuquery) != 0" id="sortable_table" class="datagrid" border="1" width="100%">
50 <tr py:for="i,agg in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
51 <td id="site-${agg.pcuhist.status}" py:content="diff_time(mktime(agg.pcuhist.last_changed.timetuple()))"></td>
52 <td nowrap="true" id="status-${agg.status}">
53 <a class="ext-link" href="${plc_pcu_uri_id(agg.pcu.plc_pcu_stats['pcu_id'])}">
54 <span class="icon">${pcu_name(agg.pcu.plc_pcu_stats)}</span>
57 <td py:content="agg.pcu.plc_pcu_stats['model']"></td>
58 <td py:content="len(agg.pcu.plc_pcu_stats['node_ids'])"></td>
59 <td nowrap="true" width="70em"><a href="${link('detailview', loginbase=site.loginbase)}">More Details</a></td>
63 <div class="oneline" id="legend" py:if="len(pcuquery) == 0">
64 <em>There are no PCUs associated with this host.</em>
67 <p py:if="len(nodequery) == 0">
68 There are no registered nodes for this site.
70 <table py:if="len(nodequery) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
79 <tr py:for="i,agg in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
80 <td id="site-${agg.history.status}" py:content="diff_time(mktime(agg.history.last_changed.timetuple()))"></td>
81 <td id="node-${agg.node.observed_status}" nowrap="true" >
82 <a class="ext-link" href="${plc_node_uri_id(agg.node.plc_node_stats['node_id'])}">
83 <span class="icon">${agg.node.hostname}</span></a>
85 <td py:content="diff_time(mktime(agg.node.date_checked.timetuple()))"></td>
86 <td nowrap="true" width="70em"><a href="${link('detailview', loginbase=site.loginbase)}">More Details</a></td>
90 <div class="error" py:if="exceptions is not None">
93 <div id="status_block" class="flash"
94 py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
96 <h4>Actions Over the Last ${since} Days</h4>
97 <p py:if="actions and len(actions) == 0">
98 There are no recent actions taken for this site.
100 <table py:if="actions and len(actions) > 0" id="sortable_table" class="datagrid" border="1" width="100%">
103 <th mochi:format="int"></th>
105 <th>Action taken on</th>
112 <tr py:for="i,act in enumerate(actions)" class="${i%2 and 'odd' or 'even'}" >
114 <td py:content="act.date_created"></td>
115 <td py:if="act.hostname is not None" nowrap="true" >
116 <a class="ext-link" href="${plc_node_uri(act.hostname)}">
117 <span class="icon">${act.hostname}</span></a>
119 <td py:if="act.hostname is None" nowrap="true">
120 <a class="ext-link" href="${plc_site_uri(act.loginbase)}">
121 <span class="icon">${act.loginbase}</span></a>
123 <!--td py : content="diff_time(mktime(node.date_checked.timetuple()))"></td-->
124 <td py:content="act.action_type"></td>
125 <td><a class="ext-link" href="${plc_mail_uri(act.message_id)}">
126 <span py:if="act.message_id != 0" class="icon">${act.message_id}</span></a></td>
127 <td py:if="'bootmanager' in act.action_type or 'unknown' in act.action_type">
128 <a href="/monitorlog/bm.${act.hostname}.log">latest bm log</a>
130 <td py:if="'bootmanager' not in act.action_type">
131 <pre py:content="act.error_string"></pre></td>
136 <!-- TODO: figure out how to make this conditional by model rather than port;
137 it is convenient to have links to ilo, drac, amt, etc.
138 regardless of whether the last PCU scan was successful. -->
139 <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
140 <div py:if="len(pcuquery) != 0" class="code">
141 <span py:for="port,state in pcu.ports">
142 <span class="code" py:if="port == 22 and state == 'open'">
143 ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
144 ${pcu.plc_pcu_stats['username']}@${pcu_name(pcu.plc_pcu_stats)}
147 <span class="code" py:if="port == 23 and state == 'open'">
148 telnet ${pcu_name(pcu.plc_pcu_stats)}
151 <span class="code" py:if="port == 80 and state == 'open'">
152 <a href="http://${pcu_name(pcu.plc_pcu_stats)}">http://${pcu_name(pcu.plc_pcu_stats)}</a>
155 <span class="code" py:if="port == 443 and state == 'open'">
157 <a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
159 curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
160 -form 'password=${pcu.plc_pcu_stats['password']}'
161 -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
163 /usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
164 -u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
166 /usr/share/monitor/pcucontrol/models/hpilo/locfg.pl
167 -f /usr/share/monitor/pcucontrol/models/hpilo/iloxml/Reset_Server.xml
168 -s ${pcu_name(pcu.plc_pcu_stats)}
169 -u ${pcu.plc_pcu_stats['username']}
170 -p '${pcu.plc_pcu_stats['password']} ' | grep MESSAGE"
172 <span class="code" py:if="port == 16992 and state == 'open'">
173 /usr/share/monitor/pcucontrol/models/intelamt/remoteControl -A
174 -verbose 'http://${pcu_name(pcu.plc_pcu_stats)}:16992/RemoteControlService'
175 -user admin -pass '${pcu.plc_pcu_stats['password']}'