2017-10-13 20:53:18 +00:00
|
|
|
# IPMI Sensor Input Plugin
|
2016-03-23 15:40:38 +00:00
|
|
|
|
2017-10-13 20:53:18 +00:00
|
|
|
Get bare metal metrics using the command line utility
|
|
|
|
[`ipmitool`](https://sourceforge.net/projects/ipmitool/files/ipmitool/).
|
2016-03-23 15:40:38 +00:00
|
|
|
|
2017-01-09 10:45:31 +00:00
|
|
|
If no servers are specified, the plugin will query the local machine sensor stats via the following command:
|
2016-03-23 15:40:38 +00:00
|
|
|
|
2017-01-09 10:45:31 +00:00
|
|
|
```
|
|
|
|
ipmitool sdr
|
|
|
|
```
|
2018-07-31 23:56:03 +00:00
|
|
|
or with the version 2 schema:
|
|
|
|
```
|
|
|
|
ipmitool sdr elist
|
|
|
|
```
|
2017-01-09 10:45:31 +00:00
|
|
|
|
|
|
|
When one or more servers are specified, the plugin will use the following command to collect remote host sensor stats:
|
|
|
|
|
|
|
|
```
|
|
|
|
ipmitool -I lan -H SERVER -U USERID -P PASSW0RD sdr
|
|
|
|
```
|
2016-03-23 15:40:38 +00:00
|
|
|
|
2017-10-13 20:53:18 +00:00
|
|
|
### Configuration
|
2016-03-23 15:40:38 +00:00
|
|
|
|
|
|
|
```toml
|
2017-01-09 10:45:31 +00:00
|
|
|
# Read metrics from the bare metal servers via IPMI
|
2016-04-10 02:24:04 +00:00
|
|
|
[[inputs.ipmi_sensor]]
|
2017-01-09 10:45:31 +00:00
|
|
|
## optionally specify the path to the ipmitool executable
|
|
|
|
# path = "/usr/bin/ipmitool"
|
2018-01-05 23:59:25 +00:00
|
|
|
##
|
2019-12-12 21:56:28 +00:00
|
|
|
## Setting 'use_sudo' to true will make use of sudo to run ipmitool.
|
|
|
|
## Sudo must be configured to allow the telegraf user to run ipmitool
|
|
|
|
## without a password.
|
|
|
|
# use_sudo = false
|
|
|
|
##
|
2018-01-05 23:59:25 +00:00
|
|
|
## optionally force session privilege level. Can be CALLBACK, USER, OPERATOR, ADMINISTRATOR
|
|
|
|
# privilege = "ADMINISTRATOR"
|
|
|
|
##
|
2017-01-09 10:45:31 +00:00
|
|
|
## optionally specify one or more servers via a url matching
|
2016-03-23 15:40:38 +00:00
|
|
|
## [username[:password]@][protocol[(address)]]
|
|
|
|
## e.g.
|
|
|
|
## root:passwd@lan(127.0.0.1)
|
|
|
|
##
|
2017-01-09 10:45:31 +00:00
|
|
|
## if no servers are specified, local machine sensor stats will be queried
|
|
|
|
##
|
|
|
|
# servers = ["USERID:PASSW0RD@lan(192.168.1.1)"]
|
2017-05-22 20:41:34 +00:00
|
|
|
|
2020-05-14 07:41:58 +00:00
|
|
|
## Recommended: use metric 'interval' that is a multiple of 'timeout' to avoid
|
2017-05-22 20:41:34 +00:00
|
|
|
## gaps or overlap in pulled data
|
|
|
|
interval = "30s"
|
|
|
|
|
|
|
|
## Timeout for the ipmitool command to complete. Default is 20 seconds.
|
|
|
|
timeout = "20s"
|
2018-07-31 23:56:03 +00:00
|
|
|
|
|
|
|
## Schema Version: (Optional, defaults to version 1)
|
|
|
|
metric_version = 2
|
2016-03-23 15:40:38 +00:00
|
|
|
```
|
|
|
|
|
2017-10-13 20:53:18 +00:00
|
|
|
### Measurements
|
|
|
|
|
2018-07-31 23:56:03 +00:00
|
|
|
Version 1 schema:
|
2017-10-13 20:53:18 +00:00
|
|
|
- ipmi_sensor:
|
|
|
|
- tags:
|
|
|
|
- name
|
|
|
|
- unit
|
2018-07-31 23:56:03 +00:00
|
|
|
- host
|
2017-10-13 20:53:18 +00:00
|
|
|
- server (only when retrieving stats from remote servers)
|
|
|
|
- fields:
|
2018-07-31 23:56:03 +00:00
|
|
|
- status (int, 1=ok status_code/0=anything else)
|
2017-10-13 20:53:18 +00:00
|
|
|
- value (float)
|
|
|
|
|
2018-07-31 23:56:03 +00:00
|
|
|
Version 2 schema:
|
|
|
|
- ipmi_sensor:
|
|
|
|
- tags:
|
|
|
|
- name
|
|
|
|
- entity_id (can help uniquify duplicate names)
|
|
|
|
- status_code (two letter code from IPMI documentation)
|
|
|
|
- status_desc (extended status description field)
|
|
|
|
- unit (only on analog values)
|
|
|
|
- host
|
|
|
|
- server (only when retrieving stats from remote)
|
|
|
|
- fields:
|
|
|
|
- value (float)
|
2017-10-13 20:53:18 +00:00
|
|
|
|
|
|
|
#### Permissions
|
|
|
|
|
|
|
|
When gathering from the local system, Telegraf will need permission to the
|
2017-10-16 18:10:06 +00:00
|
|
|
ipmi device node. When using udev you can create the device node giving
|
2017-10-13 20:53:18 +00:00
|
|
|
`rw` permissions to the `telegraf` user by adding the following rule to
|
|
|
|
`/etc/udev/rules.d/52-telegraf-ipmi.rules`:
|
|
|
|
|
|
|
|
```
|
|
|
|
KERNEL=="ipmi*", MODE="660", GROUP="telegraf"
|
|
|
|
```
|
2019-12-12 21:56:28 +00:00
|
|
|
Alternatively, it is possible to use sudo. You will need the following in your telegraf config:
|
|
|
|
```toml
|
|
|
|
[[inputs.ipmi_sensor]]
|
|
|
|
use_sudo = true
|
|
|
|
```
|
|
|
|
|
|
|
|
You will also need to update your sudoers file:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ visudo
|
|
|
|
# Add the following line:
|
|
|
|
Cmnd_Alias IPMITOOL = /usr/bin/ipmitool *
|
|
|
|
telegraf ALL=(root) NOPASSWD: IPMITOOL
|
|
|
|
Defaults!IPMITOOL !logfile, !syslog, !pam_session
|
|
|
|
```
|
2017-10-13 20:53:18 +00:00
|
|
|
|
|
|
|
### Example Output
|
2016-03-23 15:40:38 +00:00
|
|
|
|
2018-07-31 23:56:03 +00:00
|
|
|
#### Version 1 Schema
|
2017-01-09 10:45:31 +00:00
|
|
|
When retrieving stats from a remote server:
|
2016-03-23 15:40:38 +00:00
|
|
|
```
|
2018-07-31 23:56:03 +00:00
|
|
|
ipmi_sensor,server=10.20.2.203,name=uid_light value=0,status=1i 1517125513000000000
|
|
|
|
ipmi_sensor,server=10.20.2.203,name=sys._health_led status=1i,value=0 1517125513000000000
|
|
|
|
ipmi_sensor,server=10.20.2.203,name=power_supply_1,unit=watts status=1i,value=110 1517125513000000000
|
|
|
|
ipmi_sensor,server=10.20.2.203,name=power_supply_2,unit=watts status=1i,value=120 1517125513000000000
|
|
|
|
ipmi_sensor,server=10.20.2.203,name=power_supplies value=0,status=1i 1517125513000000000
|
|
|
|
ipmi_sensor,server=10.20.2.203,name=fan_1,unit=percent status=1i,value=43.12 1517125513000000000
|
2016-03-23 15:40:38 +00:00
|
|
|
```
|
2017-01-09 10:45:31 +00:00
|
|
|
|
2018-07-31 23:56:03 +00:00
|
|
|
|
|
|
|
When retrieving stats from the local machine (no server specified):
|
|
|
|
```
|
|
|
|
ipmi_sensor,name=uid_light value=0,status=1i 1517125513000000000
|
|
|
|
ipmi_sensor,name=sys._health_led status=1i,value=0 1517125513000000000
|
|
|
|
ipmi_sensor,name=power_supply_1,unit=watts status=1i,value=110 1517125513000000000
|
|
|
|
ipmi_sensor,name=power_supply_2,unit=watts status=1i,value=120 1517125513000000000
|
|
|
|
ipmi_sensor,name=power_supplies value=0,status=1i 1517125513000000000
|
|
|
|
ipmi_sensor,name=fan_1,unit=percent status=1i,value=43.12 1517125513000000000
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Version 2 Schema
|
|
|
|
|
2017-01-09 10:45:31 +00:00
|
|
|
When retrieving stats from the local machine (no server specified):
|
|
|
|
```
|
2018-07-31 23:56:03 +00:00
|
|
|
ipmi_sensor,name=uid_light,entity_id=23.1,status_code=ok,status_desc=ok value=0 1517125474000000000
|
|
|
|
ipmi_sensor,name=sys._health_led,entity_id=23.2,status_code=ok,status_desc=ok value=0 1517125474000000000
|
|
|
|
ipmi_sensor,entity_id=10.1,name=power_supply_1,status_code=ok,status_desc=presence_detected,unit=watts value=110 1517125474000000000
|
|
|
|
ipmi_sensor,name=power_supply_2,entity_id=10.2,status_code=ok,unit=watts,status_desc=presence_detected value=125 1517125474000000000
|
|
|
|
ipmi_sensor,name=power_supplies,entity_id=10.3,status_code=ok,status_desc=fully_redundant value=0 1517125474000000000
|
|
|
|
ipmi_sensor,entity_id=7.1,name=fan_1,status_code=ok,status_desc=transition_to_running,unit=percent value=43.12 1517125474000000000
|
2017-01-09 10:45:31 +00:00
|
|
|
```
|