Exemplo n.º 1
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 5:
        ip = parameters[0]
        port = parameters[1]
        interval = parameters[2]
        end_time = parameters[3]
        filename = parameters[4]
        user = ''
        passwd = ''
        monitor_memcached_stat = MonitorMemcachedStat(ip, port, interval,
                                                      end_time, filename, user,
                                                      passwd)
        monitor_memcached_stat.work()
    if len(parameters) == 7:
        ip = parameters[0]
        port = parameters[1]
        interval = parameters[2]
        end_time = parameters[3]
        filename = parameters[4]
        user = parameters[5]
        passwd = parameters[6]
        monitor_memcached_stat = MonitorMemcachedStat(ip, port, interval,
                                                      end_time, filename, user,
                                                      passwd)
        monitor_memcached_stat.work()
Exemplo n.º 2
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 4:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]

    monitor_nginx_status = MonitorNginx(url, interval, end_time, filename)
    monitor_nginx_status.work()
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 5:
        ip = parameters[0]
        port = parameters[1]
        interval = parameters[2]
        end_time = parameters[3]
        filename = parameters[4]
        monitor_memcached_stat = MonitorMemcachedStat(ip, port, interval, end_time, filename)
        monitor_memcached_stat.work()
Exemplo n.º 4
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 4:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]

    monitor_nginx_status = MonitorNginx(url, interval, end_time, filename)
    monitor_nginx_status.work()
Exemplo n.º 5
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 4:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        user = None
        password = None
    if len(parameters) == 6:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        user = parameters[4]
        password = parameters[5]
    monitor_apache_status = MonitorApache(url, interval, end_time, filename, user, password)
    monitor_apache_status.work()
Exemplo n.º 6
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 4:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        user = None
        password = None
    if len(parameters) == 6:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        user = parameters[4]
        password = parameters[5]
    monitor_apache_status = MonitorApache(url, interval, end_time, filename,
                                          user, password)
    monitor_apache_status.work()
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 5:
        ip = parameters[0]
        port = parameters[1]
        interval = parameters[2]
        end_time = parameters[3]
        filename = parameters[4]
        user = ""
        passwd = ""
        monitor_memcached_stat = MonitorMemcachedStat(ip, port, interval, end_time, filename, user, passwd)
        monitor_memcached_stat.work()
    if len(parameters) == 7:
        ip = parameters[0]
        port = parameters[1]
        interval = parameters[2]
        end_time = parameters[3]
        filename = parameters[4]
        user = parameters[5]
        passwd = parameters[6]
        monitor_memcached_stat = MonitorMemcachedStat(ip, port, interval, end_time, filename, user, passwd)
        monitor_memcached_stat.work()
Exemplo n.º 8
0
def main():
    parameters = get_parameter_lists(sys.argv)
    if len(parameters) == 7:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        monitor_sign = parameters[4]
        tomcat_type = parameters[5]
        tomcat_self_name = parameters[6]
        user = None
        password = None
    if len(parameters) == 9:
        url = parameters[0]
        interval = parameters[1]
        end_time = parameters[2]
        filename = parameters[3]
        monitor_sign = parameters[4]
        tomcat_type = parameters[5]
        tomcat_self_name = parameters[6]
        user = parameters[7]
        password = parameters[8]
    monitor_apache_status = MonitorTomcat(url, interval, end_time, filename, monitor_sign, tomcat_type, tomcat_self_name, user, password)
    monitor_apache_status.work()
Exemplo n.º 9
0
def main():
    parameter_lists = util.get_parameter_lists(sys.argv)
	
    if len(parameter_lists) == 3:
        result_dit = parameter_lists[0]
        prefix = parameter_lists[1]
        build_id = parameter_lists[2]
        vuser_type = 0
    elif len(parameter_lists) == 4:
        result_dit = parameter_lists[0]
        prefix = parameter_lists[1]
        build_id = parameter_lists[2]
        vuser_type = parameter_lists[3]
    else:
        print "[ERROR]parameter number error"
        print "[ERROR]start.py result_dir prefix build_id [vuser_type]"
        return

    if int(vuser_type) == 0:
        lr_sum_report = report.LRReport(result_dit, prefix, build_id)
    else:
        lr_sum_report = report.LRJavaVuserReport(result_dit, prefix, build_id)

    lr_sum_report.work()
Exemplo n.º 10
0
def main():
    parameter_lists = util.get_parameter_lists(sys.argv)

    if len(parameter_lists) == 3:
        result_dit = parameter_lists[0]
        prefix = parameter_lists[1]
        build_id = parameter_lists[2]
        vuser_type = 0
    elif len(parameter_lists) == 4:
        result_dit = parameter_lists[0]
        prefix = parameter_lists[1]
        build_id = parameter_lists[2]
        vuser_type = parameter_lists[3]
    else:
        print "[ERROR]parameter number error"
        print "[ERROR]start.py result_dir prefix build_id [vuser_type]"
        return

    if int(vuser_type) == 0:
        lr_sum_report = report.LRReport(result_dit, prefix, build_id)
    else:
        lr_sum_report = report.LRJavaVuserReport(result_dit, prefix, build_id)

    lr_sum_report.work()
Exemplo n.º 11
0
def main():
    #get the avg
    parameter_lists = util.get_parameter_lists(sys.argv)
    if len(parameter_lists):
        result_prefix = parameter_lists[0]
    else:
        result_prefix = "test"
    if len(parameter_lists) > 1:
        end_time = parameter_lists[1]
    else:
        end_time = "N/A"

    #read the monitor config
    config = MonitorConfig("../conf/report.ini")

    #analyse file
    files = util.get_dir_files(config.res_dir)
    for datafile in files:
        if datafile.find("txt") != -1:
            if datafile.find("server_cpu") != -1:
                cpu_resource = plot.CPUResource(config.server_cpu_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                cpu_resource.work()
            if datafile.find("server_memory") != -1:
                memory_resource = plot.MemoryResource(config.server_memory_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                memory_resource.work()
            if datafile.find("server_io_rate") != -1:
                io_rate_resource = plot.IOResource(config.server_io_rate_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                io_rate_resource.work()
            if datafile.find("server_eth0") != -1:
                eth0_resource = plot.EthResource(config.server_eth_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                eth0_resource.work()
            if datafile.find("server_eth1") != -1:
                eth1_resource = plot.EthResource(config.server_eth_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                eth1_resource.work()
            if datafile.find("server_queue_load") != -1:
                load_resource = plot.LoadResource(config.server_load_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                load_resource.work()
            if datafile.find("server_socket") != -1:
                sock_resource = plot.SockResource(config.server_sock_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                sock_resource.work()
            if datafile.find("mysql") != -1:
                mysql_resource = plot.MySQLResource(config.mysql_connections_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                mysql_resource.work()
            if datafile.find("TCPPort") != -1:
                tcp_port_resource = plot.TCPPortResource(config.tcp_port_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                tcp_port_resource.work()
            if datafile.find("process") != -1:
                process_resource = plot.ProcessResource(config.process_types,
                        result_prefix, config.res_dir+"/"+datafile, config.granularity)
                process_resource.work()
            if datafile.find("redis") != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    redis_resource = plot.RedisResource(config.redis_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    redis_resource.work()
            if datafile.find('memcached') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    memcached_resource = plot.MemcachedResource(config.memcached_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    memcached_resource.work()
            if datafile.find('mongodb') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    mongodb_resource = plot.MongodbResource(config.mongodb_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    mongodb_resource.work()
            if datafile.find('apache') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    apache_resource = plot.ApacheResource(config.apache_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    apache_resource.work()
            if datafile.find('tomcat6') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    tomcat_resource = plot.TomcatResource(config.tomcat6_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    tomcat_resource.work()
            if datafile.find('tomcat7') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    tomcat_resource = plot.TomcatResource(config.tomcat7_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    tomcat_resource.work()
            if datafile.find('nginx') != -1:
                if datafile.find('process') == -1 and datafile.find('thread') == -1:
                    nginx_resource = plot.TomcatResource(config.nginx_types,
                            result_prefix, config.res_dir+"/"+datafile, config.granularity)
                    nginx_resource.work()

    #generate sum report
    report.Report.end_time = end_time
    resource_sum_report = report.Report(config.res_dir)
    resource_sum_report.work()
Exemplo n.º 12
0
def main():
    # get the avg
    parameter_lists = util.get_parameter_lists(sys.argv)
    if len(parameter_lists):
        result_prefix = parameter_lists[0]
    else:
        result_prefix = "test"
    if len(parameter_lists) > 1:
        end_time = parameter_lists[1]
    else:
        end_time = "N/A"

    # read the monitor config
    config = MonitorConfig("../conf/report.ini")

    # analyse file
    files = util.get_dir_files(config.res_dir)
    for datafile in files:
        if datafile.find("txt") != -1:
            if datafile.find("server_cpu") != -1:
                cpu_resource = plot.CPUResource(
                    config.server_cpu_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                cpu_resource.work()
            if datafile.find("server_memory") != -1:
                memory_resource = plot.MemoryResource(
                    config.server_memory_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                memory_resource.work()
            if datafile.find("server_io_rate") != -1:
                io_rate_resource = plot.IOResource(
                    config.server_io_rate_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                io_rate_resource.work()
            if datafile.find("server_eth0") != -1:
                eth0_resource = plot.EthResource(
                    config.server_eth_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                eth0_resource.work()
            if datafile.find("server_eth1") != -1:
                eth1_resource = plot.EthResource(
                    config.server_eth_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                eth1_resource.work()
            if datafile.find("server_queue_load") != -1:
                load_resource = plot.LoadResource(
                    config.server_load_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                load_resource.work()
            if datafile.find("server_socket") != -1:
                sock_resource = plot.SockResource(
                    config.server_sock_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                sock_resource.work()
            if datafile.find("mysql") != -1 and datafile.find('threads') != -1:
                mysql_resource = plot.MySQLResource(
                    config.mysql_connections_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                mysql_resource.work()
            if datafile.find("TCPPort") != -1:
                tcp_port_resource = plot.TCPPortResource(
                    config.tcp_port_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                tcp_port_resource.work()
            if datafile.find("process") != -1 and datafile.find('mysql') == -1:
                process_resource = plot.ProcessResource(
                    config.process_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                process_resource.work()
            if datafile.find("redis") != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    redis_resource = plot.RedisResource(
                        config.redis_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    redis_resource.work()
            if datafile.find('memcached') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    memcached_resource = plot.MemcachedResource(
                        config.memcached_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    memcached_resource.work()
            if datafile.find('mongodb') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    mongodb_resource = plot.MongodbResource(
                        config.mongodb_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    mongodb_resource.work()
            if datafile.find('apache') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    apache_resource = plot.ApacheResource(
                        config.apache_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    apache_resource.work()
            if datafile.find('tomcat6') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    tomcat_resource = plot.TomcatResource(
                        config.tomcat6_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    tomcat_resource.work()
            if datafile.find('tomcat7') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    tomcat_resource = plot.TomcatResource(
                        config.tomcat7_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    tomcat_resource.work()
            if datafile.find('nginx') != -1:
                if datafile.find('process') == -1 and datafile.find(
                        'thread') == -1:
                    nginx_resource = plot.TomcatResource(
                        config.nginx_types, result_prefix,
                        config.res_dir + "/" + datafile, config.granularity)
                    nginx_resource.work()
            if datafile.find('SocketStat') != -1:
                socket_stat_resource = plot.SocketStatResource(
                    config.socket_stat_types, result_prefix,
                    config.res_dir + "/" + datafile, config.granularity)
                socket_stat_resource.work()

    # generate sum report
    report.Report.end_time = end_time
    resource_sum_report = report.Report(config.res_dir)
    resource_sum_report.work()