This is a Prometheus Exporter for extracting metrics from a server using the Redfish API. The hostname of the server has to be passed as target parameter in the http call.
It has been tested with the following server models:
| Vendor | Model | Notes |
|---|---|---|
| Cisco | UCS C220M4 | |
| Cisco | UCS C220M5 | |
| Cisco | UCS C240M4 | |
| Cisco | UCS C240M5 | |
| Cisco | UCS C480M5 | Working properly since BMC FW 4.1(1d) |
| Dell | PowerEdge R640 | |
| Dell | PowerEdge R660 | |
| Dell | PowerEdge R730 | |
| Dell | PowerEdge R740 | |
| Dell | PowerEdge R740xd | |
| Dell | PowerEdge R760 | |
| Dell | PowerEdge R760xa | |
| Dell | PowerEdge R7615 | |
| Dell | PowerEdge R840 | |
| Dell | PowerEdge R860 | |
| Fujitsu | PRIMERGY RX2540 M8 | iRMC; Live chassis wattage is not exposed at standard Redfish paths. |
| HPE | Compute Scale-up Server 3200 | |
| HPE | ProLiant DL320 Gen11 | |
| HPE | ProLiant DL345 Gen11 | |
| HPE | ProLiant DL360 Gen10 | |
| HPE | ProLiant DL380 Gen11 | |
| HPE | ProLiant DL560 Gen10 | |
| HPE | ProLiant DL560 Gen11 | iLO 6 reports zero per-PSU live wattage; chassis aggregate is used instead |
| Lenovo | ThinkSystem SR650 | |
| Lenovo | ThinkSystem SR650 V3 | |
| Lenovo | ThinkSystem SR655 V3 | |
| Lenovo | ThinkSystem SR675 V3 | |
| Lenovo | ThinkSystem SR850 V3 | |
| Lenovo | ThinkSystem SR950 V3 |
Note: Cisco BMC FW below 4.x has known issues with the Redfish API. Updating to at least 4.0(1c) is recommended.
If you are logged into the POD running the exporter, you can retrieve metrics from a server, make an HTTP call to the exporter with the target and job parameters. The exporter supports the following endpoints:
Retrieves health-related metrics (e.g., system status, memory errors, power state).
curl "http://localhost:9220/health?target=server1.example.com&job=redfish-myjob"Retrieves firmware version information for the server components.
curl "http://localhost:9220/firmware?target=server1.example.com&job=redfish-myjob"Retrieves performance-related metrics (e.g., power consumption, temperature).
curl "http://localhost:9220/performance?target=server1.example.com&job=redfish-myjob"Retrieves sensor-related metrics (e.g. energy, voltage, current, temperature, ...).
curl "http://localhost:9220/sensors?target=server1.example.com&job=redfish-myjob"Retrieves BIOS settings as Prometheus metrics, including a flag indicating whether changes are pending a reboot. Each BIOS attribute is exported as its own metric (redfish_bios_<attribute>) — see the metrics reference for details.
curl "http://localhost:9220/bios?target=server1.example.com&job=redfish-myjob"Notes:
- Replace
server1.example.comwith the hostname or IP address of your Redfish server. - Replace
redfish-myjobwith the name of your job (used to map credentials). - The exporter listens on port 9220 by default.
The exporter was written for Python 3.6 or newer. To install all modules needed you have to run the following command:
pip3 install --no-cache-dir -r requirements.txtAlternatively, you can use the provided Dockerfile to build and run the exporter in a container.
To build the container, the following command can be used:
docker build -t your-path/redfish-exporter:v0.1.0 .This will have the default configuration stored in config.yml. It is recommended that if you need to change the configuration, you make a copy of the file and mount it to the container when it is executed. Once this is done, run the exporter in a Docker container using the following command:
docker run -d -p 9220:9220 -v ${PWD}/myconfig.yml:/redfish_exporter/config.yml your-path/redfish-exporter:v0.1.0-l <logfile> - all output is written to a logfile.
-d - switches on debugging mode
-c <config file> - you can specify the path to the config file, default is config.yml.
-
The listen_port is providing the port on which the exporter is waiting to receive calls. It is overwritten by the environment variable LISTEN_PORT.
-
The credentials for login to the switches can either be added to the config.yaml file or passed via environment variables. The environment variables are taking precedence over the entries in config.yaml file.
The mapping of job names to environment variables follows a schema:
REDFISH_JOB1_USERNAMEandREDFISH_JOB1_PASSWORDwould be the variables for example of the first job calledredfish/job1. A slash gets replaced by underscore and everything gets converted to uppercase. -
The timeout parameter specifies the amount of time to wait for an answer from the server. Again this can alos be provided via TIMEOUT environment variable.
-
The job parameter specifies the Prometheus job that will be passed as label if no job was handed over during the API call.
listen_port: 9200
username: <your username>
password: <your password>
timeout: 40
job: 'redfish-myjob'For a full reference of all metrics, their labels, value encodings, and the Redfish API endpoints they are sourced from, see docs/redfish-metrics-reference.md.
All metrics returned by the redfish exporter are gauges, except energy measurements from sensors.
Indicating if the redfish API was giving useful data back (== 1) or not (== 0).
Show the health information of the hardware parts like processor, memory, storage controllers, disks, fans, power and chassis if available.
Showing the count of errors per dimm.
Cisco servers do not seem to provide this kind of information via redfish. Dell PowerEdge servers only with certain DIMM manufacturers (Samsung not, Micron Technology and Hynix Semiconductor do).
Showing the powerstate of the server
The duration of the first response of the server to a call to /redfish/v1
Metric indicating if there was a valid redfish response while calling /redfish/v1
Total duration of scarping all data from the server
A collection of firmware version data stored in the labels. The value is always 1.