RedisCheckHelpers, OutputFormatHelpers
except ImportError:
    print "ERROR : this plugin needs the local redis_checks lib. Please install it"
    sys.exit(2)

#DEFAULT LIMITS
#--------------
DEFAULT_WARNING = 80.00
DEFAULT_CRITICAL = 90.00

# OPT parsing
# -----------
parser = optparse.OptionParser("%prog [options]", version="%prog " + version)

# add default parser
parser = RedisCheckHelpers.add_default_parser_options(parser)

parser.add_option(
    '-w',
    '--warning',
    dest="warning",
    type="float",
    help='Warning value for used memory. In [%]. Default : {d} [%]'.format(
        d=DEFAULT_WARNING))
parser.add_option(
    '-c',
    '--critical',
    dest="critical",
    type="float",
    help='Critical value ued memory. In [%]. Default : {d} [%]'.format(
        d=DEFAULT_CRITICAL))
        RedisCheckHelpers, OutputFormatHelpers
except ImportError:
    print "ERROR : this plugin needs the local redis_checks lib. Please install it"
    sys.exit(2)

#DEFAULT LIMITS
#--------------
DEFAULT_WARNING = 100
DEFAULT_CRITICAL = 200

# OPT parsing
# -----------
parser = optparse.OptionParser("%prog [options]", version="%prog " + version)

# add default parser
parser = RedisCheckHelpers.add_default_parser_options(parser)

parser.add_option(
    '-w',
    '--warning',
    dest="warning",
    type="float",
    help='Warning value for blocked clients. Default : {d}'.format(
        d=DEFAULT_WARNING))
parser.add_option(
    '-c',
    '--critical',
    dest="critical",
    type="float",
    help='Critical value for blocked clients. Default : {d}'.format(
        d=DEFAULT_CRITICAL))
Esempio n. 3
0
        RedisCheckHelpers, OutputFormatHelpers
except ImportError:
    print "ERROR : this plugin needs the local redis_checks lib. Please install it"
    sys.exit(2)

#DEFAULT LIMITS
#--------------
DEFAULT_WARNING = 50
DEFAULT_CRITICAL = 100

# OPT parsing
# -----------
parser = optparse.OptionParser("%prog [options]", version="%prog " + version)

# add default parser
parser = RedisCheckHelpers.add_default_parser_options(parser)

parser.add_option(
    '-w',
    '--warning',
    dest="warning",
    type="int",
    help='Warning value for connection. In [ms]. Default : {d} [ms]'.format(
        d=DEFAULT_WARNING))
parser.add_option(
    '-c',
    '--critical',
    dest="critical",
    type="int",
    help='Critical value for connection. In [ms]. Default : {d} [ms]'.format(
        d=DEFAULT_CRITICAL))
Esempio n. 4
0
try:
    from redis_checks import \
        RedisCheckHelpers, OutputFormatHelpers
except ImportError:
    print "ERROR : this plugin needs the local redis_checks lib. Please install it"
    sys.exit(2)


# OPT parsing
# -----------
parser = optparse.OptionParser(
    "%prog [options]", version="%prog " + version)

# add default parser
parser = RedisCheckHelpers.add_default_parser_options(parser)


if __name__ == '__main__':
    # Ok first job : parse args
    opts, args = parser.parse_args()
    if args:
        parser.error("Does not accept any argument.")

    # connection parameters
    port = opts.port
    hostname = opts.hostname
    password = opts.password
    database = opts.database
    debug = opts.debug
except ImportError:
    print "ERROR : this plugin needs the local redis_checks lib. Please install it"
    sys.exit(2)

#DEFAULT LIMITS
#--------------
DEFAULT_WARNING = 2000
DEFAULT_CRITICAL = 5000

# OPT parsing
# -----------
parser = optparse.OptionParser(
    "%prog [options]", version="%prog " + version)

# add default parser
parser = RedisCheckHelpers.add_default_parser_options(parser)

parser.add_option('-w', '--warning',
                  dest="warning", type="float",
                  help='Warning value for connected clients. Default : {d}'.format(d=DEFAULT_WARNING)
)
parser.add_option('-c', '--critical',
                  dest="critical", type="float",
                  help='Critical value for connected clients. Default : {d}'.format(d=DEFAULT_CRITICAL)
)

if __name__ == '__main__':
    # Ok first job : parse args
    opts, args = parser.parse_args()
    if args:
        parser.error("Does not accept any argument.")