示例#1
0
文件: poll.py 项目: mmernik/esxsnmp
def espolld():
    """Entry point for espolld."""
    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=argv)

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#2
0
文件: poll.py 项目: mmernik/esxsnmp
def espolld():
    """Entry point for espolld."""
    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=argv)

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#3
0
文件: newdb.py 项目: mmernik/esxsnmp
def setup(inargs, config_file=None):
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=inargs)
    if config_file:
        opts.config_file = config_file

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#4
0
文件: newdb.py 项目: mmernik/esxsnmp
def setup(inargs, config_file=None):
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=inargs)
    if config_file:
        opts.config_file = config_file

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#5
0
def gen_ma_storefile():
    """Translated from the original Perl by jdugan"""

    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=argv)

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print >> sys.stderr, e
        sys.exit(1)
示例#6
0
def gen_ma_storefile():
    """Translated from the original Perl by jdugan"""

    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    (opts, args) = oparse.parse_args(args=argv)

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print >>sys.stderr, e
        sys.exit(1)
示例#7
0
文件: poll.py 项目: mmernik/esxsnmp
def espoll():
    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    oparse.usage = "%prog [options] router oidset"
    (opts, args) = oparse.parse_args(args=argv)

    if len(args[1:]) != 2:
        oparse.error("requires router and oidset arguments")

    device_name, oidset_name = args[1:]

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#8
0
文件: poll.py 项目: mmernik/esxsnmp
def espoll():
    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    oparse.usage = "%prog [options] router oidset"
    (opts, args) = oparse.parse_args(args=argv)

    if len(args[1:]) != 2:
        oparse.error("requires router and oidset arguments")

    device_name, oidset_name = args[1:]

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print e
        sys.exit(1)
示例#9
0
def espersistd():
    """Entry point for espersistd.

    espersistd consists of one PersistenceManager thread and multiple
    worker sub-processes.

    """
    argv = sys.argv
    oparse = get_opt_parser(default_config_file=get_config_path())
    oparse.add_option("-r", "--role", dest="role", default="manager")
    oparse.add_option("-q", "--queue", dest="qname", default="")
    oparse.add_option("-n", "--number", dest="number", default="")
    (opts, args) = oparse.parse_args(args=argv)

    opts.config_file = os.path.abspath(opts.config_file)

    try:
        config = get_config(opts.config_file, opts)
    except ConfigError, e:
        print >> sys.stderr, e
        sys.exit(1)