Example #1
0
def parse_input():
    parser = argparse.ArgumentParser()
    parser.add_argument("-w", "--warning", action="store",
                        required=True, type=int,
                        help="Warning threshold in percentage")
    parser.add_argument("-c", "--critical", action="store",
                        required=True, type=int,
                        help="Critical threshold in percentage")
    sadf.add_common_args(parser)
    args = parser.parse_args()
    return args
def parse_input():
    parser = argparse.ArgumentParser()
    parser.add_argument("-w", "--warning", action="store",
                        required=True, type=int,
                        help="Warning threshold in percentage")
    parser.add_argument("-c", "--critical", action="store",
                        required=True, type=int,
                        help="Critical threshold in percentage")
    sadf.add_common_args(parser)
    args = parser.parse_args()
    return args
def parse_cmdargs():
    parser = argparse.ArgumentParser(description=_description)
    sadf.add_common_args(parser)

    group = parser.add_mutually_exclusive_group()
    group.add_argument("-e", "--exclude", action="append",
                       help="exclude given interface")
    group.add_argument("-i", "--include", action="append",
                       help="add given interface for monitoring")
    group.add_argument("-a", "--all", action="store_true", default=False,
                       help="get status of all interfaces")

    args = parser.parse_args()
    return args