Author: justi9
Date: 2008-12-11 13:26:21 -0500 (Thu, 11 Dec 2008)
New Revision: 2976
Modified:
mgmt/trunk/cumin/python/cumin/system.py
mgmt/trunk/cumin/python/cumin/system.strings
Log:
Add more columns to the systems table
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-11 18:18:44 UTC (rev 2975)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-11 18:26:21 UTC (rev 2976)
@@ -21,6 +21,16 @@
self.add_column(col)
self.set_default_column(col)
+ col = self.KernelColumn(app, "kernel")
+ self.add_column(col)
+
+ col = self.ArchColumn(app, "arch")
+ self.add_column(col)
+
+ col = self.FreeMemoryColumn(app, "mem_free")
+ col.alignment = "right"
+ self.add_column(col)
+
col = self.LoadColumn(app, "load")
col.alignment = "right"
self.add_column(col)
@@ -37,12 +47,27 @@
href = self.page.main.system.get_href(session, system)
return fmt_link(href, fmt_shorten(data["name"]))
+ class KernelColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Kernel"
+
+ class ArchColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Arch"
+
+ class FreeMemoryColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Free Memory"
+
+ def render_content(self, session, data):
+ return "%i KB" % data["mem_free"]
+
class LoadColumn(SqlTableColumn):
def render_title(self, session, data):
return "Load Average"
def render_content(self, session, data):
- return "%0.3f" % data["load_average1_min"]
+ return "%0.3f" % data["load"]
class TopSystemSet(TopTable):
def __init__(self, app, name):
Modified: mgmt/trunk/cumin/python/cumin/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.strings 2008-12-11 18:18:44 UTC (rev 2975)
+++ mgmt/trunk/cumin/python/cumin/system.strings 2008-12-11 18:26:21 UTC (rev 2976)
@@ -1,5 +1,11 @@
[SystemSet.sql]
-select s.id, s.node_name as name, c.load_average1_min
+select
+ s.id,
+ s.node_name as name,
+ (s.os_name || ' ' || s.release) as kernel,
+ s.machine as arch,
+ c.mem_free,
+ c.load_average1_min as load
from sysimage as s
left outer join sysimage_stats as c on c.id = s.stats_curr_id
{sql_orderby}