Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Main (unreleased)

- Add `file_match` block to `loki.source.file` for built-in file discovery using glob patterns. (@kalleep)

- Add `prometheus.exporter.ipmi` component to collect hardware metrics from IPMI-enabled devices. Supports both local IPMI collection and remote IPMI monitoring with authentication. (@parsa97)

### Enhancements

- Add support of `tls` in components `loki.source.(awsfirehose|gcplog|heroku|api)` and `prometheus.receive_http` and `pyroscope.receive_http`. (@fgouteroux)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,363 @@
---
canonical: https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.ipmi/
aliases:
- ../prometheus.exporter.ipmi/ # /docs/alloy/latest/reference/components/prometheus.exporter.ipmi/
description: Learn about prometheus.exporter.ipmi
Comment on lines +3 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aliases:
- ../prometheus.exporter.ipmi/ # /docs/alloy/latest/reference/components/prometheus.exporter.ipmi/
description: Learn about prometheus.exporter.ipmi
description: Learn about prometheus.exporter.ipmi

We can drop this alias. The topic is new. Aliases are required if we change the filename or move the fire to a different location.

labels:
stage: general-availability
products:
- oss
title: prometheus.exporter.ipmi
Comment on lines +8 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
products:
- oss
title: prometheus.exporter.ipmi
products:
- oss
tags:
- text: Community
tooltip: This component is developed, maintained, and supported by the Alloy user community.
title: prometheus.exporter.ipmi

We should add the community badge since this appears to be a community contribution to Alloy.

---

# `prometheus.exporter.ipmi`

The `prometheus.exporter.ipmi` component collects hardware metrics from IPMI-enabled devices.
Comment on lines +13 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# `prometheus.exporter.ipmi`
The `prometheus.exporter.ipmi` component collects hardware metrics from IPMI-enabled devices.
# `prometheus.exporter.ipmi`
{{< docs/shared lookup="stability/community.md" source="alloy" version="<ALLOY_VERSION>" >}}
The `prometheus.exporter.ipmi` component collects hardware metrics from IPMI-enabled devices.

It supports both local IPMI collection (from the machine running Alloy) and remote IPMI collection from network-accessible devices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It supports both local IPMI collection (from the machine running Alloy) and remote IPMI collection from network-accessible devices.
It supports both local IPMI collection from the machine running {{< param "PRODUCT_NAME" >}}, and remote IPMI collection from network-accessible devices.


## Usage

```alloy
prometheus.exporter.ipmi "<LABEL>" {
target {
name = "<NAME>"
address = "<IPMI_ADDRESS>"
user = "<USERNAME>"
password = "<PASSWORD>"
}
}
```

## Arguments

You can use the following arguments with `prometheus.exporter.ipmi`:

| Name | Type | Description | Default | Required |
| ------------- | ---------- | ----------------------------------------------------- | ------- | -------- |
| `timeout` | `duration` | Timeout for IPMI requests. | `"30s"` | no |
| `config_file` | `string` | Path to IPMI exporter configuration file. | | no |
| `ipmi_config` | `string` | IPMI exporter configuration as inline YAML string. | | no |

The `timeout` should be set high enough to allow IPMI sensor collection to complete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `timeout` should be set high enough to allow IPMI sensor collection to complete.
Set the `timeout` high enough to allow IPMI sensor collection to complete.

IPMI operations can be slow, especially for devices with many sensors.
A timeout of 30 seconds or more is recommended for most hardware.

The `config_file` and `ipmi_config` arguments are mutually exclusive.
They allow advanced configuration of IPMI collection modules and command overrides.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
They allow advanced configuration of IPMI collection modules and command overrides.
These arguments enable advanced configuration of IPMI collection modules and command overrides.


## Blocks

You can use the following blocks with `prometheus.exporter.ipmi`:

| Name | Description | Required |
| ---------------- | ------------------------------------ | -------- |
| [`target`][target] | Configures a remote IPMI target. | no |
| [`local`][local] | Configures local IPMI collection. | no |

At least one `target` block or the `local` block must be configured.

[target]: #target
[local]: #local

### `target`

| Name | Type | Description | Default | Required |
| ----------- | -------- | --------------------------------------------- | ----------- | -------- |
| `name` | `string` | Name of the target (used in job label). | | yes |
| `address` | `string` | IP address or hostname of the IPMI device. | | yes |
| `user` | `string` | IPMI username for authentication. | | no |
| `password` | `secret` | IPMI password for authentication. | | no |
| `driver` | `string` | IPMI driver to use (`LAN_2_0` or `LAN`). | `"LAN_2_0"` | no |
| `privilege` | `string` | IPMI privilege level (`user` or `admin`). | `"admin"` | no |
| `module` | `string` | IPMI collector module to use. | | no |
Comment on lines +64 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Name | Type | Description | Default | Required |
| ----------- | -------- | --------------------------------------------- | ----------- | -------- |
| `name` | `string` | Name of the target (used in job label). | | yes |
| `address` | `string` | IP address or hostname of the IPMI device. | | yes |
| `user` | `string` | IPMI username for authentication. | | no |
| `password` | `secret` | IPMI password for authentication. | | no |
| `driver` | `string` | IPMI driver to use (`LAN_2_0` or `LAN`). | `"LAN_2_0"` | no |
| `privilege` | `string` | IPMI privilege level (`user` or `admin`). | `"admin"` | no |
| `module` | `string` | IPMI collector module to use. | | no |
| Name | Type | Description | Default | Required |
| ----------- | -------- | ------------------------------------------ | ----------- | -------- |
| `address` | `string` | IP address or hostname of the IPMI device. | | yes |
| `name` | `string` | Name of the target used in job label. | | yes |
| `driver` | `string` | IPMI driver to use, `LAN_2_0` or `LAN`. | `"LAN_2_0"` | no |
| `module` | `string` | IPMI collector module to use. | | no |
| `password` | `secret` | IPMI password for authentication. | | no |
| `privilege` | `string` | IPMI privilege level, `user` or `admin`. | `"admin"` | no |
| `user` | `string` | IPMI username for authentication. | | no |

Alpha sort rows, required first, remove brackets, pretty print table.


The `target` block defines a remote IPMI device to monitor.
Multiple `target` blocks can be specified to monitor multiple devices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Multiple `target` blocks can be specified to monitor multiple devices.
You can specify multiple `target` blocks to monitor multiple devices.


The `driver` attribute specifies which IPMI protocol version to use:
- `LAN_2_0`: IPMI 2.0 protocol (recommended for most modern hardware)
- `LAN`: IPMI 1.5 protocol (for older hardware)
Comment on lines +77 to +79
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `driver` attribute specifies which IPMI protocol version to use:
- `LAN_2_0`: IPMI 2.0 protocol (recommended for most modern hardware)
- `LAN`: IPMI 1.5 protocol (for older hardware)
The `driver` attribute specifies which IPMI protocol version to use:
- `LAN_2_0`: IPMI 2.0 protocol, recommended for most modern hardware
- `LAN`: IPMI 1.5 protocol, for legacy hardware


The `privilege` attribute sets the privilege level for IPMI operations:
- `admin`: Full administrative access (required for all sensor data on most hardware)
- `user`: User-level access (limited sensor access)
Comment on lines +81 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `privilege` attribute sets the privilege level for IPMI operations:
- `admin`: Full administrative access (required for all sensor data on most hardware)
- `user`: User-level access (limited sensor access)
The `privilege` attribute sets the privilege level for IPMI operations:
- `admin`: Full administrative access, required for all sensor data on most hardware
- `user`: User-level access, limited sensor access


### `local`

| Name | Type | Description | Default | Required |
| --------- | -------- | ---------------------------------------- | ------- | -------- |
| `enabled` | `bool` | Enable local IPMI collection. | `false` | no |
| `module` | `string` | IPMI collector module to use. | | no |

The `local` block enables collection from the local machine's IPMI interface.
This requires the machine to have IPMI hardware and appropriate permissions.
On Linux systems, this typically requires:
- FreeIPMI tools installed
- Kernel modules loaded (`ipmi_devintf`, `ipmi_si`)
- Appropriate device permissions (`/dev/ipmi0`)
Comment on lines +94 to +97
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
On Linux systems, this typically requires:
- FreeIPMI tools installed
- Kernel modules loaded (`ipmi_devintf`, `ipmi_si`)
- Appropriate device permissions (`/dev/ipmi0`)
On Linux systems, this typically requires:
- FreeIPMI tools installed
- Kernel modules for `ipmi_devintf` and `ipmi_si` loaded
- Appropriate device permissions for `/dev/ipmi0`


## Exported fields

{{< docs/shared lookup="reference/components/exporter-component-exports.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Component health

`prometheus.exporter.ipmi` is only reported as unhealthy if given an invalid configuration.
In those cases, exported fields retain their last healthy values.

IPMI connection failures or timeouts don't affect component health.
Instead, the `ipmi_up` metric is set to 0 for unreachable targets.

## Debug information

`prometheus.exporter.ipmi` doesn't expose any component-specific debug information.

## Debug metrics

`prometheus.exporter.ipmi` doesn't expose any component-specific debug metrics.

## Collected metrics

The IPMI exporter collects the following metrics:

| Metric | Type | Description |
| --------------------------- | ----- | ----------------------------------------------------------------- |
| `ipmi_up` | Gauge | IPMI device reachability (1=up, 0=down) |
| `ipmi_temperature_celsius` | Gauge | Temperature sensor reading in degrees Celsius |
| `ipmi_fan_speed_rpm` | Gauge | Fan speed sensor reading in RPM |
| `ipmi_voltage_volts` | Gauge | Voltage sensor reading in volts |
| `ipmi_power_watts` | Gauge | Power sensor reading in watts |
| `ipmi_current_amperes` | Gauge | Current sensor reading in amperes |
| `ipmi_sensor_state` | Gauge | Sensor state (0=nominal, 1=warning, 2=critical, 3=not available) |
| `ipmi_collector_info` | Gauge | Information about the IPMI collector configuration |
Comment on lines +123 to +132
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Metric | Type | Description |
| --------------------------- | ----- | ----------------------------------------------------------------- |
| `ipmi_up` | Gauge | IPMI device reachability (1=up, 0=down) |
| `ipmi_temperature_celsius` | Gauge | Temperature sensor reading in degrees Celsius |
| `ipmi_fan_speed_rpm` | Gauge | Fan speed sensor reading in RPM |
| `ipmi_voltage_volts` | Gauge | Voltage sensor reading in volts |
| `ipmi_power_watts` | Gauge | Power sensor reading in watts |
| `ipmi_current_amperes` | Gauge | Current sensor reading in amperes |
| `ipmi_sensor_state` | Gauge | Sensor state (0=nominal, 1=warning, 2=critical, 3=not available) |
| `ipmi_collector_info` | Gauge | Information about the IPMI collector configuration |
| Metric | Type | Description |
| -------------------------- | ----- | ---------------------------------------------------------------------- |
| `ipmi_collector_info` | Gauge | Information about the IPMI collector configuration |
| `ipmi_current_amperes` | Gauge | Current sensor reading in amperes |
| `ipmi_fan_speed_rpm` | Gauge | Fan speed sensor reading in RPM |
| `ipmi_power_watts` | Gauge | Power sensor reading in watts |
| `ipmi_sensor_state` | Gauge | Sensor state `0`=nominal, `1`=warning, `2`=critical, `3`=not available |
| `ipmi_temperature_celsius` | Gauge | Temperature sensor reading in degrees Celsius |
| `ipmi_up` | Gauge | IPMI device reachability, `1`=up and `0`=down |
| `ipmi_voltage_volts` | Gauge | Voltage sensor reading in volts |

Alpha sort, remove brackets, pretty print


All sensor metrics include labels:
- `target`: IP address or "localhost" for local collection
Comment on lines +134 to +135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All sensor metrics include labels:
- `target`: IP address or "localhost" for local collection
All sensor metrics include labels:
- `target`: IP address or "localhost" for local collection

- `sensor`: Sensor name from IPMI hardware
- `id`: Sensor ID number

## Examples

### Monitor remote IPMI devices

This example monitors two remote servers via IPMI and forwards metrics to Prometheus:

```alloy
prometheus.exporter.ipmi "servers" {
target {
name = "server-01"
address = "192.168.1.10"
user = "monitoring"
password = env("IPMI_PASSWORD")
driver = "LAN_2_0"
privilege = "admin"
}

target {
name = "server-02"
address = "192.168.1.11"
user = "monitoring"
password = env("IPMI_PASSWORD")
driver = "LAN_2_0"
privilege = "admin"
}

timeout = "30s"
}

prometheus.scrape "ipmi" {
targets = prometheus.exporter.ipmi.servers.targets
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "60s"
scrape_timeout = "45s"
}

prometheus.remote_write "default" {
endpoint {
url = "http://prometheus:9090/api/v1/write"
}
}
```

### Monitor local IPMI device

This example monitors the local server's IPMI interface:

```alloy
prometheus.exporter.ipmi "local_server" {
local {
enabled = true
module = "default"
}
}

prometheus.scrape "ipmi_local" {
targets = prometheus.exporter.ipmi.local_server.targets
forward_to = [prometheus.remote_write.default.receiver]
}

prometheus.remote_write "default" {
endpoint {
url = "http://prometheus:9090/api/v1/write"
}
}
```

### Monitor both local and remote devices

This example combines local and remote IPMI monitoring:

```alloy
prometheus.exporter.ipmi "infrastructure" {
// Monitor local machine
local {
enabled = true
}

// Monitor remote servers
target {
name = "compute-01"
address = "10.0.1.10"
user = "admin"
password = env("IPMI_PASSWORD")
}

target {
name = "compute-02"
address = "10.0.1.11"
user = "admin"
password = env("IPMI_PASSWORD")
}

timeout = "30s"
}

prometheus.scrape "all_ipmi" {
targets = prometheus.exporter.ipmi.infrastructure.targets
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "60s"
scrape_timeout = "45s"
}

prometheus.remote_write "default" {
endpoint {
url = env("PROMETHEUS_URL")
}
}
```

### Access metrics directly without scraping

For testing or debugging, you can access IPMI metrics directly via HTTP:

```alloy
prometheus.exporter.ipmi "test" {
target {
name = "test-server"
address = "192.168.1.100"
user = "monitoring"
password = env("IPMI_PASSWORD")
}
}
```

Metrics are available at:
```
http://localhost:12345/api/v0/component/prometheus.exporter.ipmi.test/metrics
```
Comment on lines +264 to +267
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Metrics are available at:
```
http://localhost:12345/api/v0/component/prometheus.exporter.ipmi.test/metrics
```
Metrics are available at `http://localhost:12345/api/v0/component/prometheus.exporter.ipmi.test/metrics`

I don't see a reason to put the URL in code fence formatting... we can just use inline code.


## Technical notes

### IPMI timeout configuration

IPMI sensor collection can be slow, especially for servers with many sensors.
Configure timeouts appropriately:

- **Component timeout**: Set to 30-60 seconds to allow sensor collection to complete
- **Scrape timeout**: Must be longer than the component timeout
- **Scrape interval**: Recommended 60 seconds or more to avoid overlapping collections

Example configuration:
```alloy
Comment on lines +280 to +281
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Example configuration:
```alloy
Example configuration:
```alloy

prometheus.exporter.ipmi "servers" {
timeout = "30s" // Allow 30 seconds for IPMI operations
// ... targets ...
}

prometheus.scrape "ipmi" {
scrape_interval = "60s" // Scrape every minute
scrape_timeout = "45s" // Allow 45 seconds (> component timeout)
targets = prometheus.exporter.ipmi.servers.targets
// ... forward_to ...
}
```

### IPMI driver selection

Choose the appropriate IPMI driver based on your hardware:

- **LAN_2_0** (IPMI 2.0): Recommended for modern servers (Dell, HP, Supermicro from ~2010+)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **LAN_2_0** (IPMI 2.0): Recommended for modern servers (Dell, HP, Supermicro from ~2010+)
- **LAN_2_0** (IPMI 2.0): Recommended for modern servers such as Dell, HP, and Supermicro, from approximately onward

I left the brackets in-place here

- **LAN** (IPMI 1.5): For older hardware that doesn't support IPMI 2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **LAN** (IPMI 1.5): For older hardware that doesn't support IPMI 2.0
- **LAN** (IPMI 1.5): For legacy hardware that doesn't support IPMI 2.0


If unsure, try `LAN_2_0` first. Connection failures may indicate the need to use `LAN`.

### Local IPMI requirements

For local IPMI collection, ensure:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For local IPMI collection, ensure:
For local IPMI collection, ensure the following minimum requirements are met:


1. **Hardware support**: Server has BMC/IPMI hardware
2. **Kernel modules** (Linux):
```bash
modprobe ipmi_devintf
modprobe ipmi_si
```
3. **Device permissions**:
```bash
ls -l /dev/ipmi* /dev/ipmi0
# Should be accessible by the user running Alloy
```
4. **FreeIPMI tools** (optional but recommended):
```bash
# Debian/Ubuntu
apt-get install freeipmi-tools

# RHEL/CentOS
yum install freeipmi
```
Comment on lines +308 to +326
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **Hardware support**: Server has BMC/IPMI hardware
2. **Kernel modules** (Linux):
```bash
modprobe ipmi_devintf
modprobe ipmi_si
```
3. **Device permissions**:
```bash
ls -l /dev/ipmi* /dev/ipmi0
# Should be accessible by the user running Alloy
```
4. **FreeIPMI tools** (optional but recommended):
```bash
# Debian/Ubuntu
apt-get install freeipmi-tools
# RHEL/CentOS
yum install freeipmi
```
- **Hardware support**: Server has BMC/IPMI hardware
- **Kernel modules**: `ipmi_devintf` and `ipmi_si`
- **Device permissions**: `/dev/ipmi0` is accessible by the user running {{< param "PRODUCT_NAME" >}}.
- **FreeIPMI tools**: Optional but recommended.

Removed Linux from second point. Simplified the steps to bullet points and a list of things vs giving Linux commands to load kernel modules etc. We should only provide the OS-specific steps when they directly relate to Alloy, or if they are specific/custom in some way that is outside the typical use, or if we are building a tutorial.

Question: What about MacOS and Windows? Are there pre-reqs for other OSes? or is this a Linux-only thing?


### Security considerations

IPMI credentials provide low-level hardware access:

- **Use dedicated monitoring users** with minimal required privileges
- **Store passwords securely** using `env()` or secrets management
- **Never commit passwords** to version control
- **Consider network isolation** for IPMI interfaces (dedicated management network)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Consider network isolation** for IPMI interfaces (dedicated management network)
- **Consider network isolation** for IPMI interfaces on dedicated management networks

- **Use IPMI 2.0** (`LAN_2_0`) when possible for better security

Example with environment variables:
```alloy
Comment on lines +338 to +339
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Example with environment variables:
```alloy
Example with environment variables:
```alloy

prometheus.exporter.ipmi "secure" {
target {
name = "production-server"
address = env("IPMI_HOST")
user = env("IPMI_USER")
password = env("IPMI_PASSWORD")
}
}
```

<!-- START GENERATED COMPATIBLE COMPONENTS -->

## Compatible components

`prometheus.exporter.ipmi` has exports that can be consumed by the following components:

- Components that consume [Targets](../../../compatibility/#targets-consumers)

{{< admonition type="note" >}}
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly.
Refer to the linked documentation for more details.
{{< /admonition >}}

<!-- END GENERATED COMPATIBLE COMPONENTS -->
Loading