Skip to content

Commit

Permalink
Add Prometheus Dell hardware exporter
Browse files Browse the repository at this point in the history
Adds a Prometheus exporter for Dell hardware components. Metrics such
as chassis battery level, fan speed, power consumption, temperature
and hardware status are reported.
  • Loading branch information
dougszumski committed May 31, 2019
1 parent d55cfe7 commit a4d0e3d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docker/prometheus/prometheus-dellhw-exporter/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM {{ namespace }}/{{ image_prefix }}prometheus-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"

{% import "macros.j2" as macros with context %}

{% block prometheus_dellhw_exporter_header %}{% endblock %}

{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set prometheus_dellhw_exporter_packages = [
'go',
'make',
] %}
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set prometheus_dellhw_exporter_packages = [
'golang-go',
'make',
] %}
{% endif %}

{{ macros.install_packages(prometheus_dellhw_exporter_packages | customizable("packages")) }}

{% block prometheus_dellhw_exporter_version %}
ARG prometheus_dellhw_exporter_version=v1.3.5
ARG prometheus_dellhw_exporter_url=https://github.com/galexrt/dellhw_exporter/archive/${prometheus_dellhw_exporter_version}.tar.gz
{% endblock %}

{% block prometheus_dellhw_exporter_install %}
ENV GOPATH=/tmp
RUN curl -sSL -o /tmp/dellhw_exporter.tar.gz ${prometheus_dellhw_exporter_url} \
&& mkdir /tmp/dellhw_exporter \
&& tar --strip 1 -xvf /tmp/dellhw_exporter.tar.gz -C /tmp/dellhw_exporter \
&& cd /tmp/dellhw_exporter \
&& go get -d ./... \
&& find . -type f -print0 | xargs -0 sed -i 's/Sirupsen/sirupsen/g' \
&& make build \
&& install -m 0755 dellhw_exporter /opt/ \
&& rm -rf /tmp/dellhw_exporter*
{% endblock %}

{% block prometheus_dellhw_exporter_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER prometheus
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Add a Prometheus exporter for Dell hardware components. Metrics such
as chassis battery level, fan speed, power consumption, temperature
and hardware status are reported.

0 comments on commit a4d0e3d

Please sign in to comment.