2017-07-25 14:17:57 +00:00
|
|
|
Prometheus IPMI Exporter
|
|
|
|
========================
|
|
|
|
|
2021-09-21 10:18:34 +00:00
|
|
|
[![Build Status](https://circleci.com/gh/prometheus-community/ipmi_exporter.svg?style=svg)](https://circleci.com/gh/prometheus-community/ipmi_exporter)
|
2019-10-14 13:58:59 +00:00
|
|
|
|
2018-08-03 14:23:35 +00:00
|
|
|
This is an IPMI exporter for [Prometheus](https://prometheus.io).
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2018-08-03 14:23:35 +00:00
|
|
|
It supports both the regular `/metrics` endpoint, exposing metrics from the
|
|
|
|
host that the exporter is running on, as well as an `/ipmi` endpoint that
|
|
|
|
supports IPMI over RMCP - one exporter running on one host can be used to
|
|
|
|
monitor a large number of IPMI interfaces by passing the `target` parameter to
|
|
|
|
a scrape.
|
|
|
|
|
|
|
|
The exporter relies on tools from the
|
|
|
|
[FreeIPMI](https://www.gnu.org/software/freeipmi/) suite for the actual IPMI
|
|
|
|
implementation.
|
2017-07-25 14:17:57 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
For most use-cases, simply download the [the latest
|
2021-09-21 10:18:34 +00:00
|
|
|
release](https://github.com/prometheus-community/ipmi_exporter/releases).
|
2019-10-18 11:52:05 +00:00
|
|
|
|
|
|
|
### Building from source
|
|
|
|
|
|
|
|
You need a Go development environment. Then, simply run `make` to build the
|
|
|
|
executable:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
|
|
|
This uses the common prometheus tooling to build and run some tests.
|
|
|
|
|
|
|
|
Alternatively, you can use the standard Go tooling, which will install the
|
|
|
|
executable in `$GOPATH/bin`:
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2021-09-21 10:18:34 +00:00
|
|
|
go get github.com/prometheus-community/ipmi_exporter
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
### Building a Docker container
|
|
|
|
|
|
|
|
You can build a Docker container with the included `docker` make target:
|
|
|
|
|
2022-02-21 20:47:02 +00:00
|
|
|
make promu
|
|
|
|
promu crossbuild -p linux/amd64 -p linux/arm64
|
2019-10-18 11:52:05 +00:00
|
|
|
make docker
|
|
|
|
|
|
|
|
This will not even require Go tooling on the host. See the included [docker
|
|
|
|
compose example](docker-compose.yml) for how to use the resulting container.
|
|
|
|
|
2022-12-02 13:19:17 +00:00
|
|
|
### Building a RPM Package
|
2022-11-24 10:21:42 +00:00
|
|
|
|
2022-12-02 13:19:17 +00:00
|
|
|
See [how to build a RPM package](contrib/rpm/README.md).
|
2022-11-24 10:21:42 +00:00
|
|
|
|
2017-07-25 14:17:57 +00:00
|
|
|
## Running
|
|
|
|
|
|
|
|
A minimal invocation looks like this:
|
|
|
|
|
|
|
|
./ipmi_exporter
|
|
|
|
|
|
|
|
Supported parameters include:
|
|
|
|
|
|
|
|
- `web.listen-address`: the address/port to listen on (default: `":9290"`)
|
2018-09-21 19:50:30 +00:00
|
|
|
- `config.file`: path to the configuration file (default: none)
|
2019-02-20 19:11:49 +00:00
|
|
|
- `freeipmi.path`: path to the FreeIPMI executables (default: rely on `$PATH`)
|
|
|
|
|
2018-09-21 19:50:30 +00:00
|
|
|
For syntax and a complete list of available parameters, run:
|
2019-02-20 19:11:49 +00:00
|
|
|
|
|
|
|
./ipmi_exporter -h
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2018-07-30 10:32:54 +00:00
|
|
|
Make sure you have the following tools from the
|
|
|
|
[FreeIPMI](https://www.gnu.org/software/freeipmi/) suite installed:
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2018-09-21 19:50:30 +00:00
|
|
|
- `ipmimonitoring`/`ipmi-sensors`
|
2017-07-25 14:17:57 +00:00
|
|
|
- `ipmi-dcmi`
|
2020-07-26 15:16:30 +00:00
|
|
|
- `ipmi-raw`
|
2017-07-25 14:17:57 +00:00
|
|
|
- `bmc-info`
|
2020-04-22 20:21:25 +00:00
|
|
|
- `ipmi-sel`
|
2020-07-26 15:16:30 +00:00
|
|
|
- `ipmi-chassis`
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
### Running as unprivileged user
|
|
|
|
|
|
|
|
If you are running the exporter as unprivileged user, but need to execute the
|
|
|
|
FreeIPMI tools as root, you can do the following:
|
|
|
|
|
|
|
|
1. Add sudoers files to permit the following commands
|
2020-04-22 20:21:25 +00:00
|
|
|
```
|
|
|
|
ipmi-exporter ALL = NOPASSWD: /usr/sbin/ipmimonitoring,\
|
|
|
|
/usr/sbin/ipmi-sensors,\
|
|
|
|
/usr/sbin/ipmi-dcmi,\
|
2020-07-26 15:16:30 +00:00
|
|
|
/usr/sbin/ipmi-raw,\
|
2020-04-22 20:21:25 +00:00
|
|
|
/usr/sbin/bmc-info,\
|
|
|
|
/usr/sbin/ipmi-chassis,\
|
|
|
|
/usr/sbin/ipmi-sel
|
2019-10-18 11:52:05 +00:00
|
|
|
```
|
2021-05-19 21:27:29 +00:00
|
|
|
2. In your module config, override the collector command with `sudo` for
|
|
|
|
every collector you are using and add the actual command as custom
|
|
|
|
argument. Example for the "ipmi" collector:
|
|
|
|
```yaml
|
|
|
|
collector_cmd:
|
|
|
|
ipmi: sudo
|
|
|
|
custom_args:
|
|
|
|
ipmi:
|
|
|
|
- "ipmimonitoring"
|
2019-10-18 11:52:05 +00:00
|
|
|
```
|
2021-05-19 21:27:29 +00:00
|
|
|
See the last module in the [example config](ipmi_remote.yml).
|
2019-10-06 09:35:19 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
### Running in Docker
|
2019-10-11 19:38:21 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
**NOTE:** you should only use Docker for remote metrics.
|
2019-10-11 19:38:21 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
See [Building a Docker container](#building-a-docker-container) and the example
|
|
|
|
`docker-compose.yml`. Edit the `ipmi_remote.yml` file to configure IPMI
|
|
|
|
credentials, then run with:
|
2019-10-11 19:38:21 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
sudo docker-compose up -d
|
2019-10-11 19:38:21 +00:00
|
|
|
|
2019-10-18 11:52:05 +00:00
|
|
|
By default, the server will bind on `0.0.0.0:9290`.
|
2019-10-11 19:38:21 +00:00
|
|
|
|
2017-07-25 14:17:57 +00:00
|
|
|
## Configuration
|
|
|
|
|
2021-05-19 21:27:29 +00:00
|
|
|
The [configuration](docs/configuration.md) document describes both the
|
|
|
|
configuration of the IPMI exporter itself as well as providing some guidance
|
|
|
|
for configuring the Prometheus server to scrape it.
|
2017-07-25 14:17:57 +00:00
|
|
|
|
2022-02-22 13:55:27 +00:00
|
|
|
## TLS and basic authentication
|
|
|
|
|
|
|
|
The IPMI Exporter supports TLS and basic authentication.
|
|
|
|
|
|
|
|
To use TLS and/or basic authentication, you need to pass a configuration file
|
|
|
|
using the `--web.config.file` parameter. The format of the file is described
|
|
|
|
[in the exporter-toolkit repository](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).
|
|
|
|
|
2017-07-25 14:17:57 +00:00
|
|
|
## Exported data
|
|
|
|
|
2021-05-19 21:27:29 +00:00
|
|
|
For a description of the metrics that this exporter provides, see the
|
|
|
|
[metrics](docs/metrics.md) document.
|