Skip to content
Snippets Groups Projects
services_homematic.conf 820 B

apply Service "homematic-exporter" {
  import "generic-service"

  check_command = "http"
  enable_perfdata = false

  vars.http_address = "{{ hostvars['ogg'].int_ip4 }}"
  vars.http_port = 8010
  vars.http_uri = "/metrics"

  groups = [ "exporter", "homematic" ]

  assign where host.name == "ogg"
}

{% for device in homematic.devices_heizung %}

apply Service "{{ device.name }}_homematic_lowbat" {
  import "generic-service"

  check_command = "check_metric_value"
  enable_perfdata = true

  vars.metric_url = "http://{{ hostvars['ogg'].int_ip4 }}:8010/metrics"
  vars.metric_name = "homematic_lowbat"
  vars.metric_labelname = "device"
  vars.metric_labelvalue = "{{ device.id }}:0"
  vars.metric_operator = "gt"
  vars.metric_warn = "0"
  vars.metric_crit = "0"

  assign where host.name == "ogg"
}

{% endfor %}