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
2017-07-23 08:55:02 +02:00

10 lines
364 B
Python
Executable File

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