Exemplo n.º 1
0
    # perform checks on the clusters state
    cluster.health_checks()

    # Now with the object model complete, we can provide the info
    # to the user
    if cluster.output_mode == 'console':
        console_mode()

    elif cluster.output_mode in ['json', 'keyvalue']:
        log_mode()


if __name__ == '__main__':

    # initialise any global variables
    cfg.init()

    usageInfo = "usage: %prog [options]"

    parser = OptionParser(usage=usageInfo, version="%prog 0.64")
    parser.add_option("-s", "--state", dest="state", action="store_true", help="show highlevel health of the cluster")
    parser.add_option("-v", "--volume", dest="volumes", action="store_true",
                      help="volume info (default is ALL, or supply a volume name)")
    parser.add_option("-b", "--backlog", dest="selfheal", action="store_true", default=False,
                      help="Look deeper at self heal state (Use with -a)")
    parser.add_option("-a", "--all", dest="everything", action="store_true", default=False,
                      help="show all cluster information (-s with -v)")
    parser.add_option("-u", "--units", dest="units", choices=['bin', 'dec'],
                      help="display capacity units in DECimal or BINary format (GB vs GiB)")
    parser.add_option("-l", "--layout", dest="layout", action="store_true", default=False,
                      help="show brick layout when used with -v, or -a")
Exemplo n.º 2
0
    # perform checks on the clusters state
    cluster.health_checks()

    # Now with the object model complete, we can provide the info
    # to the user
    if cluster.output_mode == 'console':
        console_mode()

    elif cluster.output_mode in ['json', 'keyvalue']:
        log_mode()


if __name__ == '__main__':

    # initialise any global variables
    cfg.init()

    usageInfo = "usage: %prog [options]"

    parser = OptionParser(usage=usageInfo, version="%prog 0.66")
    parser.add_option("-s",
                      "--state",
                      dest="state",
                      action="store_true",
                      help="show highlevel health of the cluster")
    parser.add_option(
        "-v",
        "--volume",
        dest="volumes",
        action="store_true",
        help="volume info (default is ALL, or supply a volume name)")