return dbstate

class OracleASMChecker(OracleRDBMSChecker):
    def __init__(self,cf):
        super(OracleASMChecker,self).__init__(cf)
    
    def Check(self):
        dbstate=super(OracleASMChecker,self).Check()
        dbstate.ASMDG=self._db.CheckASMDG()
        
        return dbstate
    

if __name__=='__main__':
    cf=ConfigObject()
    #cf.ASMTNS='ASM_192.168.1.26'
    cf.HostName='192.168.1.26'
    cf.ServiceName='wxxrdb.center.wxxr.com.cn'
    
    dbc=OracleRDBMSChecker(cf)
    print dbc.Check()      

    print ('-'*30)
    
    asdbc=OracleASMChecker(cf)
    print asdbc.Check()
       
        
        
예제 #2
0
            username='******'
            password='******'
        if hostname in ('192.168.5.31','192.168.5.32'):
            self.__cmd='df -Pm' 
        #for Aix
#        print ('%s=%s=%s' %(hostname,username,password)) 
        self.__host=paramiko.SSHClient()
        #paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG)
        self.__host.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        self.__host.connect(hostname=hostname,username=username,password=password,port=port)
        
        
    
    def CheckDisk(self):
        stdin,stdout,stderror=self.__host.exec_command(self.__cmd)
        disks=stdout.readlines()
        
        return disks
        
if __name__=='__main__':
    from com.stonedog.common.config.initconfig import ConfigObject
    cf=ConfigObject()
    cf.HostName='192.168.17.13'
    machine=XNixHost(cf)
    disks=machine.CheckDisk()
    print(type(disks))       
    for dk in disks:
        print (type(dk))
        print dk