Exemplo n.º 1
0
    )

    result = plugin.argparser.args.result
    if result is None:
        result = random.randint(1, 20)
        log.debug("Checking result value of %d.", result)
    else:
        if result < 0 or result > 20:
            plugin.die((" invalid number supplied for the -r option, " +
                    "must be between 0 and 20"))

    plugin.add_perfdata(
            label = 'Result',
            value = result,
            threshold = plugin.threshold,
            min_data = 0,
            max_data = 20,
    )

    if verbose > 1:
        log.debug("Plugin object:\n" + pp(plugin.as_dict()))

    plugin.exit(
            code = plugin.check_threshold(result),
            message = (" sample result was %d" % (result))
    )

#==============================================================================

# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4