Diff for /checkStation/checkStation.py between versions 1.4 and 1.5

version 1.4, 2005/05/15 11:02:01 version 1.5, 2005/05/15 12:12:15
Line 6  import os Line 6  import os
 import os.path  import os.path
 import time  import time
   
 module_list=['11150','11220','11240','11340','12010','13110','13210','13310','13500','20610','21210','21600','22310','23110','24110','24212','24231','24241','24251','24321','24341','24411','24421','24431','24441','24511','24521','30511','31111','31120','31131','31142','31151','31161','31171','31211','31221','31231','31252','31305','31410','32010','33100']  module_list=['11150','11220','11240','11340','12010','13110','13210','13310','13500','20610','21210','21600','22310','23110','24110','24212','24231','24241','24251','24321','24341','24411','24421','24431','24441','24511','24521','30511','31111','31120','31131','31142','31151','31161','31171','31221','31231','31252','31305','31410','32010','33100']
   
   # station non checked: 31211
   
 grepString="firefox-bin"  grepString="firefox-bin"
   
 def zptFile(self, path, orphaned=False):  def zptFile(self, path, orphaned=False):
Line 90  class checkStation(SimpleItem): Line 93  class checkStation(SimpleItem):
                 {'label':'checkRebootDead','action':'checkRebootDead'},                  {'label':'checkRebootDead','action':'checkRebootDead'},
                 {'label':'Reboot Overview','action':'rebootOverview'},                  {'label':'Reboot Overview','action':'rebootOverview'},
         )          )
     def asctime(self):      def asctime(self,tm):
       try:
         return time.asctime(tm)          return time.asctime(tm)
           except:
           return "never"
                   
     def __init__(self, id, path):      def __init__(self, id, path):
         """init"""          """init"""
Line 99  class checkStation(SimpleItem): Line 105  class checkStation(SimpleItem):
         self.id=id          self.id=id
         self.modulOverview={}          self.modulOverview={}
   
     def checkStation(self,nr,time=5,formats=["VID"]):      def checkStation(self,nr,time=10,formats=["VID","BRA","ZOG"]):
         """check station with nr nr"""          """check station with nr nr"""
         txt=[]          txt=[]
   
Line 153  class checkStation(SimpleItem): Line 159  class checkStation(SimpleItem):
             if ret.find("grep") <= 0:              if ret.find("grep") <= 0:
                 process=ret.split()[0]                  process=ret.split()[0]
                 str="""ssh root@%s kill -9 %s """                  str="""ssh root@%s kill -9 %s """
                 #os.popen(str%(ip,process)).readlines()                  os.popen(str%(ip,process)).readlines()
                 retStr+=str%(ip,process) + "/n"                  retStr+=str%(ip,process) + "<br>"
         return retStr          return retStr
                   
     def checkRebootDead(self,timer=5):      def checkRebootDead(self,timer=10):
         """checks and reboots non responding firefox"""          """checks and reboots non responding firefox"""
         self.lastCheck=time.localtime()          self.lastCheck=time.localtime()
         ret="<html><body><p>"          ret="<html><body><p>"
                   
         for modul in self.getModuls():          for modul in self.getModuls():
   
             checked=self.checkStation(modul,time=timer,formats=["VID"])              checked=self.checkStation(modul,time=timer)
             if not checked[0]:              if not checked[0]:
   
                 ret+=self.rebootStation(checked[3])                  ret+=self.rebootStation(checked[3])

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>