4 changed files with 105 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||
CONFIG_FILE=/opt/ipmi_exporter/etc/ipmi_exporter.yaml |
|||
LISTEN_ADDRESS=:9290 |
|||
LOG_LEVEL=info |
|||
@ -0,0 +1,16 @@ |
|||
[Unit] |
|||
Description=Remote IPMI exporter for Prometheus |
|||
Wants=network.target |
|||
After=network-online.target |
|||
|
|||
[Service] |
|||
Restart=always |
|||
Type=simple |
|||
EnvironmentFile=/opt/ipmi_exporter/etc/ipmi_exporter.env |
|||
ExecStart=/opt/ipmi_exporter/bin/ipmi_exporter --config.file ${CONFIG_FILE} --web.listen-address ${LISTEN_ADDRESS} --log.level=${LOG_LEVEL} |
|||
WorkingDirectory=/opt/ipmi_exporter/etc |
|||
User=root |
|||
Group=root |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target default.target |
|||
@ -0,0 +1,37 @@ |
|||
# Configuration file for ipmi_exporter |
|||
|
|||
# This is an example config for scraping remote hosts via IPMI. |
|||
# Information required to access remote IPMI interfaces can be supplied in the |
|||
# 'modules' section. A scrape can request the usage of a given config by |
|||
# setting the `module` URL parameter. |
|||
|
|||
modules: |
|||
#default: |
|||
# These settings are used if no module is specified, the |
|||
# specified module doesn't exist, or of course if |
|||
# module=default is specified. |
|||
#user: "default_user" |
|||
#pass: "example_pw" |
|||
# The below settings correspond to driver-type, privilege-level, and |
|||
# session-timeout respectively, see `man 5 freeipmi.conf` (and e.g. |
|||
# `man 8 ipmi-sensors` for a list of driver types). |
|||
#driver: "LAN_2_0" |
|||
#privilege: "user" |
|||
# The session timeout is in milliseconds. Note that a scrape can take up |
|||
# to (session-timeout * #-of-collectors) milliseconds, so set the scrape |
|||
# timeout in Prometheus accordingly. |
|||
#timeout: 10000 |
|||
# Available collectors are bmc, ipmi, chassis, dcmi, sel, and sm-lan-mode |
|||
# If _not_ specified, bmc, ipmi, chassis, and dcmi are used |
|||
#collectors: |
|||
#- bmc |
|||
#- ipmi |
|||
#- chassis |
|||
# Got any sensors you don't care about? Add them here. |
|||
#exclude_sensor_ids: |
|||
#- 2 |
|||
#- 29 |
|||
#- 32 |
|||
#- 50 |
|||
#- 52 |
|||
#- 55 |
|||
@ -0,0 +1,49 @@ |
|||
Name: ipmi_exporter |
|||
Version: 1.3.2 |
|||
Release: itix1 |
|||
Summary: Remote IPMI exporter for Prometheus |
|||
License: MIT |
|||
Source0: https://github.com/soundcloud/%{name}/releases/download/v%{version}/%{name}-v%{version}.linux-amd64.tar.gz |
|||
Source1: %{name}.service |
|||
Source2: %{name}.yaml |
|||
Source3: %{name}.env |
|||
ExclusiveArch: x86_64 |
|||
Requires(pre): shadow-utils |
|||
BuildRequires: systemd |
|||
Requires: freeipmi |
|||
|
|||
%description |
|||
|
|||
This is an IPMI exporter for Prometheus. The exporter relies on tools from the |
|||
FreeIPMI suite for the actual IPMI implementation. |
|||
|
|||
# Since we don't recompile from source, disable the build_id checking |
|||
%global _missing_build_ids_terminate_build 0 |
|||
%global _build_id_links none |
|||
%global debug_package %{nil} |
|||
|
|||
%prep |
|||
%setup -q -n %{name}-v%{version}.linux-amd64 |
|||
cp %{S:1} %{name}.service |
|||
cp %{S:2} %{name}.yaml |
|||
cp %{S:3} %{name}.env |
|||
|
|||
%build |
|||
|
|||
%install |
|||
install -D ipmi_exporter %{buildroot}/opt/%{name}/bin/ipmi_exporter |
|||
install -D -m 0600 %{name}.yaml %{buildroot}/opt/%{name}/etc/%{name}.yaml |
|||
install -D -m 0644 %{name}.env %{buildroot}/opt/%{name}/etc/%{name}.env |
|||
install -D -m 0644 %{name}.service %{buildroot}/%{_unitdir}/%{name}.service |
|||
|
|||
%files |
|||
%defattr(0644, root, root, 0755) |
|||
%license LICENSE |
|||
%dir /opt/%{name}/bin/ |
|||
%dir /opt/%{name}/etc/ |
|||
%attr(0755, root, root) /opt/%{name}/bin/%{name} |
|||
%attr(0600, root, root) %config /opt/%{name}/etc/%{name}.yaml |
|||
%config /opt/%{name}/etc/%{name}.env |
|||
%{_unitdir}/%{name}.service |
|||
|
|||
%changelog |
|||
Loading…
Reference in new issue