def METHOD_NAME(argv = None):
    if argv is None:
        argv = sys.argv
    else:
        sys.argv.extend(argv)
    try:
        parser = ArgumentParser()
        parser.add_argument('--config-file', help = "Path to the config file", required = True)
        parser.add_argument('--start-samplerd', help = "start samplerd ldmsd",
                            action = "store_true")
        parser.add_argument('--kill-samplerd', action = "store_true",
                            help = "kill samplerd ldmsd")
        parser.add_argument('--start-agg', action = "store_true",
                            help = "start agg ldmsd")
        parser.add_argument('--kill-agg', action = "store_true",
                            help = "kill agg ldmsd")
        parser.add_argument('--kill-9-samplerd', action = "store_true",
                            help = "kill 9 samplerd ldmsd")
        parser.add_argument('--kill-9-agg', action = "store_true",
                            help = "kill 9 agg ldmsd")
        parser.add_argument('--remove-samplerd-files', action = "store_true",
                            help = "Remove the samplerd's log and sock files")
        parser.add_argument('--remove-agg-files', action = "store_true",
                            help = "Remove the aggregataor(s)'s log and sock files")
        parser.add_argument('--check-samplerd', action = "store_true",
                            help = "Check samplerd ldmsd running")
        parser.add_argument('--check-agg', action = "store_true",
                            help = "Check agg ldmsd running")
        parser.add_argument('--samplerd-pid', help = "Get the samplerd PIDs",
                            action = "store_true")
        parser.add_argument('--agg-pid', help = "Get the agg PIDs",
                            action = "store_true")
        args = parser.parse_args()
        cfg = get_var_from_file(module_name = "cfg", filepath = args.config_file)
        if args.start_samplerd:
            print "start samplerd.."
            start_ldmsd(hosts = cfg.SAMPLERD_HOSTS,
                               xprt = cfg.SAMPLERD_XPRT, port = cfg.SAMPLERD_PORT,
                               log = cfg.SAMPLERD_LOG, sockname = cfg.SAMPLERD_SOCK)
        if args.start_agg:
            print "start agg.."
            start_ldmsd(hosts = cfg.AGG_HOSTS, xprt = cfg.AGG_XPRT, port = cfg.AGG_PORT,
                              log = cfg.AGG_LOG, sockname = cfg.AGG_SOCK)
        if args.kill_samplerd:
            print "kill samplerd.."
            kill_ldmsd(hosts = cfg.SAMPLERD_HOSTS, xprt = cfg.SAMPLERD_XPRT,
                                port = cfg.SAMPLERD_PORT)
        if args.kill_agg:
            print "kill agg.."
            kill_ldmsd(hosts = cfg.AGG_HOSTS, xprt = cfg.AGG_XPRT, port = cfg.AGG_PORT)
        if args.kill_9_samplerd:
            print "kill 9 samplerd.."
            kill_9_ldmsd(hosts = cfg.SAMPLERD_HOSTS, xprt = cfg.SAMPLERD_XPRT,
                                port = cfg.SAMPLERD_PORT)
        if args.kill_9_agg:
            print "kill 9 agg.."
            kill_9_ldmsd(hosts = cfg.AGG_HOSTS, xprt = cfg.AGG_XPRT, port = cfg.AGG_PORT)
        if args.remove_samplerd_files:
            print "Removing the files of samplerd"
            remove_file(cfg.SAMPLERD_HOSTS, cfg.SAMPLERD_LOG)
            remove_file(cfg.SAMPLERD_HOSTS, cfg.SAMPLERD_SOCK)
        if args.remove_agg_files:
            print "Removing the files of aggregators"
            remove_file(cfg.AGG_HOSTS, cfg.AGG_LOG)
            remove_file(cfg.AGG_HOSTS, cfg.AGG_SOCK)
        if args.check_samplerd:
            print "Check samplerd ldmsd running? ...."
            print is_ldmsd_running(hosts = cfg.SAMPLERD_HOSTS,
                                              xprt = cfg.SAMPLERD_XPRT,
                                              port = cfg.SAMPLERD_PORT)
        if args.check_agg:
            print "Check agg ldmsd running? ...."
            print is_ldmsd_running(hosts = cfg.AGG_HOSTS, xprt = cfg.AGG_XPRT,
                                            port = cfg.AGG_PORT)
        if args.samplerd_pid:
            print "Getting samplerd pid"
            print get_ldmsd_pid(hosts = cfg.SAMPLERD_HOSTS, xprt = cfg.SAMPLERD_XPRT,
                                port = cfg.SAMPLERD_PORT)
        if args.agg_pid:
            print "Getting agg pid"
            print get_ldmsd_pid(hosts = cfg.AGG_HOSTS, xprt = cfg.AGG_XPRT,
                                port = cfg.AGG_PORT)
    except KeyboardInterrupt:
        return 0
    except Exception:
        traceback.print_exc()
        return 2