Skip to content
Snippets Groups Projects
Commit 6c19dbfe authored by Thomas Schneider's avatar Thomas Schneider
Browse files

node_exporter: Add needrestart integration

parent 0ac990b4
No related branches found
No related tags found
No related merge requests found
Pipeline #3678 failed
---
node_exporter_args: ""
force_smartmontools_on_vm_guest: false
node_exporter_needrestart: true
needrestart2prom_version: "ff8645ab287017d248ab946e09225b1a60fcbba1"
needrestart2prom_arch: >-
{% if ansible_architecture == "x86_64" -%}
amd64
{%- elif ansible_architecture == "aarch64" -%}
arm64
{%- elif ansible_architecture[:3] == "arm" -%}
{{ ansible_architecture[:5] }}
{%- else -%}
{{ ansible_architecture }}
{%- endif %}
......@@ -59,3 +59,6 @@
- prometheus
- prometheus-exporter
- config
- import_tasks: needrestart.yml
when: node_exporter_needrestart
---
- name: Install needrestart
apt:
name: needrestart
state: present
tags:
- prometheus
- prometheus-exporter
- name: Install needrestart2prom
get_url:
url: >-
https://git.fsmpi.rwth-aachen.de/api/v4/projects/233/packages/generic/needrestart2prom/{{
needrestart2prom_version }}/needrestart2prom-{{ ansible_system|lower }}-{{
needrestart2prom_arch }}
dest: /usr/local/bin/needrestart2prom
force: true
owner: root
group: root
mode: '0755'
tags:
- prometheus
- prometheus-exporter
- name: Configure needrestart2prom cronjob PATH
cron:
cron_file: needrestart2prom
user: root
env: true
# Yes, this module actually works this way.
name: PATH
job: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
tags:
- prometheus
- prometheus-exporter
- name: Configure needrestart2prom cronjob
cron:
cron_file: needrestart2prom
user: root
name: needrestart2prom
job: >-
/usr/local/bin/needrestart2prom -outfile
/var/lib/prometheus/node-exporter/needrestart.prom
tags:
- prometheus
- prometheus-exporter
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment