> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/v1.4.0/cli/commandreference/hardwaresensor.md).

# Hardware Sensor

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/02/12    |

## Table of Contents

* [1. Overview](#overview)
* [2. IPMI-Based Sensors](#ipmi-based-sensors)
* [3. Redfish-Based Sensors](#redfish-based-sensors)
* [4. Quick Summary](#quick-summary)
* [5. Usage Examples](#usage-examples)

***

## 1. Overview <a href="#overview" id="overview"></a>

The `hwsensor` command collects hardware sensor data from target nodes — including temperature, power consumption, and fan status. Supports both IPMI-based and Redfish-based data collection with periodic monitoring capabilities.

```bash
aidc-cli hwsensor <subcommand> [flags]
```

***

## 2. IPMI-Based Sensors <a href="#ipmi-based-sensors" id="ipmi-based-sensors"></a>

{% hint style="info" %}
Reports generated by `aidc-cli hwsensor` commands are stored in the `report/hardware` directory, located in the same directory as the Vagrantfile on the host machine.
{% endhint %}

### 2.1 `temperature` — Temperature Monitoring (IPMI)

Collects temperature sensor readings via IPMI.

```bash
aidc-cli hwsensor temperature --interval <minutes> [-b]
```

| Flag           | Short | Required | Description                               |
| -------------- | :---: | :------: | ----------------------------------------- |
| `--interval`   |   —   |     ✅    | Collection interval in minutes            |
| `--background` |  `-b` |     ❌    | Run in background (persists after logout) |

***

### 2.2 `power` — Power Monitoring (IPMI)

Collects power consumption readings via IPMI.

```bash
aidc-cli hwsensor power --interval <minutes> [-b]
```

| Flag           | Short | Required | Description                               |
| -------------- | :---: | :------: | ----------------------------------------- |
| `--interval`   |   —   |     ✅    | Collection interval in minutes            |
| `--background` |  `-b` |     ❌    | Run in background (persists after logout) |

***

## 3. Redfish-Based Sensors <a href="#redfish-based-sensors" id="redfish-based-sensors"></a>

All Redfish sensors require both `--interval` and `--times` flags to define the monitoring window.

### 3.1 `temperature-redfish`

```bash
aidc-cli hwsensor temperature-redfish --interval <seconds> --times <count> [-b]
```

### 3.2 `power-redfish`

```bash
aidc-cli hwsensor power-redfish --interval <seconds> --times <count> [-b]
```

### 3.3 `fan-redfish`

```bash
aidc-cli hwsensor fan-redfish --interval <seconds> --times <count> [-b]
```

### 3.4 `all-redfish`

Collects all sensor data (temperature, power, fan) via Redfish.

```bash
aidc-cli hwsensor all-redfish --interval <seconds> --times <count> [-b]
```

| Flag           | Short | Required | Description                               |
| -------------- | :---: | :------: | ----------------------------------------- |
| `--interval`   |   —   |     ✅    | Collection interval in seconds            |
| `--times`      |   —   |     ✅    | Number of collection iterations           |
| `--background` |  `-b` |     ❌    | Run in background (persists after logout) |

***

## 4. Quick Summary <a href="#quick-summary" id="quick-summary"></a>

| Subcommand            | Protocol | Flags Required          | Background |
| --------------------- | :------: | ----------------------- | :--------: |
| `temperature`         |   IPMI   | `--interval`            |      ✅     |
| `power`               |   IPMI   | `--interval`            |      ✅     |
| `temperature-redfish` |  Redfish | `--interval`, `--times` |      ✅     |
| `power-redfish`       |  Redfish | `--interval`, `--times` |      ✅     |
| `fan-redfish`         |  Redfish | `--interval`, `--times` |      ✅     |
| `all-redfish`         |  Redfish | `--interval`, `--times` |      ✅     |

***

## 5. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Monitor temperature every 5 minutes (foreground)
aidc-cli hwsensor temperature --interval 5

# Monitor power in background
aidc-cli hwsensor power --interval 10 -b

# Redfish all-sensor monitoring: every 2 seconds, 30 iterations, in background
aidc-cli hwsensor all-redfish --interval 2 --times 30 -b

# Monitor specific nodes only
aidc-cli hwsensor temperature --interval 5 -l node01,node02
```

{% hint style="info" %}
Background mode (`-b`) ensures monitoring continues even after you disconnect from the SSH session.
{% endhint %}
