Exemple #1
0
    def testTomcatMetrics(self):
        raise SkipTest()
        agentConfig = {
            'tomcat_jmx_instance_1': 'localhost:8090:first_instance',
            'tomcat_jmx_instance_2': 'dummyurl:4444:fake_url',
            'tomcat_jmx_instance_3': 'monitorRole:tomcat@localhost:8091:second_instance_with_auth',
            'version': '0.1',
            'api_key': 'toto'
        }

        config = JmxCheck.parse_agent_config(agentConfig, 'tomcat')
        config['init_config'] = TOMCAT_CONFIG
        metrics_check = load_check('tomcat', config, agentConfig)
        

        tomcat6 = '/tmp/apache-tomcat-6/bin'
        tomcat7 = '/tmp/apache-tomcat-7/bin'
        self.start_tomcat(tomcat6, 8080)
        self.start_tomcat(tomcat7, 7070)

        timers_first_check = []

        for instance in config['instances']:
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception,e:
                print e
                continue
Exemple #2
0
    def testJavaMetric(self):
        raise SkipTest()
        agentConfig = {
            'java_jmx_instance_1': 'localhost:8090',
            'java_jmx_instance_2': 'dummyhost:9999:dummy',
            'java_jmx_instance_3': 'localhost:2222:second_instance',
            'version': '0.1',
            'api_key': 'toto'
        }

        config = JmxCheck.parse_agent_config(agentConfig, 'java')

        metrics_check = load_check('jmx', config, agentConfig)

        # Starting tomcat
        tomcat6 = '/tmp/apache-tomcat-6/bin'
        self.start_tomcat(tomcat6, 8080)

        # Starting solr
        jmx_prefix = "-Dcom.sun.management.jmxremote"
        first_instance = "%s.port=2222 %s.authenticate=false -Djetty.port=8380" % (jmx_prefix, jmx_prefix)
        first_instance = self.start_solr(first_instance, 8983)

        timers_first_check = []

        for instance in config['instances']:
            #print "processing instance %s" % instance
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception,e:
                print e
                continue
Exemple #3
0
    def testTomcatMetrics(self):
        agentConfig = {
            'tomcat_jmx_instance_1': 'localhost:8090:first_instance',
            'tomcat_jmx_instance_2': 'dummyurl:4444:fake_url',
            'version': '0.1',
            'api_key': 'toto'
        }

        config = JmxCheck.parse_agent_config(agentConfig, 'tomcat')
        config['init_config'] = TOMCAT_CONFIG
        metrics_check = load_check('tomcat', config, agentConfig)

        timers_first_check = []

        for instance in config['instances']:
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception, e:
                #print e
                continue
Exemple #4
0
    def testTomcatMetrics(self):
        agentConfig = {
            'tomcat_jmx_instance_1': 'localhost:8090:first_instance',
            'tomcat_jmx_instance_2': 'dummyurl:4444:fake_url',
            'version': '0.1',
            'api_key': 'toto'
        }

        config = JmxCheck.parse_agent_config(agentConfig, 'tomcat')
        config['init_config'] = TOMCAT_CONFIG
        metrics_check = load_check('tomcat', config, agentConfig)
        

        timers_first_check = []

        for instance in config['instances']:
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception,e:
                #print e
                continue
Exemple #5
0
    def testJavaMetric(self):
        agentConfig = {
            'java_jmx_instance_1': 'localhost:8090',
            'java_jmx_instance_2': 'dummyhost:9999:dummy',
            'version': '0.1',
            'api_key': 'toto'
        }

        config = JmxCheck.parse_agent_config(agentConfig, 'java')

        metrics_check = load_check('jmx', config, agentConfig)


        timers_first_check = []

        for instance in config['instances']:
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception,e:
                print e
                continue
Exemple #6
0
    def testSolrMetrics(self):
        raise SkipTest()
        agentConfig = {
            'solr_jmx_instance_1': 'localhost:3000:first_instance',
            'solr_jmx_instance_2': 'dummyurl:4444:fake_url',
            'solr_jmx_instance_3': 'monitorRole:solr@localhost:3001:second_instance_with_auth',
            'version': '0.1',
            'api_key': 'toto'
        }

        jmx_prefix = "-Dcom.sun.management.jmxremote"

        
        first_instance = None
        second_instance = None
       
        first_instance = "%s.port=3000 %s.authenticate=false -Djetty.port=8980" % (jmx_prefix, jmx_prefix)
        second_instance = "%s.port=3001 %s.authenticate=true -Djetty.port=8984 %s.password.file=/tmp/apache-solr-3/example/jmxremote.password %s.access.file=/tmp/apache-solr-3/example/jmxremote.access" % (jmx_prefix, jmx_prefix, jmx_prefix, jmx_prefix)
        
        first_instance = self.start_solr(first_instance, 8983)
        second_instance = self.start_solr(second_instance, 8984)

        config = JmxCheck.parse_agent_config(agentConfig, 'solr')
        config['init_config'] = SOLR_CONFIG

        metrics_check = load_check('solr', config, agentConfig)

        timers_first_check = []

        for instance in config['instances']:
            try:
                start = time.time()
                metrics_check.check(instance)
                timers_first_check.append(time.time() - start)
            except Exception,e:
                print e
                continue
Exemple #7
0
 def parse_agent_config(agentConfig):
     return JmxCheck.parse_agent_config(agentConfig, "java")
Exemple #8
0
 def parse_agent_config(agentConfig):
     return JmxCheck.parse_agent_config(agentConfig, 'java')
Exemple #9
0
    def parse_agent_config(agentConfig):

        return JmxCheck.parse_agent_config(agentConfig, 'solr', INIT_CONFIG)
Exemple #10
0
 def parse_agent_config(agentConfig):
     return JmxCheck.parse_agent_config(agentConfig, 'tomcat', INIT_CONFIG)
Exemple #11
0
    def parse_agent_config(agentConfig):

        return JmxCheck.parse_agent_config(agentConfig, 'activemq', INIT_CONFIG)