node_exporter: Run textfile collectors every 10min
This commit is contained in:
parent
c98c7fd7bb
commit
e5d0752812
2 changed files with 43 additions and 0 deletions
|
@ -40,6 +40,28 @@
|
|||
group: _nodeexporter
|
||||
when: ansible_os_family == "OpenBSD"
|
||||
|
||||
- name: Create directory for textfile collector scripts
|
||||
ansible.builtin.file:
|
||||
path: /usr/local/libexec/node-exporter
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Add script for running textfile collector scripts
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/local/sbin/node-exporter-run-textfile-collector
|
||||
src: node-exporter-run-textfile-collector.sh
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Add cron job for running textfile collector scripts
|
||||
ansible.builtin.cron:
|
||||
name: node-exporter-run-textfile-collector
|
||||
job: /usr/local/sbin/node-exporter-run-textfile-collector
|
||||
minute: "*/10"
|
||||
|
||||
- name: Modify config
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/default/prometheus-node-exporter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue