/**
 * The InfluxdbWriter type writes check result metrics and
 * performance data to an InfluxDB v1 HTTP API
 */

object InfluxdbWriter "influxdb" {
  host = "<influxdb server address>"
  // Deafult influxdb service port is 8086, if not, please change it.
  port = 8086
  // Default database name is icinga
  database = "icinga"
  // influxdb username
  username = "<username>"
  // influxdb password
  password = "<password>"
  flush_threshold = 1024
  flush_interval = 30s
  host_template = {
    measurement = "$host.check_command$"
    tags = {
      hostname = "$host.name$"
      state = "$host.state$"
    }
  }
  service_template = {
    measurement = "$service.check_command$"
    tags = {
      hostname = "$host.name$",
      service = "$service.name$"
      output_data = "$service.last_check_result.output$"
    }
  }
}