Browse Source

Added a prometheus exporter for slurm.

pull/8/head
Egon Rijpkema 4 years ago
parent
commit
39b7ef7bd0
  1. 5
      promtools/Dockerfile
  2. 38
      roles/slurm_exporter/tasks/main.yml
  3. 10
      roles/slurm_exporter/templates/prometheus-slurm-exporter.service
  4. 10
      slurm_exporter.yml

5
promtools/Dockerfile

@ -24,6 +24,11 @@ RUN go get github.com/HewlettPackard/lustre_exporter && \ @@ -24,6 +24,11 @@ RUN go get github.com/HewlettPackard/lustre_exporter && \
go build && \
cp /go/bin/lustre_exporter /results
RUN go get github.com/vpenso/prometheus-slurm-exporter && \
cd ${GOPATH-$HOME/go}/src/github.com/vpenso/prometheus-slurm-exporter && \
go build && \
cp /go/bin/prometheus-slurm-exporter /results
RUN go get git.webhosting.rug.nl/HPC/nvidia_smi_exporter.git && \
cd "${GOPATH-$HOME/go}/src/git.webhosting.rug.nl/HPC/nvidia_smi_exporter.git" && \
go build && \

38
roles/slurm_exporter/tasks/main.yml

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
---
- set_fact:
service_name: prometheus-slurm-exporter
- file:
path: /usr/local/prometheus
state: directory
mode: 0755
- name: Install binary
copy:
src: "{{ playbook_dir }}/promtools/results/{{ service_name }}"
dest: "/usr/local/prometheus/{{ service_name }}"
mode: 0755
- name: Install service files.
template:
src: "templates/{{ service_name }}.service"
dest: "/etc/systemd/system/{{ service_name }}.service"
mode: 644
owner: root
group: root
tags:
- service-files
- name: install service files
command: systemctl daemon-reload
- name: enable service at boot
systemd:
name: "{{ service_name }}.service"
enabled: yes
- name: make sure servcies are started.
systemd:
name: "{{ service_name }}"
state: restarted
tags:
- start-service

10
roles/slurm_exporter/templates/prometheus-slurm-exporter.service

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
[Unit]
Description=prometheus node exporter
[Service]
TimeoutStartSec=0
Restart=always
ExecStart=/usr/local/prometheus/prometheus-slurm-exporter -listen-address ":9102"
[Install]
WantedBy=multi-user.target

10
slurm_exporter.yml

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
---
- hosts: prometheus_proxy
name: Dummy to gather facts
tasks: []
- hosts: interactive
become: True
roles:
- slurm_exporter
- prom_client
Loading…
Cancel
Save