diff --git a/jobs/telegraf-system/spec b/jobs/telegraf-system/spec index c601714..8051fc4 100644 --- a/jobs/telegraf-system/spec +++ b/jobs/telegraf-system/spec @@ -23,3 +23,6 @@ properties: telegraf.influxdb.retention_policy: description: InfluxDB database retention policy default: autogen + telegraf.prometheus.port: + description: Prometheus Bind Port + default: 9391 diff --git a/jobs/telegraf-system/templates/config/telegraf.conf.erb b/jobs/telegraf-system/templates/config/telegraf.conf.erb index 5d00bf9..74b04cb 100644 --- a/jobs/telegraf-system/templates/config/telegraf.conf.erb +++ b/jobs/telegraf-system/templates/config/telegraf.conf.erb @@ -17,6 +17,11 @@ database = "<%= p("telegraf.influxdb.database") %>" retention_policy = "<%= p("telegraf.influxdb.retention_policy") %>" +<% if telegraf.prometheus.port? %> +[[outputs.prometheus]] + port = ["<%= telegraf.prometheus.port %>"] +<% end %> + [[inputs.cpu]] percpu = false totalcpu = true