Esempio n. 1
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
Esempio n. 2
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
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()
Esempio n. 4
0
def main():
    myLogger = MyLogger(LOGFILE="/tmp/NotificationListener.log",
                        STDOUT=True,
                        DEBUG=True)
    #adminObject	= AdminClient( logger=myLogger, hostname="dilabvirt31-v1" )
    adminObject = AdminClient(logger=myLogger,
                              hostname="dilabvirt31-v1",
                              cellName='cellA')
    myListener = NotificationListener(logger=myLogger)
    try:
        myclient = adminObject.createSOAPDefault()
        results = adminObject.getResults()
        myListener.logMySelf()
        myListener.closeMe()
        adminObject.logResults(results)
        adminObject.closeMe()
    except:
        myLogger.logIt(
            "main(): Unable to connect to the AdminClient().  Make sure that the WebSphere Server Manager is running.\n"
        )
        raise