mirror of
https://github.com/alexreinert/homematic_check_mk.git
synced 2023-10-10 11:37:02 +00:00
Initial commit
This commit is contained in:
9
check/web/plugins/perfometer/homematic.py
Normal file
9
check/web/plugins/perfometer/homematic.py
Normal file
@@ -0,0 +1,9 @@
|
||||
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
|
||||
|
59
check/web/plugins/wato/homematic.py
Normal file
59
check/web/plugins/wato/homematic.py
Normal file
@@ -0,0 +1,59 @@
|
||||
checkgroups = []
|
||||
subgroup_os = _("Temperature, Humidity, Electrical Parameters, etc.")
|
||||
|
||||
register_check_parameters(
|
||||
subgroup_os,
|
||||
"homematic_humidity",
|
||||
_("Homematic Humidity"),
|
||||
Dictionary(
|
||||
title = _("Parameters for the Homematic Humidity check"),
|
||||
help = _(""),
|
||||
elements = [
|
||||
( "warning",
|
||||
Tuple(
|
||||
title = _("Warning level of humidity"),
|
||||
elements = [
|
||||
Integer(title = _("Lower than"), default_value = 40),
|
||||
Integer(title = _("Higher than"), default_value = 60),
|
||||
],
|
||||
),
|
||||
),
|
||||
( "critical",
|
||||
Tuple(
|
||||
title = _("Critical level of humidity"),
|
||||
elements = [
|
||||
Integer(title = _("Lower than"), default_value = 30),
|
||||
Integer(title = _("Higher than"), default_value = 70),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
TextAscii(
|
||||
title = _("Name of the device"),
|
||||
),
|
||||
match_type = "dict",
|
||||
)
|
||||
|
||||
register_check_parameters(
|
||||
subgroup_os,
|
||||
"homematic_dutycycle",
|
||||
_("Homematic Duty cycle"),
|
||||
Dictionary(
|
||||
title = _("Parameters for the Homematic Duty cycle check"),
|
||||
help = _(""),
|
||||
elements = [
|
||||
( "warning",
|
||||
Integer(title = _("Warning level of duty cycle"), default_value = 50)
|
||||
),
|
||||
( "critical",
|
||||
Integer(title = _("Critical level of duty cycle"), default_value = 70)
|
||||
),
|
||||
],
|
||||
),
|
||||
TextAscii(
|
||||
title = _("Name of the device"),
|
||||
),
|
||||
match_type = "dict",
|
||||
)
|
||||
|
Reference in New Issue
Block a user