forked from openstack/kolla
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prometheus Dell hardware exporter
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
1 parent
d55cfe7
commit bc40122
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
docker/prometheus/prometheus-dellhw-exporter/Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ | ||
&& find . -type f -print0 | xargs -0 sed -i 's/Sirupsen/sirupsen/g' \ | ||
&& go get -d ./... \ | ||
&& 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 |
6 changes: 6 additions & 0 deletions
6
releasenotes/notes/add-prometheus-dellhw-exporter-b5a279b9d6b5f02b.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |