コード例 #1
0
ファイル: JMX_J2EE_JBoss.py プロジェクト: deezeesms/dd-git
    except (Exception, JException), exc:
        logger.warnException("Failed to establish connection")
        jee_connection.reportError(Framework, str(exc), platform.getName())
    else:
        try:
            try:
                ip = jee.IpDescriptor(client.getIpAddress())
                dnsResolver = jee_discoverer.DnsResolverDecorator(
                                    netutils.JavaDnsResolver(), client.getIpAddress()
                                    #TODO: change to ip
                )
                # Create reporters depending on enableJeeEnhancedTopology value in the global settings
                globalSettings = GeneralSettingsConfigFile.getInstance()
                loadExternalDTD = globalSettings.getPropertyBooleanValue('loadExternalDTD', 0)
                descrParser = jee_discoverer.ApplicationDescriptorParser(loadExternalDTD)
                reporterCreator = jee_discoverer.createTopologyReporterFactory(jboss.TopologyBuilder(), dnsResolver)
                domainTopologyReporter = reporterCreator.getDomainReporter()
                jmsTopologyReporter = reporterCreator.getJmsDsReporter()
                datasourceTopologyReporter = reporterCreator.getJdbcDsReporter()
                applicationReporter = reporterCreator.getApplicationReporter()

                # create corresponding discoverer by version and get domain info:
                domain = None
                platformTrait = jee_discoverer.getPlatformTrait(version, platform, fallbackVersion = 4)
                if platformTrait.majorVersion.value() >= 7: # JBoss version 7+
                    try:
                        serverDiscoverer = jboss_discoverer.ServerDiscovererByJmxV7(jmxProvider)
                        #TODO: fill hostControllerManagementPort from AppSignature, job-param, or inputTQL
                        domain = serverDiscoverer.discoverDomain(hostControllerManagementPort = '9999')
                    except (Exception, JException):
                        logger.debugException('Failed to discover domain')
コード例 #2
0
        # OR
        # Instead, use the following arguments:
        #     -Dweblogic.RootDirectory=c:\mydir
        #     -Dweblogic.ConfigFile=myfile.xml

        # prepare DNS resolver used in every discoverer.
        # Should be weblogic-specific resolver to resolve ${host.name} or "*"
        destinationIp = client.getIpAddress()
        dnsResolver = jee_discoverer.DnsResolverDecorator(
                            netutils.createDnsResolverByShell(shell), destinationIp
        )
        # create reporters and builders for weblogic topology
        globalSettings = GeneralSettingsConfigFile.getInstance()
        loadExternalDtd = globalSettings.getPropertyBooleanValue('loadExternalDtd', 0)
        reporterCreator = jee_discoverer.createTopologyReporterFactory(
                                                    weblogic.ServerTopologyBuilder(),
                                                    dnsResolver)

        for rootDirPath, processes in processesByRootDirPath.items():
            if not rootDirPath:
                continue
            try:
                try:
                    logger.debug("Discover topology for the domain in %s" % rootDirPath)
                    domainLayout = weblogic_discoverer.createDomainLayout(fs, rootDirPath)
                    # at this point we have layout of version corresponding to version of platform
                    parser = weblogic_discoverer.createDomainConfigParserByLayout(domainLayout, loadExternalDtd)
                except (Exception, JException):
                    logger.warnException("Failed to process domain in %s" % rootDirPath)
                    continue
                try:
コード例 #3
0
            fs = _createFileSystemRecursiveSearchEnabled(
                file_system.createFileSystem(shell))
            pathUtil = file_system.getPath(fs)
        except (Exception, JException), exc:
            logger.warnException(str(exc))
            jee_connection.reportError(Framework, str(exc), platform.getName())
        else:
            loadExternalDtd = isLoadExternalDtdEnabled()
            # Parser used for configuration files parsing
            parser = websphere_discoverer.DescriptorParser(loadExternalDtd)
            # For the DNS resolving Java resolver will be used
            dnsResolver = jee_discoverer.DnsResolverDecorator(
                netutils.JavaDnsResolver(), client.getIpAddress())

            # To abstract from reporting topologies (old/enhanced) reporter creator is used
            reporterCreator = jee_discoverer.createTopologyReporterFactory(
                websphere.ServerTopologyBuilder(), dnsResolver)
            r'''
            Discovery plan
            1) group processes by profile path, specified as first parameter to java class
            1.1) find platform version using -Dinstall.root.dir obligatory system parameter for each runtime
            2) For each profile we have to determine deployment Type
                2.0) go through runtime nodes and discover running servers
                    a) every running server has jvm discovered
                2.2) If deployment type is Distributed
                    2.3) determine administrative server
            '''
            r'''0) '''
            # First step is to determine running server by finding
            # launched processes. Websphere processes are identified by substring
            # in command line 'com.ibm.ws.runtime.WsServer'.
            # Server class which has 4 parameters: