Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prometheus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible-shared
prometheus
Commits
6c19dbfe
Commit
6c19dbfe
authored
3 years ago
by
Thomas Schneider
Browse files
Options
Downloads
Patches
Plain Diff
node_exporter: Add needrestart integration
parent
0ac990b4
No related branches found
No related tags found
No related merge requests found
Pipeline
#3678
failed
3 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
node_exporter/defaults/main.yml
+12
-0
12 additions, 0 deletions
node_exporter/defaults/main.yml
node_exporter/tasks/main.yml
+3
-0
3 additions, 0 deletions
node_exporter/tasks/main.yml
node_exporter/tasks/needrestart.yml
+48
-0
48 additions, 0 deletions
node_exporter/tasks/needrestart.yml
with
63 additions
and
0 deletions
node_exporter/defaults/main.yml
+
12
−
0
View file @
6c19dbfe
---
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 %}
This diff is collapsed.
Click to expand it.
node_exporter/tasks/main.yml
+
3
−
0
View file @
6c19dbfe
...
...
@@ -59,3 +59,6 @@
-
prometheus
-
prometheus-exporter
-
config
-
import_tasks
:
needrestart.yml
when
:
node_exporter_needrestart
This diff is collapsed.
Click to expand it.
node_exporter/tasks/needrestart.yml
0 → 100644
+
48
−
0
View file @
6c19dbfe
---
-
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment