add install_date field
Barış Metin [Tue, 20 Oct 2009 16:46:32 +0000 (16:46 +0000)]
monitor/database/info/findbad.py
monitor/scanapi.py
nodequery.py
upgrade/monitor-server-3.0-23.sql [new file with mode: 0644]
web/MonitorWeb/monitorweb/controllers.py
web/MonitorWeb/monitorweb/templates/node_template.kid
web/MonitorWeb/monitorweb/templates/nodescanhistory.kid

index d92e7e5..6d10dc8 100644 (file)
@@ -39,6 +39,7 @@ class FindbadNodeRecord(Entity):
        kernel_version = Field(String,default=None)
        bootcd_version = Field(String,default=None)
         boot_server = Field(String,default=None)
+        install_date = Field(String,default=None)
        nm_status = Field(String,default=None)
        fs_status = Field(String,default=None)
        iptables_status = Field(String,default=None)
index 327b2b4..16e1fd2 100644 (file)
@@ -238,6 +238,7 @@ class ScanNodeInternal(ScanInterface):
                                        echo '  "bmlog":"'`ls /tmp/bm.log`'",'
                                        echo '  "bootcd_version":"'`cat /mnt/cdrom/bootme/ID`'",'
                                        echo '  "boot_server":"'`cat /mnt/cdrom/bootme/BOOTSERVER`'",'
+                                       echo '  "install_date":"'`python -c "import os,time,stat; print time.ctime(os.stat('/usr/boot/plnode.txt')[stat.ST_CTIME])"`'",'
                                        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;}}'`'",'
@@ -262,6 +263,7 @@ EOF                 """)
                                else:
                                        values.update({'kernel_version': "", 'bmlog' : "", 'bootcd_version' : '', 
                                                                         'boot_server' : '',
+                                                                        'install_date' : '',
                                                                        'nm_status' : '', 
                                                                        'fs_status' : '',
                                                                        'uptime' : '',
index 85ff153..61513f4 100755 (executable)
@@ -38,6 +38,8 @@ def fb_print_nodeinfo(fbnode, hostname, fields=None):
                fbnode['bootcd_version'] = "unknown"
         if not fbnode['boot_server']:
                 fbnode['boot_server'] = "unknown"
+        if not fbnode['install_date']:
+                fbnode['install_date'] = "unknown"
        fbnode['pcu'] = color_pcu_state(fbnode)
 
        if not fields:
@@ -60,7 +62,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 | %(boot_server)s | %(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 | %(install_date)s | %(kernel_version)s" % fbnode
        else:
                format = ""
                for f in fields:
diff --git a/upgrade/monitor-server-3.0-23.sql b/upgrade/monitor-server-3.0-23.sql
new file mode 100644 (file)
index 0000000..96a93c1
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+ALTER TABLE findbadnoderecord ADD COLUMN install_date varchar DEFAULT NULL;\r
+ALTER TABLE findbadnoderecord_history ADD COLUMN install_date varchar DEFAULT NULL;\r
index 48ec3d2..74b2770 100644 (file)
@@ -54,6 +54,7 @@ class NodeQueryFields(widgets.WidgetsList):
        kernel_version = widgets.CheckBox(label="Kernel")
        bootcd_version = widgets.CheckBox(label="BootCD")
         boot_server = widgets.CheckBox(label="Boot Server")
+        install_date = widgets.CheckBox(label="Installation Date")
        observed_status = widgets.CheckBox(label="Observed Status")
        uptime = widgets.CheckBox(label="Uptime")
        traceroute = widgets.CheckBox(label="Traceroute")
index e8064a5..9ccb471 100644 (file)
@@ -16,6 +16,7 @@ from links import *
                <th>kernel</th>
                 <th>BootCD</th>
                 <th>Boot Server</th>
+                <th>Installation Date</th>
                <th>last_contact</th>
        </span>
        <span py:if="node is not None">
@@ -43,6 +44,7 @@ from links import *
                <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 nowrap="true" py:content="node.node.install_date"></td>
                <td  id="node-${node.node.observed_status}" py:content="diff_time(node.node.plc_node_stats['last_contact'])"></td>
        </span>
 </span>
index 7552114..b85f2e9 100644 (file)
@@ -63,6 +63,7 @@ from cherrypy import request, response
       <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">Installation Date</th>
       <th class="sortable plekit_table">Last_contact</th>
   </tr>
   </thead>
@@ -78,6 +79,7 @@ from cherrypy import request, response
                <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 nowrap="true" py:content="node.node.install_date"></td>
                <td  id="node-${node.node.observed_status}" py:content="diff_time(node.node.plc_node_stats['last_contact'])"></td>
        </span>
     </tr>