summaryrefslogtreecommitdiffstats
path: root/salt/profile/prometheus/node_exporter.sls
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-02-15 21:02:04 +0100
committerGeorg Pfuetzenreuter2023-02-21 19:06:01 +0100
commit8016f86164450f4eda4f1488f48cf44de0d4655f (patch)
treebcca89ce2111e39e0b326b1d1bd3b7c32d1500f4 /salt/profile/prometheus/node_exporter.sls
parent2bafbeedd72e4d3c02da56cf361f98e50382ce13 (diff)
downloadsalt-8016f86164450f4eda4f1488f48cf44de0d4655f.tar.gz
salt-8016f86164450f4eda4f1488f48cf44de0d4655f.tar.bz2
salt-8016f86164450f4eda4f1488f48cf44de0d4655f.zip
p.node_exporter->p.prometheus.node_exporter
Since the last commit introduced a new Prometheus targets profile, it makes sense to move node_exporter underneath the Prometheus tree as well. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'salt/profile/prometheus/node_exporter.sls')
-rw-r--r--salt/profile/prometheus/node_exporter.sls36
1 files changed, 36 insertions, 0 deletions
diff --git a/salt/profile/prometheus/node_exporter.sls b/salt/profile/prometheus/node_exporter.sls
new file mode 100644
index 0000000..1e46b3d
--- /dev/null
+++ b/salt/profile/prometheus/node_exporter.sls
@@ -0,0 +1,36 @@
+{%- set header = salt['pillar.get']('managed_header_pound') -%}
+{%- set sysconfig = '/etc/sysconfig/prometheus-node_exporter' -%}
+
+node_exporter_packages:
+ pkg.installed:
+ - pkgs:
+ - golang-github-prometheus-node_exporter
+
+node_exporter_sysconfig_header:
+ file.prepend:
+ - name: {{ sysconfig }}
+ - text: '{{ header }}'
+ - require:
+ - pkg: node_exporter_packages
+
+node_exporter_sysconfig:
+ file.replace:
+ - name: {{ sysconfig }}
+ - pattern: |
+ ^ARGS=.*$
+ - repl: |
+ ARGS="--web.listen-address=:9200 --collector.filesystem.fs-types-exclude='^(fuse.s3fs|fuse.cryfs|tmpfscgroup2?|debugfs|devpts|devtmpfs|fusectl|overlay|proc|procfs|pstore)\$' --no-collector.zfs --no-collector.thermal_zone --no-collector.powersupplyclass"
+ - require:
+ - pkg: node_exporter_packages
+ - file: node_exporter_sysconfig_header
+
+node_exporter_service:
+ service.running:
+ - name: prometheus-node_exporter.service
+ - enable: True
+ - full_restart: True
+ - require:
+ - pkg: node_exporter_packages
+ - file: node_exporter_sysconfig
+ - watch:
+ - file: node_exporter_sysconfig