summaryrefslogtreecommitdiffstats
path: root/modules/prometheus
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 /modules/prometheus
parentf6cf5fc61ac1e6d1eda3fcc4c95e3c5ace575ffb (diff)
downloadpuppet-tozt-c7e910371957aff3702c297069226cc345fe9bf0.tar.gz
puppet-tozt-c7e910371957aff3702c297069226cc345fe9bf0.zip
try out prometheus
Diffstat (limited to 'modules/prometheus')
-rw-r--r--modules/prometheus/files/prometheus.yml10
-rw-r--r--modules/prometheus/manifests/init.pp19
2 files changed, 29 insertions, 0 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'],
+ ];
+ }
+}