Query a Redfish management API and read a server's health remotely

short · 45 min · Objective 1.3

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

  1. 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.
  2. Save curl -s http://localhost:8000/redfish/v1/ to lab/redfish/root.json, and follow the Systems link to save the first system's resource to lab/redfish/system.json.
  3. Find the chassis resource and save its thermal data (the Thermal or ThermalSubsystem link) to lab/redfish/thermal.json and its power data to lab/redfish/power.json.
  4. Record in lab/redfish/health.csv with header component,reading,status the power state, two temperatures, one fan and each power supply.
  5. Write lab/redfish/limits.txt listing 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.