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

object InfluxdbWriter "influxdb" {
  host = "<telegraf server address>"
  port = 9081
  basic_auth = {
     username = "<telegraf authentication username>"
     password = "<telegraf authentication password>"
  }
  flush_threshold = 1024
  flush_interval = 30s
  host_template = {
    measurement = "$host.check_command$"
    tags = {
      hostname = "$host.name$"
      state = "$host.state$"
    }
  }
  service_template = {
    measurement = "$service.vars.measurement$"
    tags = {
      hostname = "$host.name$",
      service = "$service.name$"
      output_data = "$service.last_check_result.output$"
    }
  }
}
