Пример #1
0
 def checkServiceRunning(self, hostKey, serviceName):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("service  " + serviceName + "  status")
     if "unrecognized" in data[1] or "is not running" in data[1]:
         return False
     else:
         return True
Пример #2
0
 def iptableDelete(self, hostKey, chain, index):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("iptables -D " + chain + " " + index)
     if data[0] == 0:
         return True
     else:
         return False
Пример #3
0
 def checkServiceRunning(self, hostKey, serviceName):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("service  " + serviceName + "  status")
     if "unrecognized" in data[1] or "is not running" in data[1]:
         return False
     else:
         return True
Пример #4
0
 def checkInstalled(self, hostKey, softName):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("service  " + softName + "  status")
     if "unrecognized" in data[1]:
         d = broker.execCmd("which " + softName)
         if d[0] != 0:
             return False
         else:
             return True
     else:
         return True
Пример #5
0
 def checkInstalled(self, hostKey, softName):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("service  " + softName + "  status")
     if "unrecognized" in data[1]:
         d = broker.execCmd("which " + softName)
         if d[0] != 0:
             return False
         else:
             return True
     else:
         return True
Пример #6
0
 def processCheck(self, hostKey, processName):
     broker = BrokerService.getBroker(hostKey)
     return broker.processCheck(processName)
Пример #7
0
 def runShell(self, hostKey, cmd):
     broker = BrokerService.getBroker(hostKey)
     return broker.execCmd(cmd)
Пример #8
0
 def runShell(self, hostKey, cmd):
     broker = BrokerService.getBroker(hostKey)
     return broker.execCmd(cmd)
 def overwriteFile(self,hostKey,path,data):
     broker = BrokerService.getBroker(hostKey)
     data=broker.overwriteFile(path,data)
     return data
 def downloadFile(self,hostKey,path):
     broker = BrokerService.getBroker(hostKey)
     data=broker.downloadFile(path)
     return data
 def ls(self, hostKey, path):
     broker = BrokerService.getBroker(hostKey)
     return broker.getPathDetail(path)
Пример #12
0
 def getNetInfo(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     return broker.getNetInfo()
Пример #13
0
 def portCheck(self, hostKey, port):
     broker = BrokerService.getBroker(hostKey)
     return broker.portCheck(port)
 def cp(self, hostKey, path):
     broker = BrokerService.getBroker(hostKey)
     return broker.cp(path)
Пример #15
0
 def portCheck(self, hostKey, port):
     broker = BrokerService.getBroker(hostKey)
     return broker.portCheck(port)
Пример #16
0
 def processCheck(self, hostKey, processName):
     broker = BrokerService.getBroker(hostKey)
     return broker.processCheck(processName)
 def getCusProcessInfo(self, hostKey, attrs=['pid', 'name', 'username', 'memory_info', 'status', 'memory_percent', 'cpu_percent', 'cpu_times']):
     broker = BrokerService.getBroker(hostKey)
     return broker.getCusProcessInfo(attrs)
 def getProcessInfo(self, hostKey, processId):
     broker = BrokerService.getBroker(hostKey)
     return broker.getProcessInfo(processId)
 def getPids(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     return broker.getPids()
Пример #20
0
 def kill(self, hostKey, pid):
     broker = BrokerService.getBroker(hostKey)
     return broker.shell("kill -9 " + pid)
Пример #21
0
 def iptableList(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     return broker.iptableList()
Пример #22
0
 def iptablesList(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("iptables -L")
     return data
 def partitionInfo(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     return broker.getDiskInfo()
Пример #24
0
 def getCpuStatue(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     return broker.getMemInfo()
Пример #25
0
 def iptablesList(self, hostKey):
     broker = BrokerService.getBroker(hostKey)
     data = broker.execCmd("iptables -L")
     return data