show build boxes uptime
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Tue, 26 Jan 2010 08:50:06 +0000 (08:50 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Tue, 26 Jan 2010 08:50:06 +0000 (08:50 +0000)
scripts/manage-infrastructure.py

index 4be91e4..ac8bd0f 100755 (executable)
@@ -58,16 +58,19 @@ class BuildBoxes:
         if not self.options.probe:
             self.reboot(box)
         else:
+            command=['ssh',self.root(box),'uptime']
+            uptime=self.backquote(command).strip()
+
             command=['ssh',self.root(box),'pgrep','build']
             if self.options.dry_run:
                 self.run(command,None)
             else:
                 pids=self.backquote(command)
                 if not pids:
-                    self.header ('No build process on %s'%box)
+                    self.header ('No build process on %s (%s)'%(box,uptime))
                 else:
                     command=['ssh',self.root(box),'ps','-o','pid,command'] + [ pid for pid in pids.split("\n") if pid]
-                    self.run(command,"Active build processes on %s"%box)
+                    self.run(command,"Active build processes on %s (%s)"%(box,uptime))
 
     vplc_matcher = re.compile(".*(vplc[0-9]+$)")
     def vplcname (self, vservername):