- fix UP/DOWN summary on nodes page.
Barış Metin [Thu, 15 Oct 2009 11:13:04 +0000 (11:13 +0000)]
- make node page display all nodes by default
- add boot_server field
- add myops_ssh_key to the keychain

automate-default.sh
monitor/database/info/findbad.py
monitor/scanapi.py
nodequery.py
upgrade/monitor-server-3.0-22.sql [new file with mode: 0644]
web/MonitorWeb/dev.cfg
web/MonitorWeb/monitorweb/controllers.py
web/MonitorWeb/monitorweb/templates/node_template.kid
web/MonitorWeb/monitorweb/templates/nodefast.kid
web/MonitorWeb/monitorweb/templates/nodelist.kid
web/MonitorWeb/monitorweb/templates/nodescanhistory.kid

index 9f0f9d1..3e65fcf 100755 (executable)
@@ -56,6 +56,7 @@ if [ -z "$AGENT" ] ; then
         # if no agent is running, set it up.
         ssh-agent > ${MONITOR_SCRIPT_ROOT}/agent.sh
         source ${MONITOR_SCRIPT_ROOT}/agent.sh
+        ssh-add /etc/planetlab/myops_ssh_key.rsa
         ssh-add /etc/planetlab/debug_ssh_key.rsa
         ssh-add /etc/planetlab/root_ssh_key.rsa
 fi
index 2f9251e..d92e7e5 100644 (file)
@@ -38,6 +38,7 @@ class FindbadNodeRecord(Entity):
 # INTERNAL
        kernel_version = Field(String,default=None)
        bootcd_version = Field(String,default=None)
+        boot_server = Field(String,default=None)
        nm_status = Field(String,default=None)
        fs_status = Field(String,default=None)
        iptables_status = Field(String,default=None)
index 119f7fd..327b2b4 100644 (file)
@@ -237,6 +237,7 @@ class ScanNodeInternal(ScanInterface):
                                        echo '  "kernel_version":"'`uname -a`'",'
                                        echo '  "bmlog":"'`ls /tmp/bm.log`'",'
                                        echo '  "bootcd_version":"'`cat /mnt/cdrom/bootme/ID`'",'
+                                       echo '  "boot_server":"'`cat /mnt/cdrom/bootme/BOOTSERVER`'",'
                                        echo '  "nm_status":"'`ps ax | grep nm.py | grep -v grep`'",'
                                        echo '  "dns_status":"'`host boot.planet-lab.org 2>&1`'",'
                                        echo '  "iptables_status":"'`iptables -t mangle -nL | awk '$1~/^[A-Z]+$/ {modules[$1]=1;}END{for (k in modules) {if (k) printf "%s ",k;}}'`'",'
@@ -260,6 +261,7 @@ EOF                 """)
                                        break
                                else:
                                        values.update({'kernel_version': "", 'bmlog' : "", 'bootcd_version' : '', 
+                                                                        'boot_server' : '',
                                                                        'nm_status' : '', 
                                                                        'fs_status' : '',
                                                                        'uptime' : '',
index c78d6b4..85ff153 100755 (executable)
@@ -36,6 +36,8 @@ def fb_print_nodeinfo(fbnode, hostname, fields=None):
                fbnode['bootcd_version'] = fbnode['bootcd_version'].split()[-1]
        else:
                fbnode['bootcd_version'] = "unknown"
+        if not fbnode['boot_server']:
+                fbnode['boot_server'] = "unknown"
        fbnode['pcu'] = color_pcu_state(fbnode)
 
        if not fields:
@@ -58,7 +60,7 @@ def fb_print_nodeinfo(fbnode, hostname, fields=None):
                        #print "ERROR!!!!!!!!!!!!!!!!!!!!!"
                        pass
 
-               print "%(hostname)-45s | %(date_checked)11.11s | %(boot_state)5.5s| %(observed_status)8.8s | %(ssh_status)5.5s | %(pcu)6.6s | %(bootcd_version)6.6s | %(kernel_version)s" % fbnode
+               print "%(hostname)-45s | %(date_checked)11.11s | %(boot_state)5.5s| %(observed_status)8.8s | %(ssh_status)5.5s | %(pcu)6.6s | %(bootcd_version)6.6s | %(boot_server)s | %(kernel_version)s" % fbnode
        else:
                format = ""
                for f in fields:
diff --git a/upgrade/monitor-server-3.0-22.sql b/upgrade/monitor-server-3.0-22.sql
new file mode 100644 (file)
index 0000000..9b8fc4d
--- /dev/null
@@ -0,0 +1,5 @@
+-- If there's an existing database, these commands will upgrade it to the\r
+-- current version\r
+\r
+ALTER TABLE findbadnoderecord ADD COLUMN boot_server varchar DEFAULT NULL;\r
+ALTER TABLE findbadnoderecord_history ADD COLUMN boot_server varchar DEFAULT NULL;\r
index 74cfff6..f165f42 100644 (file)
@@ -31,7 +31,7 @@ server.environment="development"
 autoreload.package="monitorweb"
 
 
-server.socket_host="monitor.planet-lab.org"
+server.socket_host="www.planet-lab.eu"
 server.socket_port=8082
 #server.webpath="/monitor/"
 #base_url_filter.on = False
index b284851..48ec3d2 100644 (file)
@@ -53,6 +53,7 @@ class NodeQueryFields(widgets.WidgetsList):
        external_dns_status = widgets.CheckBox(label="Hostname Resolves?")
        kernel_version = widgets.CheckBox(label="Kernel")
        bootcd_version = widgets.CheckBox(label="BootCD")
+        boot_server = widgets.CheckBox(label="Boot Server")
        observed_status = widgets.CheckBox(label="Observed Status")
        uptime = widgets.CheckBox(label="Uptime")
        traceroute = widgets.CheckBox(label="Traceroute")
index c50a745..e8064a5 100644 (file)
@@ -15,6 +15,7 @@ from links import *
                <th>pcu</th>
                <th>kernel</th>
                 <th>BootCD</th>
+                <th>Boot Server</th>
                <th>last_contact</th>
        </span>
        <span py:if="node is not None">
@@ -41,6 +42,7 @@ from links import *
                </td>
                <td nowrap="true" py:content="node.kernel"></td>
                <td nowrap="true" py:content="node.node.bootcd_version"></td>
+               <td nowrap="true" py:content="node.node.boot_server"></td>
                <td  id="node-${node.node.observed_status}" py:content="diff_time(node.node.plc_node_stats['last_contact'])"></td>
        </span>
 </span>
index 97072d2..253dc2f 100644 (file)
@@ -17,16 +17,16 @@ from links import *
   </script>
 
   <center>
-  <b py:content="'BOOT: %d' % len([agg for agg in query if agg.node.status == 'good'])"></b> | 
-  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.status == 'down'])"></b><br/>
+  <b py:content="'UP: %d' % len([agg for agg in query if agg.node.status in ('online', 'good')])"></b> | 
+  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.status not in ('online', 'good')])"></b><br/>
   </center>
 
-<table id="nodelist" cellpadding="0" border="0" class="plekit_table sortable-onload-2 colstyle-alt no-arrow paginationcallback-nodelist_paginator max-pages-10 paginate-25">
+<table id="nodelist" cellpadding="0" border="0" class="plekit_table sortable-onload-2 colstyle-alt no-arrow paginationcallback-nodelist_paginator max-pages-10 paginate-999">
   <thead>
 
     <tr class='pagesize_area'><td class='pagesize_area' colspan='10'>
         <form class='pagesize' action='satisfy_xhtml_validator'><fieldset>
-            <input class='pagesize_input' type='text' id="nodelist_pagesize" value='25'
+            <input class='pagesize_input' type='text' id="nodelist_pagesize" value='999'
                    onkeyup='plekit_pagesize_set("nodelist","nodelist_pagesize", 25);' 
                    size='3' maxlength='3' />                                                          
             <label class='pagesize_label'> items/page </label>                                     
index e32b92d..771d6b4 100644 (file)
@@ -17,8 +17,8 @@ from links import *
   </script>
 
   <center>
-  <b py:content="'BOOT: %d' % len([agg for agg in query if agg.node.observed_status == 'BOOT'])"></b> | 
-  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.observed_status == 'DOWN'])"></b><br/>
+  <b py:content="'UP: %d' % len([agg for agg in query if agg.node.status in ('online', 'good')])"></b> | 
+  <b py:content="'DOWN: %d' % len([agg for agg in query if agg.node.status not in ('online', 'good')])"></b><br/>
   </center>
 
 <table id="nodelist" cellpadding="0" border="0" class="plekit_table sortable-onload-2 colstyle-alt no-arrow paginationcallback-nodelist_paginator max-pages-10 paginate-25">
@@ -58,6 +58,7 @@ from links import *
       <th class="sortable plekit_table">pcu</th>
       <th class="sortable plekit_table">kernel</th>
       <th class="sortable plekit_table">BootCD</th>
+      <th class="sortable plekit_table">Boot Server</th>
       <th class="sortable-sortLastContact plekit_table">Last_contact</th>
   </tr>
   </thead>
index 3c9f84b..7552114 100644 (file)
@@ -62,6 +62,7 @@ from cherrypy import request, response
       <th class="sortable plekit_table">Stat</th>
       <th class="sortable plekit_table">kernel</th>
       <th class="sortable plekit_table">BootCD</th>
+      <th class="sortable plekit_table">Boot Server</th>
       <th class="sortable plekit_table">Last_contact</th>
   </tr>
   </thead>
@@ -76,6 +77,7 @@ from cherrypy import request, response
                 <td py:content="node.node.plc_node_stats['boot_state']">boot</td>
                <td nowrap="true" py:content="node.kernel"></td>
                <td nowrap="true" py:content="node.node.bootcd_version"></td>
+               <td nowrap="true" py:content="node.node.boot_server"></td>
                <td  id="node-${node.node.observed_status}" py:content="diff_time(node.node.plc_node_stats['last_contact'])"></td>
        </span>
     </tr>