if (plugin.checkThreshold(data['wireless']['noisef'], 3) !=
            plugin.returnValues['OK']):
        plugin.returnString += " noise"
    if (plugin.checkThreshold(data['wireless']['ccq'] / 10, 4) !=
            plugin.returnValues['OK']):
        plugin.returnString += " ccq"
    if (plugin.checkThreshold(data['wireless']['polling']['quality'], 5) !=
            plugin.returnValues['OK']):
        plugin.returnString += " airmaxquality"
    if (plugin.checkThreshold(data['wireless']['polling']['capacity'], 6) !=
            plugin.returnValues['OK']):
        plugin.returnString += " airmaxcapacity"
    if (plugin.checkThreshold(data['wireless']['txrate'], 7) !=
            plugin.returnValues['OK']):
        plugin.returnString += " txrate"
    if (plugin.checkThreshold(data['wireless']['rxrate'], 8) !=
            plugin.returnValues['OK']):
        plugin.returnString += " rxrate"

# Output result
    plugin.finish()

except Exception, e:
    if (verbose >= 2):
        traceback.print_exc(e)
    plugin.returnValue = plugin.returnValues['UNKNOWN']
    plugin.returnString = str(e)

    # Output result
    plugin.finish()
Пример #2
0
	if (plugin.checkThreshold (data['wireless']['signal'], 0) != plugin.returnValues['OK']):
		plugin.returnString += " signal"
	if (plugin.checkThreshold ((96 - data['wireless']['chainrssi'][0]) * -1, 1) != plugin.returnValues['OK']):
		plugin.returnString += " signalchain0"
	if (plugin.checkThreshold ((96 - data['wireless']['chainrssi'][1]) * -1, 2) != plugin.returnValues['OK']):
		plugin.returnString += " signalchain1"
	if (plugin.checkThreshold (data['wireless']['noisef'], 3) != plugin.returnValues['OK']):
		plugin.returnString += " noise"
	if (plugin.checkThreshold (data['wireless']['ccq'] / 10, 4) != plugin.returnValues['OK']):
		plugin.returnString += " ccq"
	if (plugin.checkThreshold (data['wireless']['polling']['quality'], 5) != plugin.returnValues['OK']):
		plugin.returnString += " airmaxquality"
	if (plugin.checkThreshold (data['wireless']['polling']['capacity'], 6) != plugin.returnValues['OK']):
		plugin.returnString += " airmaxcapacity"
	if (plugin.checkThreshold (data['wireless']['txrate'], 7) != plugin.returnValues['OK']):
		plugin.returnString += " txrate"
	if (plugin.checkThreshold (data['wireless']['rxrate'], 8) != plugin.returnValues['OK']):
		plugin.returnString += " rxrate"

 	# Output result
 	plugin.finish()

except Exception, e:
	if (verbose >= 2):
		traceback.print_exc(e)
	plugin.returnValue = plugin.returnValues['UNKNOWN']
	plugin.returnString = str(e)

 	# Output result
 	plugin.finish()
Пример #3
0
    if plugin.checkThreshold(data.gps.sats, 9) != plugin.returnValues["OK"]:
        plugin.returnString += " gps.sats"

        # Check booleans
    boolchecks = plugin.options.boolean.split(",")
    for boolcheck in boolchecks:
        if not len(boolcheck):
            continue
        boolcheckKeyVal = boolcheck.partition("=")
        if not len(boolcheckKeyVal[0]) or not len(boolcheckKeyVal[2]):
            continue
        try:
            boolcheckKeyVal_data = eval("data." + boolcheckKeyVal[0])
        except AttributeError:
            plugin.returnValue = plugin.returnValues["UNKNOWN"]
            plugin.returnString = boolcheckKeyVal[0]
            plugin.finish()
        if not str(boolcheckKeyVal_data) == boolcheckKeyVal[2]:
            plugin.returnValue = plugin.returnValues["CRITICAL"]
            plugin.returnString += " %s" % boolcheckKeyVal[0]
        plugin.addPerformanceData(boolcheckKeyVal[0], str(boolcheckKeyVal_data))

        # Output result
    plugin.finish()

except Exception, e:
    if verbose >= 2:
        traceback.print_exc(e)
    plugin.returnValue = plugin.returnValues["UNKNOWN"]
    plugin.returnString = str(e)
Пример #4
0
    if (plugin.checkThreshold(data.gps.sats, 9) != plugin.returnValues['OK']):
        plugin.returnString += " gps.sats"

    # Check booleans
    boolchecks = plugin.options.boolean.split(",")
    for boolcheck in boolchecks:
        if (not len(boolcheck)):
            continue
        boolcheckKeyVal = boolcheck.partition("=")
        if (not len(boolcheckKeyVal[0]) or not len(boolcheckKeyVal[2])):
            continue
        try:
            boolcheckKeyVal_data = eval('data.' + boolcheckKeyVal[0])
        except AttributeError:
            plugin.returnValue = plugin.returnValues['UNKNOWN']
            plugin.returnString = boolcheckKeyVal[0]
            plugin.finish()
        if (not str(boolcheckKeyVal_data) == boolcheckKeyVal[2]):
            plugin.returnValue = plugin.returnValues['CRITICAL']
            plugin.returnString += " %s" % boolcheckKeyVal[0]
        plugin.addPerformanceData(boolcheckKeyVal[0],
                                  str(boolcheckKeyVal_data))

# Output result
    plugin.finish()

except Exception, e:
    if (verbose >= 2):
        traceback.print_exc(e)
    plugin.returnValue = plugin.returnValues['UNKNOWN']
    plugin.returnString = str(e)