Query a Redfish management API and read a server's health remotely
Task
Run the DMTF's Redfish mockup server, which serves a realistic management API for an imaginary server, and query it the way you would query an iLO or iDRAC: find the system, read its power state, its temperatures and fans, and its power supplies. Then record where the emulation stops, because knowing that is part of using it honestly.
Steps
- Download the Redfish-Mockup-Server and its example mockups, and start it on port 8000 bound to localhost, pointing it at a public-rack-server style mockup.
- Save
curl -s http://localhost:8000/redfish/v1/tolab/redfish/root.json, and follow theSystemslink to save the first system's resource tolab/redfish/system.json. - Find the chassis resource and save its thermal data (the
ThermalorThermalSubsystemlink) tolab/redfish/thermal.jsonand its power data tolab/redfish/power.json. - Record in
lab/redfish/health.csvwith headercomponent,reading,statusthe power state, two temperatures, one fan and each power supply. - Write
lab/redfish/limits.txtlisting at least three things a real management controller does that the mockup cannot, such as powering real hardware on.
Verify
These checks run in a POSIX shell: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. A stock Windows PowerShell or Command Prompt has no awk or grep, so there the first line fails.
grep -c '"@odata.id"' lab/redfish/root.json
grep -Ec '"PowerState": *"(On|Off)"' lab/redfish/system.json
grep -Ec '"ReadingCelsius"|"Reading"' lab/redfish/thermal.json
grep -Ec '"PowerSupplies"|"PowerSupply"' lab/redfish/power.json
awk -F, 'NR>1 {n++} END {print n" health reading(s)"}' lab/redfish/health.csv
grep -c . lab/redfish/limits.txt
The root lists resources by @odata.id, the system reports a power state, the thermal data has temperature readings and the power data lists supplies. Your health file needs at least five rows and your limits file at least three lines. A real controller answers the same URLs over HTTPS with a username and password.
Notes
The same data is exposed over IPMI, which you would read with ipmitool sensor on a server that has a BMC. Redfish is the modern replacement: JSON over HTTPS, readable with any HTTP client, which is why this lab can use curl.
This is an independent study companion for CompTIA Server+ SK0-005 and is not produced by or endorsed by CompTIA.