copr: change node_exporter settings according to changes in golang-github-prometheus-node-exporter

This commit is contained in:
Silvie Chlupova 2022-04-27 14:47:47 +02:00
parent 666caebe25
commit b951f4ec82
4 changed files with 7 additions and 15 deletions

View file

@ -171,14 +171,6 @@
- name: start node exporter
service: state=started enabled=yes name=node_exporter
- name: configure options in node exporter
lineinfile:
path: /etc/sysconfig/node_exporter
regexp: '^OPTIONS='
line: 'OPTIONS=--collector.textfile.directory /var/lib/node_exporter/textfile_collector --collector.systemd'
backrefs: yes
notify: restart node_exporter
# setup dirs for the ansible execution off of provisioning
#- name: dirs from provision
# file: state=directory path="/home/copr/provision/{{ item }}" owner=copr group=copr

View file

@ -50,7 +50,7 @@
- packages
- name: install node_exporter
dnf: state=present pkg=golang-github-prometheus-node-exporter-1.2.2
dnf: state=present pkg=golang-github-prometheus-node-exporter
tags:
- packages

View file

@ -44,6 +44,6 @@ if __name__ == '__main__':
"assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=0&" \
"initialassumedservicestate=0&timeperiod=last7days&backtrack=4"
collect(copr_cdn_url, "copr_cdn_status", "Copr's CDN status", "td.serviceOK:nth-child(4)",
"/var/lib/node_exporter/textfile_collector/copr_cdn_status.prom.new")
"/var/lib/prometheus/node-exporter/copr_cdn_status.prom.new")
collect(copr_ping_url, "copr_ping_status", "Status of build of copr-ping package", "td.serviceOK:nth-child(4)",
"/var/lib/node_exporter/textfile_collector/copr_ping_status.prom.new")
"/var/lib/prometheus/node-exporter/copr_ping_status.prom.new")

View file

@ -34,7 +34,7 @@
name: "generating prometheus metrics"
user: root
minute: 0
job: "/usr/bin/python3 /usr/bin/monitoring.py && mv -f /var/lib/node_exporter/textfile_collector/copr_cdn_status.prom.new /var/lib/node_exporter/textfile_collector/copr_cdn_status.prom && mv -f /var/lib/node_exporter/textfile_collector/copr_ping_status.prom.new /var/lib/node_exporter/textfile_collector/copr_ping_status.prom"
job: "/usr/bin/python3 /usr/bin/monitoring.py && mv -f /var/lib/prometheus/node-exporter/copr_cdn_status.prom.new /var/lib/prometheus/node-exporter/copr_cdn_status.prom && mv -f /var/lib/prometheus/node-exporter/copr_ping_status.prom.new /var/lib/prometheus/node-exporter/copr_ping_status.prom"
tags:
- cron_tasks
@ -190,9 +190,9 @@
- name: configure options in node exporter
lineinfile:
path: /etc/sysconfig/node_exporter
regexp: '^OPTIONS='
line: 'OPTIONS=--collector.textfile.directory /var/lib/node_exporter/textfile_collector --collector.systemd'
path: /etc/default/prometheus-node-exporter
regexp: '^ARGS='
line: 'ARGS=--collector.textfile.directory="/var/lib/prometheus/node-exporter" --collector.systemd'
backrefs: yes
notify: restart node_exporter