1
0
mirror of https://github.com/alexreinert/homematic_check_mk.git synced 2023-10-10 13:37:02 +02:00
homematic_check_mk/check/web/plugins/perfometer/homematic.py
Alexander Reinert 594331e987 Initial commit
2017-06-25 21:24:20 +02:00

10 lines
364 B
Python

def perfometer_check_mk_homematic_dutycycle(row, check_command, perf_data):
dutycycle = float(perf_data[0][1])
state = row["service_state"]
color = { 0: "#39f", 1: "#ff2", 2: "#f22", 3: "#fa2" }[state]
return "%.0f%%" % dutycycle, perfometer_linear(dutycycle, color)
perfometers["check_mk-homematic.dutycycle"] = perfometer_check_mk_homematic_dutycycle