Skip to content
Snippets Groups Projects
Commit 2529c17d authored by Jonas Leder's avatar Jonas Leder
Browse files

add ipmi and zfs exporter

parent f4035464
Branches
No related tags found
No related merge requests found
[Unit]
Description=IPMI Metrics Exporter for Prometheus
After=network.target
Wants=network-online.target
[Service]
Restart=always
Type=simple
ExecStart=/usr/local/bin/ipmi_exporter
Environment=
[Install]
WantedBy=multi-user.target
\ No newline at end of file
[Unit]
Description=ZFS Metrics Exporter for Prometheus
After=network.target
Wants=network-online.target
[Service]
Restart=always
Type=simple
ExecStart=/usr/local/bin/zfs_exporter
Environment=
[Install]
WantedBy=multi-user.target
\ No newline at end of file
- name: Install Prometheus IPMI exporter
hosts: all
vars:
ipmi_exporter_version: 1.8.0
arch: "{% if ansible_architecture == 'x86_64' %}amd64{% elif ansible_architecture == 'aarch64' %}arm64{% endif %}"
tasks:
- name: download ipmi-exporter release
get_url:
url: "https://github.com/prometheus-community/ipmi_exporter/releases/download/v{{ ipmi_exporter_version }}/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{ arch }}.tar.gz"
dest: /tmp/ipmi_exporter.tar.gz
- name: extract ipmi-exporter release
unarchive:
src: /tmp/ipmi_exporter.tar.gz
dest: /tmp
remote_src: yes
- name: delete old binary if exists
file:
path: /usr/local/bin/ipmi_exporter
state: absent
- name: move ipmi-exporter binary
shell: cp /tmp/ipmi_exporter-{{ ipmi_exporter_version }}.linux-{{ arch }}/ipmi_exporter /usr/local/bin/ipmi_exporter
- name: install systemd-service
copy:
src: files/ipmi_exporter.service
dest: /etc/systemd/system/ipmi_exporter.service
mode: 0644
- name: reload systemd
systemd:
daemon_reload: yes
- name: enable ipmi-exporter service
systemd:
name: ipmi_exporter
enabled: yes
state: started
- name: delete temporary files
file:
path: /tmp/ipmi_exporter*
state: absent
- name: check ipmi-exporter status
uri:
url: http://localhost:9290/metrics
status_code: 200
timeout: 5
return_content: yes
register: ipmi_exporter_status
until: ipmi_exporter_status.status == 200
retries: 5
delay: 5
\ No newline at end of file
- name: Install Prometheus ZFS exporter
hosts: all
vars:
zfs_exporter_version: 2.3.2
arch: "{% if ansible_architecture == 'x86_64' %}amd64{% elif ansible_architecture == 'aarch64' %}arm64{% endif %}"
tasks:
- name: download zfs-exporter release
get_url:
url: "https://github.com/pdf/zfs_exporter/releases/download/v{{ zfs_exporter_version }}/zfs_exporter-{{ zfs_exporter_version }}.linux-{{ arch }}.tar.gz"
dest: /tmp/zfs_exporter.tar.gz
- name: extract zfs-exporter release
unarchive:
src: /tmp/zfs_exporter.tar.gz
dest: /tmp
remote_src: yes
- name: delete old binary if exists
file:
path: /usr/local/bin/zfs_exporter
state: absent
- name: move zfs-exporter binary
shell: cp /tmp/zfs_exporter-{{ zfs_exporter_version }}.linux-{{ arch }}/zfs_exporter /usr/local/bin/zfs_exporter
- name: install systemd-service
copy:
src: files/zfs_exporter.service
dest: /etc/systemd/system/zfs_exporter.service
mode: 0644
- name: reload systemd
systemd:
daemon_reload: yes
- name: enable zfs-exporter service
systemd:
name: zfs_exporter
enabled: yes
state: started
- name: delete temporary files
file:
path: /tmp/zfs_exporter*
state: absent
- name: check zfs-exporter status
uri:
url: http://localhost:9134/metrics
status_code: 200
timeout: 5
return_content: yes
register: zfs_exporter_status
until: zfs_exporter_status.status == 200
retries: 5
delay: 5
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment