added action list, for any current acknowledged problems, as well as un-acknowledged...
authorStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 4 Dec 2008 23:29:00 +0000 (23:29 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 4 Dec 2008 23:29:00 +0000 (23:29 +0000)
added and a view page for displaying, site, node, & pcu details
modified sitelist to reference the siteview page.

web/MonitorWeb/monitorweb/templates/actionlist.kid [new file with mode: 0644]
web/MonitorWeb/monitorweb/templates/nodeview.kid [new file with mode: 0644]
web/MonitorWeb/monitorweb/templates/pcuview.kid [new file with mode: 0644]
web/MonitorWeb/monitorweb/templates/sitelist.kid
web/MonitorWeb/monitorweb/templates/siteview.kid [new file with mode: 0644]

diff --git a/web/MonitorWeb/monitorweb/templates/actionlist.kid b/web/MonitorWeb/monitorweb/templates/actionlist.kid
new file mode 100644 (file)
index 0000000..843906a
--- /dev/null
@@ -0,0 +1,66 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+layout_params['page_title'] = "Monitor Node View"
+from monitor.util import diff_time
+from monitor import config
+from time import mktime
+
+def zabbix_event_ack_link(eventid):
+       return "http://" + config.MONITOR_HOSTNAME + "/zabbix/acknow.php?eventid=" + str(eventid)
+
+?>
+<html py:layout="'sitemenu.kid'"
+      xmlns:py="http://purl.org/kid/ns#"
+         xmlns:mochi="http://www.mochi.org">
+
+  <div py:match="item.tag == 'content'">
+       <table width="100%">
+               <thead>
+                       <tr>
+                               <th></th>
+                               <th><a href="${tg.url('action', filter='active')}">Not Acknowledged(${fc['active']})</a></th>
+                               <th><a href="${tg.url('action', filter='acknowledged')}">Acknowledged(${fc['acknowledged']})</a></th>
+                               <th><a href="${tg.url('action', filter='all')}">All(${fc['all']})</a></th>
+                       </tr>
+               </thead>
+               <tbody>
+               <tr>
+               <td colspan="5">
+               <table id="sortable_table" class="datagrid" border="1" width="100%">
+                       <thead>
+                               <tr>
+                                       <th mochi:format="int"></th>
+                                       <th mochi:format="str">Site</th>
+                                       <th>Hostname</th>
+                                       <th>Issue (severity)</th>
+                                       <th>Last change</th>
+                                       <th>Notes (acknowledged)</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <tr py:for="i,node in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
+                                       <td></td>
+                                       <td><a href="siteview?loginbase=${node[0]}">${node[0]}</a></td>
+                                       <td nowrap="true" py:content="node[1]"></td>
+                                       <td nowrap='true' id="severity-${node[3]}" py:content="node[2]"></td>
+                                       <td nowrap='true' py:content="diff_time(int(node[4]))"></td>
+                                       <?python
+                                               try:
+                                                       int(node[5])
+                                                       val = True
+                                               except:
+                                                       val = False
+                                       ?>
+                                       <!-- NOTE: only one of the next two columns will be displayed. -->
+                                       <td py:if="val"><a href="${zabbix_event_ack_link(node[5])}">Provide Ack</a></td>
+                                       <td py:if="not val" py:content="node[5]">Message from user</td>
+                               </tr>
+                       </tbody>
+               </table>
+               </td>
+               </tr>
+               </tbody>
+       </table>
+  </div>
+
+</html>
diff --git a/web/MonitorWeb/monitorweb/templates/nodeview.kid b/web/MonitorWeb/monitorweb/templates/nodeview.kid
new file mode 100644 (file)
index 0000000..704ec24
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+layout_params['page_title'] = "Monitor Site View"
+from monitor.util import diff_time
+?>
+<html  py:layout="'sitemenu.kid'"
+       xmlns:py="http://purl.org/kid/ns#"
+       xmlns:mochi="http://www.mochi.org">
+
+  <div py:match="item.tag == 'content'">
+    <h3>Node Status</h3>
+               <table id="sortable_table" class="datagrid" border="1" width="100%">
+                       <thead>
+                               <tr>
+                                       <th mochi:format="int"></th>
+                                       <th mochi:format="str">Site</th>
+                                       <th>Hostname</th>
+                                       <th>ping</th>
+                                       <!--th>ssh</th-->
+                                       <th>pcu</th>
+                                       <th>kernel</th>
+                                       <th>last_contact</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
+                                       <td></td>
+                                       <td><a href="">${node.loginbase}</a></td>
+                                       <td id="node-${node.observed_status}" nowrap="true" py:content="node.hostname"></td>
+                                       <td py:content="node.ping_status"></td>
+                                       <td id="status-${node.pcu_short_status}"><a href="pcuview?pcuid=${node.plc_node_stats['pcu_ids']}" py:content="node.pcu_short_status"></a></td>
+                                       <td nowrap="true" py:content="node.kernel"></td>
+                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
+                               </tr>
+                       </tbody>
+               </table>
+    <h3 py:if="node.pcu_short_status != 'none'">PCU Status</h3>
+    <h3>Actions Taken</h3>
+  </div>
+
+</html>
diff --git a/web/MonitorWeb/monitorweb/templates/pcuview.kid b/web/MonitorWeb/monitorweb/templates/pcuview.kid
new file mode 100644 (file)
index 0000000..e060b77
--- /dev/null
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+layout_params['page_title'] = "Monitor Site View"
+from monitor.util import diff_time
+from monitor import config
+from pcucontrol.reboot import pcu_name, model_to_object
+def plc_site_link(pcu):
+       return "https://" + config.PLC_WEB_HOSTNAME + "/db/sites/index.php?id=" + str(pcu['site_id'])
+def pcu_link(pcu):
+       return "https://" + config.PLC_WEB_HOSTNAME + "/db/sites/pcu.php?id=" + str(pcu['pcu_id'])
+?>
+<html py:layout="'sitemenu.kid'"
+      xmlns:py="http://purl.org/kid/ns#"
+         xmlns:mochi="http://www.mochi.org">
+
+  <div py:match="item.tag == 'content'">
+    <h3>PCU Status</h3>
+               <table id="sortable_table" class="datagrid" border="1" width="100%">
+                       <thead>
+                               <tr>
+                                       <th mochi:format="int"></th>
+                                       <th mochi:format="str">Site</th>
+                                       <th>PCU Name</th>
+                                       <th>Missing Fields</th>
+                                       <th>DNS Status</th>
+                                       <th>Port Status</th>
+                                       <th width="80%">Test Results</th>
+                                       <th>Model</th>
+                                       <th>Nodes</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <tr py:for="i,node in enumerate(pcuquery)" class="${i%2 and 'odd' or 'even'}" >
+                                       <td></td>
+                                       <td><a href="${plc_site_link(node.plc_pcu_stats)}">${node.loginbase}</a></td>
+                                       <td nowrap="true" >
+                                               <a href="${pcu_link(node.plc_pcu_stats)}">${pcu_name(node.plc_pcu_stats)}</a></td>
+                                       <td py:content="node.entry_complete"></td>
+                                       <td id="dns-${node.dns_status}" py:content="node.dns_status"></td>
+                                       <td>
+                                               <span py:for="port,state in node.ports" 
+                                               id="port${state}" py:content="'%s, ' % port">80</span>
+                                       </td>
+                                       <td width="40" id="status-${node.status}" py:content="node.reboot_trial_status"></td>
+                                       <td py:content="node.plc_pcu_stats['model']"></td>
+                                       <td py:content="len(node.plc_pcu_stats['node_ids'])"></td>
+                               </tr>
+                       </tbody>
+               </table>
+
+       <h3>Legends</h3>
+       <table border="1" align="center">
+               <tr><th colspan="2">Legend for 'DNS Status'</th></tr>
+
+               <tr><td id="dns-DNS-OK">DNS-OK</td>
+                       <td>This indicates that the DNS name and registered IP address match.</td>
+               </tr>
+               <tr><td id="dns-DNS-MISMATCH">DNS-MISMATCH</td>
+                       <td>Sometimes, the registered IP and DNS IP address do not match.  
+                               In these cases it is not clear which is correct, 
+                               so an error is flagged.</td>
+               </tr>
+               <tr><td id="dns-DNS-NOENTRY">DNS-NOENTRY</td>
+                       <td>While a hostname is provided in the registration, the hostname is not actually registered in DNS.</td>
+               </tr>
+               <tr><td id="dns-NOHOSTNAME">NOHOSTNAME</td>
+                       <td>While we prefer that a hostname be registered, it is not
+                       strictly required, since simply the IP address, if it is static, is enough to access the PCU.</td>
+               </tr>
+               <tr><td>&nbsp;</td></tr>
+       <!--/table>
+       <table border=1-->
+               <tr><th colspan="2">Legend for 'Port Status'</th></tr>
+
+               <tr><td id="portopen">Open</td>
+                       <td>Green port numbers are believed to be open.</td>
+               </tr>
+               <tr><td id="portfiltered">Filtered</td>
+                       <td>Gold port numbers are believed to be filtered or simply offline.</td>
+               </tr>
+               <tr><td id="portclosed">Closed</td>
+                       <td>Finally, red ports appear to be closed.</td>
+               </tr>
+               <tr><td>&nbsp;</td></tr>
+       <!--/table>
+       <table border=1-->
+               <tr><th colspan="2">Legend for 'Test Results'</th></tr>
+
+               <tr><td id="status-0">OK</td>
+                       <td>The PCU is accessible, and short of actually rebooting the node, everything appears to work.</td>
+               </tr>
+               <tr><td id="status-NetDown">NetDown</td>
+                       <td>The PCU is inaccessible from the PlanetLab address block 128.112.139.0/25, or it is simply offline.</td>
+               </tr>
+               <tr><td id="status-Not_Run">Not_Run</td>
+                       <td>Previous errors, such as DNS or an incomplete configuration prevented the actual test from begin performed.</td>
+               </tr>
+               <tr><td id="status-error">Other Errors</td>
+                       <td>Other errors are reported by the test that are more specific to the block encountered by the script.</td>
+               </tr>
+       </table>
+
+  </div>
+
+</html>
index 8460d5d..ab24355 100644 (file)
@@ -30,7 +30,7 @@ layout_params['page_title'] = "Monitor Site View"
                        </thead>
                        <tbody>
                                <tr py:for="i,site in enumerate(query)" class="${i%2 and 'odd' or 'even'}" >
-                                 <td nowrap="true"><a href="">${site.loginbase}</a></td>
+                                 <td nowrap="true"><a href="siteview?loginbase=${site.loginbase}">${site.loginbase}</a></td>
                                  <td id="site-${site.status}" py:content="site.last_changed"></td>
                                  <td>${site.slices_used}/${site.slices_total}</td>
                                  <td>${site.nodes_up} / ${site.nodes_total}</td>
diff --git a/web/MonitorWeb/monitorweb/templates/siteview.kid b/web/MonitorWeb/monitorweb/templates/siteview.kid
new file mode 100644 (file)
index 0000000..abbcfe2
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?python
+layout_params['page_title'] = "Monitor Site View"
+from monitor.util import diff_time
+?>
+<html py:layout="'sitemenu.kid'"
+      xmlns:py="http://purl.org/kid/ns#"
+         xmlns:mochi="http://www.mochi.org">
+
+  <div py:match="item.tag == 'content'">
+    <h3>Site Status</h3>
+               <table id="sub-table" border="1" width="100%">
+                       <thead>
+                               <tr>
+                                       <th>Site name</th>
+                                       <th>Status</th>
+                                       <th>Enabled</th>
+                                       <th>Slices (created / max)</th>
+                                       <th>Nodes (online / registered)</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <tr py:for="i,site in enumerate(sitequery)" class="${i%2 and 'odd' or 'even'}" >
+                                 <td nowrap="true"><a href="">${site.loginbase}</a></td>
+                                 <td id="site-${site.status}" py:content="site.last_changed"></td>
+                                 <td py:content="site.enabled"></td>
+                                 <td>${site.slices_used}/${site.slices_total}</td>
+                                 <td>${site.nodes_up} / ${site.nodes_total}</td>
+                               </tr>
+                       </tbody>
+               </table>
+    <h3>Node List</h3>
+               <table id="sortable_table" class="datagrid" border="1" width="100%">
+                       <thead>
+                               <tr>
+                                       <th mochi:format="int"></th>
+                                       <th>Hostname</th>
+                                       <th>ping</th>
+                                       <!--th>ssh</th-->
+                                       <th>pcu</th>
+                                       <th>kernel</th>
+                                       <th>last_contact</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <tr py:for="i,node in enumerate(nodequery)" class="${i%2 and 'odd' or 'even'}" >
+                                       <td></td>
+                                       <td id="node-${node.observed_status}" nowrap="true"><a href="nodeview?hostname=${node.hostname}" py:content="node.hostname">your.host.org</a></td>
+                                       <td py:content="node.ping_status"></td>
+                                       <td id="status-${node.pcu_short_status}" py:content="node.pcu_short_status"></td>
+                                       <td nowrap="true" py:content="node.kernel"></td>
+                                       <td py:content="diff_time(node.plc_node_stats['last_contact'])"></td>
+                               </tr>
+                       </tbody>
+               </table>
+  </div>
+
+</html>