Popular Posts

Oct 5, 2020

cli commands for iLO Management - curl and redfish

Redfish curl cli commands for iLO Management


APPLIES TO :  HP iLO

ISSUE :  The links, Server health, Raid Configuration and other outputs needs to be verified for many servers

GOAL :  Automate with scripts to collect outputs and validate the settings.

SOLUTION :  Login to every servers console and validating them is a painful work. we can create scripts to do that with the help of this commands, I am not providing any scripts in this blog, but the commands will help you to create a script for you.

Prerequisites :   A Linux jump server which can reach all the console IP's or any Linux terminal - preferably Cygwin installed in your laptop.


1. Find serial number from iLO.
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -w "SerialNumber"
2. Find total memory from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -w "TotalSystemMemoryGiB"

3. Find Bios version from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -w "BiosVersion"

4. Find Firmware version from iLO
curl -ks "https://192.168.1.10/redfish/v1/Managers/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "FirmwareVersion"
5. Find iLO model from iLO
curl -ks "https://192.168.1.10/redfish/v1/Managers/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "Model"

6. Find iLO date and time settings from iLO
curl -ks "https://192.168.1.10/redfish/v1/Managers/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -w "DateTime"

7. Find iLO time zone from iLO
curl -ks "https://192.168.1.10/redfish/v1/Managers/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "DateTimeLocalOffset"

8. Find number of CPU count from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "Count"

9. Find CPU Model from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "Model" | grep -v "ProLiant"
10. Find total core per CPU from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/Processors/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "TotalCores"
11. Find total thread per CPU from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/Processors/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "TotalThreads"

12. how many number of memory board from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/Memory/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "BoardCpuNumber"

13. how many memory sockets per memory board from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/Memory/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "BoardNumberOfSockets"

14. total size of memory per memory board from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/Memory/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "BoardTotalMemorySize"
15. Find number of storage array controllers from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/SmartStorage/ArrayControllers/" -k -u iLOusername:iLOPassword | python -m json.tool | grep count

16. Find the Storage - Capacity of disks in MB
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/SmartStorage/ArrayControllers/0/DiskDrives/8/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "CapacityMiB"

17. Find the Storage - disk type - ssd or scsi from iLO
curl -ks "https://192.168.1.10/redfish/v1/Systems/1/SmartStorage/ArrayControllers/0/DiskDrives/8/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "MediaType"

18. Find the number of user accounts in ILO 
curl -ks "https://192.168.1.10/redfish/v1/AccountService/Accounts/" -k -u iLOusername:iLOPassword | python -m json.tool | grep odata.count
19. Find user login name from iLO
curl -ks "https://192.168.1.10/redfish/v1/AccountService/Accounts/2/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "LoginName"

20. find role of the user accounts from iLO
curl -ks "https://192.168.1.10/redfish/v1/AccountService/Accounts/2/" -k -u iLOusername:iLOPassword | python -m json.tool | grep "RoleId"

21. Find server health status from iLO
curl -ks "https://192.168.1.10/redfish/v1/Chassis/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -i health | tail -1 |awk '{print $NF}'

22. Find server serial number from iLO
curl -ks "https://192.168.1.10/redfish/v1/Chassis/1/" -k -u iLOusername:iLOPassword | python -m json.tool | grep -i serial | tail -1 |awk '{print $NF}'
23. Find date and time of iLO
curl -ks "https://192.168.1.10/redfish/v1/Chassis/1/DateTime/" -k -u iLOusername:iLOPassword | python -m json.tool | grep '"DateTime":' | awk '{print $NF}'

24. Find disk details.
curl -ks "https://192.168.1.10/redfish/v1/Chassis/1/redfish/v1/systems/1/SmartStorage/ArrayControllers/0/DiskDrives/9/" -k -u iLOusername:iLOPassword | python -m json.tool


No comments:

Post a Comment

Popular Posts