add history for pcu
change 'increase penalty' to 'reduce privilege'
-- PlanetLab Central (support@planet-lab.org)
""")
-- PlanetLab Central (support@planet-lab.org)
""")
- clear_penalty=("""MONTEST: All penalties cleared from site %(loginbase)s""",
+ clear_penalty=("""MONTEST: All privileges restored to site %(loginbase)s""",
-This notice is to let you know that any penalties previously applied to your
-site have been removed: %(penalty_level)s.
+This notice is to let you know that any privileges previously reduced at your
+site have been restored: %(penalty_level)s.
-All privileges have been restored. You may create slices again, and if your
+All privileges are restored. You may create slices again, and if your
slices were disabled, please allow up to 30 minutes for them to return to
enabled.
slices were disabled, please allow up to 30 minutes for them to return to
enabled.
2+ - all existing slices will be disabled.
""")
2+ - all existing slices will be disabled.
""")
- increase_penalty=("""MONTEST: Penalty increased for site %(loginbase)s""",
+ increase_penalty=("""MONTEST: Privilege reduced for site %(loginbase)s""",
-This notice is to let you know that the penalty applied to your site has
-increased: %(penalty_level)s.
+This notice is to let you know that the privileges granted to your site as
+a participating member of Planetlab have reduced: %(penalty_level)s.
Your privileges will be reduced corresponding to the legend below. To
restore these privileges, please return at least two machines to working
Your privileges will be reduced corresponding to the legend below. To
restore these privileges, please return at least two machines to working
return dict(sitequery=sitequery, pcuquery=pcuquery, nodequery=nodequery, actions=actions, exceptions=exceptions)
return dict(sitequery=sitequery, pcuquery=pcuquery, nodequery=nodequery, actions=actions, exceptions=exceptions)
+ @expose(template="monitorweb.templates.pcuhistory")
+ def pcuhistory(self, pcu_id=None):
+ query = []
+ if pcu_id:
+ fbnode = HistoryPCURecord.get_by(plc_pcuid=pcu_id)
+ l = fbnode.versions[-100:]
+ l.reverse()
+ for pcu in l:
+ #prep_node_for_display(node)
+ query.append(pcu)
+
+ return dict(query=query, pcu_id=pcu_id)
+
@expose(template="monitorweb.templates.nodehistory")
def nodehistory(self, hostname=None):
query = []
@expose(template="monitorweb.templates.nodehistory")
def nodehistory(self, hostname=None):
query = []
#site-offline { background-color: red; }\r
#site-down { background-color: indianred; }\r
\r
#site-offline { background-color: red; }\r
#site-down { background-color: indianred; }\r
\r
+#node-online { background-color : lightgreen; }\r
+#node-good { background-color : darkseagreen; }\r
+#node-offline { background-color: red; }\r
+#node-down { background-color: indianred; }\r
+\r
+#pcu-online { background-color : lightgreen; }\r
+#pcu-good { background-color : darkseagreen; }\r
+#pcu-offline { background-color: red; }\r
+#pcu-down { background-color: indianred; }\r
+\r
/*#site-0 { background-color : white; }*/\r
#site-1 { background-color: gold; }\r
#site-2 { background-color: indianred; }\r
/*#site-0 { background-color : white; }*/\r
#site-1 { background-color: gold; }\r
#site-2 { background-color: indianred; }\r
<td py:content="node.last_checked"></td>
<td nowrap="true">
<a target="_top" href="${link('pcuview', hostname=node.hostname)}" py:content="node.hostname">your.host.org</a></td>
<td py:content="node.last_checked"></td>
<td nowrap="true">
<a target="_top" href="${link('pcuview', hostname=node.hostname)}" py:content="node.hostname">your.host.org</a></td>
- <td py:content="node.status"></td>
+ <td id="node-${node.status}" py:content="node.status"></td>
<thead>
<tr>
<th mochi:format="int"></th>
<thead>
<tr>
<th mochi:format="int"></th>
<th>PCU Name</th>
<th>Missing Fields</th>
<th>PCU Name</th>
<th>Missing Fields</th>
+ <th nowrap='true'>DNS Status</th>
<th nowrap='true'>Port Status</th>
<th width="80%">Test Results</th>
<th>Model</th>
<th nowrap='true'>Port Status</th>
<th width="80%">Test Results</th>
<th>Model</th>
<tbody>
<tr py:for="i,pcu in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
<td></td>
<tbody>
<tr py:for="i,pcu in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
<td></td>
+ <td><a href="pcuhistory?pcu_id=${pcu.plc_pcuid}">history</a></td>
<td nowrap="true" >
<a class="ext-link" href="${plc_pcu_uri_id(pcu.plc_pcu_stats['pcu_id'])}">
<span class="icon">${pcu_name(pcu.plc_pcu_stats)}</span>
<td nowrap="true" >
<a class="ext-link" href="${plc_pcu_uri_id(pcu.plc_pcu_stats['pcu_id'])}">
<span class="icon">${pcu_name(pcu.plc_pcu_stats)}</span>
</td>
<td>
<!-- TODO: add some values/code to authenticate the operation. -->
</td>
<td>
<!-- TODO: add some values/code to authenticate the operation. -->
- <form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
+ <!--form action="${link('pcuview', hostname=node.hostname)}" name="externalscan${i}" method='post'>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='ExternalScan' />
</form>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='ExternalScan' />
</form>
- <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a>
+ <a onclick='document.externalscan${i}.submit();' href="javascript: void(1);">ExternalScan</a-->
</td>
<td>
<!-- TODO: add some values/code to authenticate the operation. -->
</td>
<td>
<!-- TODO: add some values/code to authenticate the operation. -->
- <form action="${link('pcuview', hostname=node.hostname)}" name="internalscan${i}" method='post'>
+ <!--form action="${link('pcuview', hostname=node.hostname)}" name="internalscan${i}" method='post'>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='InternalScan' />
</form>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='InternalScan' />
</form>
- <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a>
+ <a onclick='javascript: document.internalscan${i}.submit();' href="javascript: void(1);">InternalScan</a-->
</td>
<td py:if="len(pcuquery) > 0">
<!-- TODO: add some values/code to authenticate the operation. -->
</td>
<td py:if="len(pcuquery) > 0">
<!-- TODO: add some values/code to authenticate the operation. -->
- <form action="${link('pcuview', pcuid=pcu.plc_pcuid)}" name="reboot${i}" method='post'>
+ <!--form action="${link('pcuview', pcuid=pcu.plc_pcuid)}" name="reboot${i}" method='post'>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='Reboot' />
</form>
<input type='hidden' name='hostname' value='${node.hostname}'/>
<input type='hidden' name='type' value='Reboot' />
</form>
- <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a>
+ <a onclick='javascript: document.reboot${i}.submit();' href="javascript: void(1);">Reboot</a-->
<!-- TODO: figure out how to make this conditional by model rather than port;
it is convenient to have links to ilo, drac, amt, etc.
regardless of whether the last PCU scan was successful. -->
<!-- TODO: figure out how to make this conditional by model rather than port;
it is convenient to have links to ilo, drac, amt, etc.
regardless of whether the last PCU scan was successful. -->
- <h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
- <div py:if="len(pcuquery) != 0" class="code"> <!-- pcu is not None" class="code"-->
+ <!--h4 py:if="len(pcuquery) != 0">Convenience Calls</h4>
+ <div py:if="len(pcuquery) != 0" class="code">
<span py:for="port,state in pcu.ports">
<span class="code" py:if="port == 22 and state == 'open'">
ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
<span py:for="port,state in pcu.ports">
<span class="code" py:if="port == 22 and state == 'open'">
ssh -o PasswordAuthentication=yes -o PubkeyAuthentication=no
<br/>
<a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
<br/>
<br/>
<a href="https://${pcu_name(pcu.plc_pcu_stats)}">https://${pcu_name(pcu.plc_pcu_stats)}</a>
<br/>
- curl -s --form 'user=${pcu.plc_pcu_stats['username']}'
- --form 'password=${pcu.plc_pcu_stats['password']}'
- --insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
+ curl -s -form 'user=${pcu.plc_pcu_stats['username']}'
+ -form 'password=${pcu.plc_pcu_stats['password']}'
+ -insecure https://${pcu_name(pcu.plc_pcu_stats)}/cgi-bin/webcgi/index
<br/>
/usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
-u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
<br/>
/usr/share/monitor/pcucontrol/models/racadm.py -r ${pcu.plc_pcu_stats['ip']}
-u ${pcu.plc_pcu_stats['username']} -p '${pcu.plc_pcu_stats['password']}'
-user admin -pass '${pcu.plc_pcu_stats['password']}'
</span>
</span>
-user admin -pass '${pcu.plc_pcu_stats['password']}'
</span>
</span>