예제 #1
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/FileThread.log", STDOUT=True, DEBUG=True)
    mySocketObj = MySocket(port=50007, logger=myLogger)
    mySocketObj.bindAndListen()
    conn, data = mySocketObj.serverRead(1, packetSize=2048)

    statusFile = '/tmp/mystatus.txt'

    threadList = []
    for mythread in range(0, 1):
        current = FileThread(mySocketObj,
                             conn,
                             data,
                             statusFile + str(mythread + 1),
                             threadName='thread_jobid_' + str(mythread) +
                             '_host' + str(mythread + 1),
                             logger=myLogger)
        threadList.append(current)
        current.start()
    # Endfor

    ################################
    #    Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        myLogger.logIt("main(): " + str(mythread.message) + '\n')
        mythread.closeMe()
예제 #2
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/MakeNewFilesActive.log",
                        STDOUT=True,
                        DEBUG=True)

    threadList = []
    hostDict = dict()
    for mythread in range(0, 3):
        hostName = 'host' + str(mythread)
        hostDict[hostName] = False
    # Endfor

    jobid = 'SomeAutoSysId'
    ampid = 'SomeAmpId'
    mne = 'DMP'
    statusFileHome = '/tmp'
    myMakeNewFilesActive = MakeNewFilesActive(jobid,
                                              ampid,
                                              'MYDOMAIN',
                                              mne,
                                              statusFileHome,
                                              hostDict,
                                              logger=myLogger)
    rc = myMakeNewFilesActive.makeFilesActive()
    msgs = myMakeNewFilesActive.message
    myLogger.logIt("main(): msgs=" + str(msgs) + "\n")

    myMakeNewFilesActive.closeMe()
예제 #3
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/WasClusters.log",
                        STDOUT=True,
                        DEBUG=True)
    adminObject = AdminClient(logger=myLogger, hostname="dilabvirt31-v1")
    try:
        myclient = adminObject.createSOAPDefault()
        results = adminObject.getResults()
        adminObject.logResults(results)
        myClusterObject = WasClusters(logger=myLogger)
        clusterMembers = myClusterObject.getClusterMembers(myclient)
        print dir(myClusterObject.clusterMembers)
        for clusterMember in clusterMembers:
            #print dir( clusterMember )
            print clusterMember.clusterName
            print clusterMember.memberName
            print clusterMember.type
            print clusterMember.nodeName
            print clusterMember.uniqueID
            print clusterMember.clusterObjectName.toString()
            print clusterMember.weightTableEntry.memberName
            print clusterMember.weightTableEntry.weight
            print clusterMember.weightTableEntry.nodeName
        #Endif
        adminObject.closeMe()
    except:
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n"
        )
        raise
예제 #4
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/ConfigureWASThread.log", STDOUT=True, DEBUG=True)
    mne = 'DMP'
    statusFile = '/tmp'
    jobid = 'SomeAutoSysJobId'
    ampid = 'SomeAmpId'

    threadList = []
    componentList = ['comp1', 'comp2', 'comp3', 'comp4']
    for mythread in range(0, 3):
        for component in componentList:
            current = ConfigureWASThread(
                jobid,
                ampid,
                'host' + str(mythread + 1),
                statusFile,
                mne,
                component,
                threadName='thread_jobid_' + str(mythread) + '_host' + str(mythread + 1) + '_' + str(component),
                logger=myLogger
            )
            threadList.append(current)
            current.start()
    # Endfor
    # Endfor

    ################################
    #	Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        mythread.closeMe()
예제 #5
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/StopAllRunnableProcesses.log",
                        STDOUT=True,
                        DEBUG=True)

    threadList = []
    processDict = dict()
    for mythread in range(0, 3):
        hostName = 'host' + str(mythread)
        processList = [
            'comp' + str(mythread + 1), 'comp' + str(mythread + 2),
            'comp' + str(mythread + 3)
        ]
        processDict[hostName] = processList
    # Endfor

    jobid = 'SomeAutoSysId'
    ampid = 'SomeAmpId'
    mne = 'DMP'
    statusFile = '/tmp/stop_all_runable_processes.MYDOMAIN'
    myStopAllRunnableProcesses = StopAllRunnableProcesses(jobid,
                                                          ampid,
                                                          'MYDOMAIN',
                                                          mne,
                                                          statusFile,
                                                          processDict,
                                                          logger=myLogger)
    rc = myStopAllRunnableProcesses.stopProcesses()
    msgs = myStopAllRunnableProcesses.message
    myLogger.logIt("main(): msgs=" + str(msgs) + "\n")

    myStopAllRunnableProcesses.closeMe()
예제 #6
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/MakeNewFilesActiveThread.log",
                        STDOUT=True,
                        DEBUG=True)
    mne = 'DMP'
    statusFile = '/tmp/stop_all_runable_processes.MYDOMAIN'
    jobid = 'SomeAutoSysJobId'
    ampid = 'SomeAmpId'

    threadList = []
    for mythread in range(0, 3):
        current = MakeNewFilesActiveThread(jobid,
                                           ampid,
                                           'host' + str(mythread + 1),
                                           'MYDOMAIN',
                                           statusFile + str(mythread + 1),
                                           mne,
                                           cleanFlag=True,
                                           threadName=str(jobid) + '_' +
                                           str(ampid) + '_MYDOMAIN' + '_host' +
                                           str(mythread + 1),
                                           logger=myLogger)
        threadList.append(current)
        current.start()
    # Endfor

    ################################
    #	Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        mythread.closeMe()
예제 #7
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/ConfigureMNEThread.log", STDOUT=True, DEBUG=True)
    mne = 'DMP'
    statusFile = '/tmp/configureMNE.MYDOMAIN'
    jobid = 'SomeAutoSysJobId'
    ampid = 'SomeAmpId'

    threadList = []
    for mythread in range(0, 3):
        current = ConfigureMNEThread(
            jobid,
            ampid,
            'host' + str(mythread + 1),
            statusFile + str(mythread + 1),
            mne,
            threadName='thread_jobid_' + str(mythread) + '_host' + str(mythread + 1),
            logger=myLogger
        )
        threadList.append(current)
        current.start()
    # Endfor

    ################################
    #	Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        mythread.closeMe()
예제 #8
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/StopRunnableProcessThread.log", STDOUT=True, DEBUG=True)
    mne = 'DMP'
    statusFile = '/tmp/stop_all_runable_processes.MYDOMAIN'
    jobid = 'SomeAutoSysJobId'
    ampid = 'SomeAmpId'

    threadList = []
    for mythread in range(0, 3):
        processList = list()
        processList = ['comp' + str(mythread + 1), 'comp' + str(mythread + 2), 'comp' + str(mythread + 3)]
        current = StopRunnableProcessThread(
            jobid,
            ampid,
            'host' + str(mythread + 1),
            'MYDOMAIN',
            statusFile + str(mythread + 1),
            mne,
            processList,
            threadName='thread_jobid_' + str(mythread) + '_host' + str(mythread + 1),
            logger=myLogger
        )
        threadList.append(current)
        current.start()
    # Endfor

    ################################
    #	Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        mythread.closeMe()
예제 #9
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/ConfigWebServers.log",
                        STDOUT=True,
                        DEBUG=True)

    threadList = []

    hostDict = dict()
    for mythread in range(0, 3):
        hostName = 'host' + str(mythread)
        hostDict[hostName] = ['arg1', 'arg2', 'arg3']
    # Endfor

    jobid = 'SomeAutoSysId'
    ampid = 'SomeAmpId'
    mne = 'DMP'
    statusFileHome = '/tmp'
    myConfigWebServers = ConfigWebServers(jobid,
                                          ampid,
                                          mne,
                                          'MYDOMAIN',
                                          hostDict,
                                          statusFileHome,
                                          logger=myLogger)
    myConfigWebServers.configWebServers(timeout=5.0)
    myLogger.logIt('main(): ' + str(myConfigWebServers.message))

    myConfigWebServers.closeMe()
예제 #10
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/ConfigureWAS.log", STDOUT=True, DEBUG=True)

    threadList = []

    hostDict = dict()
    for mythread in range(0, 3):
        hostName = 'host' + str(mythread)
        hostDict[hostName] = ['comp1', 'comp2', 'comp3']
    # Endfor

    jobid = 'SomeAutoSysId'
    ampid = 'SomeAmpId'
    mne = 'DMP'
    # statusFileHome	= '/tmp/stop_all_runable_processes.MYDOMAIN'
    statusFileHome = '/tmp'
    myConfigureWAS = ConfigureWAS(
        jobid,
        ampid,
        mne,
        'MYDOMAIN',
        hostDict,
        statusFileHome,
        logger=myLogger
    )
    myConfigureWAS.configureWAS(timeout=5.0)
    myLogger.logIt('main(): ' + str(myConfigureWAS.message))

    myConfigureWAS.closeMe()
예제 #11
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/FileTask.log", STDOUT=True, DEBUG=True)

    statusFileHome = '/tmp'
    myFileTask = FileTask(port=50007,
                          statusFileHome=statusFileHome,
                          logger=myLogger)
    myFileTask.fileTask(timeout=None)
    myLogger.logIt('main(): ' + str(myFileTask.message))
예제 #12
0
def main():
	myLogger	= MyLogger( LOGFILE="/tmp/AppServerManager.log", STDOUT=True, DEBUG=True )
	adminObject	= AdminClient( logger=myLogger, hostname="dilabvirt31-v1", cellName='cellA' )
	try:
		myclient	= adminObject.createSOAPDefault()
		results		= adminObject.getResults()
		#adminObject.logResults( results )
	except Exception, e:
		myLogger.logIt( "main(): " + str(e) + "\n" )
		myLogger.logIt( "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n" )
		raise
예제 #13
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/DomainDeployOperationThread.log",
                        STDOUT=True,
                        DEBUG=True)
    mne = 'DMP'
    statusFile = '/tmp/deploy_DOMAIN_components.MYDOMAIN'
    statusFilesHome = '/tmp'
    jobid = 'SomeAutoSysJobId'
    ampid = 'SomeAmpId'

    threadList = []
    for mythread in range(0, 3):
        processDict = dict()
        processDict['host1'] = [
            'comp' + str(mythread + 1), 'comp' + str(mythread + 2),
            'comp' + str(mythread + 3)
        ]
        processDict['host2'] = [
            'comp' + str(mythread + 1), 'comp' + str(mythread + 2),
            'comp' + str(mythread + 3)
        ]
        processDict['host3'] = [
            'comp' + str(mythread + 1), 'comp' + str(mythread + 2),
            'comp' + str(mythread + 3)
        ]
        hostDict = dict()
        hostDict['host1'] = [False]
        hostDict['host2'] = [False]
        hostDict['host3'] = [False]
        current = DomainDeployOperationThread(jobid,
                                              ampid,
                                              'MYDOMAIN' + str(mythread),
                                              statusFile + str(mythread),
                                              statusFilesHome,
                                              mne,
                                              processDict,
                                              hostDict,
                                              threadName='MAIN_MYDOMAIN' +
                                              str(mythread),
                                              logger=myLogger)
        threadList.append(current)
        current.start()
    #Endfor

    ################################
    #	Join on all the threads.
    ################################
    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
        myLogger.logIt("main(): " + str(mythread.message) + '\n')
        mythread.closeMe()
예제 #14
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/StatusCookie.log",
                        STDOUT=True,
                        DEBUG=True)
    myObject = StatusCookie(jobname="QAMP_UAT0000000_090504130000i",
                            logger=myLogger)
    if (myObject is None): print("Failed to create the StatusCookie object.")
    email_dir = myObject.getEmailDir()
    myLogger.logIt("email_dir=" + str(email_dir) + "\n")
    work_dir = myObject.getWorkDir()
    myLogger.logIt("work_dir=" + str(work_dir) + "\n")
    myObject.writeStatus(host="dideploy11",
                         app="StatusCookie",
                         msg="This is a test")
    myObject.closeMe()
예제 #15
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/AdminClient.log",
                        STDOUT=True,
                        DEBUG=True)
    myObject = AdminClient(logger=myLogger,
                           hostname="dilabvirt31-v1",
                           cellName='cellA')
    try:
        myclient = myObject.createSOAPDefault()
        results = myObject.getResults()
        myObject.logResults(results)
        myObject.closeMe()
    except:
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n"
        )
예제 #16
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/WasData.log", STDOUT=True, DEBUG=True)
    #adminObject = AdminClient( logger=myLogger, hostname="dilabvirt31-v1" )
    adminObject = AdminClient(logger=myLogger,
                              hostname="dilabvirt31-v1",
                              cellName='cellA')
    myclient = None
    try:
        myclient = adminObject.createSOAPDefault()
    except:
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n"
        )
        raise
    wasDataObject = WasData(logger=myLogger)
    wasDataObject.queryWAS(myclient, query="WebSphere:*")
    #print dir( wasDataObject.objectNames[0] )
    #print str( wasDataObject.objectNames[0].toString() )
    wasDataObject.writeData("/nfs/home4/dmpapp/appd4ec/tmp/wastest2.csv")
    for data in wasDataObject.sortedObjectNames:
        myLogger.logIt(str(data.toString()) + '\n')
    #Endfor
    myattrs = wasDataObject.getAllPossibleAttributes()
    for attr in wasDataObject.attributes:
        myLogger.logIt(attr + '\n')
    #Endif
    wasDataObject.closeMe()
    adminObject.closeMe()
예제 #17
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/ConfigService.log",
                        STDOUT=True,
                        DEBUG=True)
    #adminClient = AdminClient( logger=myLogger, hostname="dilabvirt31-v1" )
    adminObject = AdminClient(logger=myLogger,
                              hostname="dilabvirt31-v1",
                              cellName='cellA')
    try:
        myconn = adminClient.createSOAPDefault()
        print dir(myconn)
        myObject = ConfigService(myconn, logger=myLogger)
        tmyconn = myObject.getAdminClient()
        print dir(tmyconn)
        print dir(myObject)
        print dir(myObject.systemAttributes)
        print dir(myObject.sessionPropertyConstants)
        myObject.closeMe()
    except Exception, e:
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient.  Make sure that the WAS Manager is running.\n"
            + str(e) + "\n")
예제 #18
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/AppManagementService.log",
                        STDOUT=True,
                        DEBUG=True)
    #adminClient = AdminClient( logger=myLogger, hostname="dilabvirt31-v1" )
    adminObject = AdminClient(logger=myLogger,
                              hostname="dilabvirt31-v1",
                              cellName='cellA')
    try:
        myconn = adminClient.createRMIDefault()
        print dir(myconn)
        myObject = AppManagementService(logger=myLogger)
        myAppManagementClient = myObject.getJMXProxyForClient(myconn)
        #myAppManagementServer	= myObject.getJMXProxyForServer()
        myAppManagementLocal = myObject.getLocalProxy()
        print dir(myAppManagementClient)
        #print dir( myAppManagementServer )
        print dir(myAppManagementLocal)
        print dir(myObject)
        print dir(myObject.appConstants)
        myObject.closeMe()
        adminClient.closeMe()
    except Exception, e:
        myLogger.logIt("main(): " + str(e) + "\n")
예제 #19
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/StopAllRunnableProcesses.log",
                        STDOUT=True,
                        DEBUG=True)
    adminObject = AdminClient(logger=myLogger,
                              hostname="dilabvirt31-v1",
                              cellName='cellA')
    try:
        myclient = adminObject.createSOAPDefault()
        results = adminObject.getResults()
    # adminObject.logResults( results )
    except Exception as e:
        myLogger.logIt("main(): " + str(e) + "\n")
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n"
        )
        raise
    # Endtry

    mycell = "ServicesA"
    mynodeName = "node_ServicesA_01"
    myserver = "as_wdt_01"
    myappName = "DamnSchappettEA"
    mycluster = "cl_ServicesA_a"
    rc = False

    # scope = "Cell=" + str( mycell ) + ":Node=" + str( mynodeName ) + ":Cluster=" + str( mycluster ) + ":Server=" + str( myserver )
    # scope = "Cell=" + str( mycell ) + ":Node=" + str( mynodeName ) + ":Server=" + str( myserver )

    configService = ConfigService(adminClient=myclient, logger=myLogger)
    myStopAllRunnableProcesses = StopAllRunnableProcesses(adminObject,
                                                          configService,
                                                          logger=myLogger)

    threadList = []
    for mythread in range(0, 3):
        current = StopAllRunnableProcesses(adminObject,
                                           configService,
                                           threadName='thread' + str(mythread),
                                           logger=myLogger)
        threadList.append(current)
        current.start()
    # Endfor

    for mythread in threadList:
        mythread.join()
        myLogger.logIt("main(): " + str(mythread) + "\n")
    # Endfor

    myStopAllRunnableProcesses.closeMe()
    adminObject.closeMe()