summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-07-01 22:12:28 -0400
committerJesse Luehrs <doy@tozt.net>2021-07-01 22:12:28 -0400
commitc7e910371957aff3702c297069226cc345fe9bf0 (patch)
treed7694e2e0bdee9765d0e29148f2daf80bb396bef
parentf6cf5fc61ac1e6d1eda3fcc4c95e3c5ace575ffb (diff)
downloadpuppet-tozt-c7e910371957aff3702c297069226cc345fe9bf0.tar.gz
puppet-tozt-c7e910371957aff3702c297069226cc345fe9bf0.zip
try out prometheus
-rw-r--r--modules/prometheus/files/prometheus.yml10
-rw-r--r--modules/prometheus/manifests/init.pp19
-rw-r--r--modules/tick/templates/telegraf.conf7
3 files changed, 31 insertions, 5 deletions
diff --git a/modules/prometheus/files/prometheus.yml b/modules/prometheus/files/prometheus.yml
new file mode 100644
index 0000000..c87b181
--- /dev/null
+++ b/modules/prometheus/files/prometheus.yml
@@ -0,0 +1,10 @@
+global:
+ scrape_interval: 10s
+
+scrape_configs:
+- job_name: telegraf
+ static_configs:
+ - targets:
+<% @vpn_ips.each do |_, ip| -%>
+ - "<%= @ip %>:9273"
+<% end -%>
diff --git a/modules/prometheus/manifests/init.pp b/modules/prometheus/manifests/init.pp
new file mode 100644
index 0000000..a019afc
--- /dev/null
+++ b/modules/prometheus/manifests/init.pp
@@ -0,0 +1,19 @@
+class prometheus {
+ package { "prometheus":
+ ensure => installed;
+ }
+
+ file { "/etc/prometheus/prometheus.yml":
+ source => "puppet:///modules/prometheus/prometheus.yml",
+ require => Package['prometheus'];
+ }
+
+ service { "prometheus":
+ ensure => running,
+ enable => true,
+ require => [
+ Package['prometheus'],
+ File['/etc/prometheus/prometheus.yml'],
+ ];
+ }
+}
diff --git a/modules/tick/templates/telegraf.conf b/modules/tick/templates/telegraf.conf
index 4fffce8..67593da 100644
--- a/modules/tick/templates/telegraf.conf
+++ b/modules/tick/templates/telegraf.conf
@@ -10,8 +10,5 @@
precision = ""
hostname = ""
omit_hostname = false
-[[outputs.influxdb_v2]]
- urls = ["https://influxdb.tozt.net"]
- token = "<%= @influxdb_token %>"
- organization = "tozt"
- bucket = "telegraf"
+[[outputs.prometheus_client]]
+ listen = ":9273"