Popular Posts

Oct 22, 2020

Script to Update iLO Firmware

 Script to Update iLO Firmware


APPLIES TO :  HP iLO

ISSUE :  How to update iLO firmware for many servers in one go. 

GOAL :  Automate with scripts to update the iLO firmware. 

SOLUTION :  Create scripts using HP provided tools to automate the iLO firmware upgrade. 

Prerequisites :   A Linux jump server which can reach all the console IP's
                              or any Linux terminal - preferably Cygwin installed in your laptop.
                              Download Firmware rpm file
                              Download linux-LOsamplescripts5.30.0.tgz tool from HP

1. Download the rpm file of firmware.
            Link to down load the iLO Firmware version 2.30 (firmware-ilo5-2.30-1.1.x86_64.rpm)

2. Download HP tool to pass on the firmware in xml
            Download link linux-LOsamplescripts5.30.0.tgz

3. Extract the HP tool to get the Update_Firmware.xml file and locfg.pl file
            tar zxvf linux-LOsamplescripts5.30.0.tgz

4. Extract the rpm file to get the binary file
            $ rpm2cpio firmware-ilo5-2.30-1.1.x86_64.rpm | cpio -idmv
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/.cpq_package.inc
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/.setup
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/CP038707.xml
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/hpsetup
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.30-1.1/ilo5_230.bin
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/payload.json
            ./usr/lib/x86_64-linux-gnu/firmware-ilo5-2.10-1.1/setup
            ./usr/lib/x86_64-linux-gnu/hp-scexe-compat
            cpio: ./usr/lib/x86_64-linux-gnu/hp-scexe-compat/CP038707.scexe not created: newer or same age version exists
            ./usr/lib/x86_64-linux-gnu/hp-scexe-compat/CP038707.scexe
            ./usr/lib/x86_64-linux-gnu/scexe-compat
            cpio: ./usr/lib/x86_64-linux-gnu/scexe-compat/CP038707.scexe not created: newer or same age version exists
            ./usr/lib/x86_64-linux-gnu/scexe-compat/CP038707.scexe
            66357 blocks
            

5. Edit the file Update_Firmware.xml and provide the path of binary file which is extracted from the rpm
            <UPDATE_RIB_FIRMWARE IMAGE_LOCATION="/home/judi/ilo5_230.bin"/>

6. Execute manually in one server to test the xml file and firmware update.
            perl /home/judi/linux-LOsamplescripts5.30.0/locfg.pl -s 192.168.1.11 -f /home/judi/windows-LOsamplescripts4.50.0/Update_Firmware.xml -u ilousername -p ilopasswd

7. Now check the firmware version of that server.
            curl -ks "https://192.168.1.10/redfish/v1/Managers/1/" -k -u ilousername:ilopasswd | python -m json.tool | grep "FirmwareVersion"

8. Upon confirmation the functionality, write a script to update the firmware to all servers
            for i in `cat /home/judi/server_list`; do
                    perl /home/judi/linux-LOsamplescripts5.30.0/locfg.pl -s $i -f /home/judi/windows-LOsamplescripts4.50.0/Update_Firmware.xml -u ilousername -p ilopasswd
                    if [ $? -eq 0 ] ; then
                       echo "$i         - Done" >> /home/judi/log.out
                    else
                       echo "$i         - NOT" >> /home/judi/log.out
                    fi
            done 

9. Check the log.out file to know the status of the firmware update


~Judi~

Oct 5, 2020

Downloading the iLO Active Health System Log AHS by using cURL

 Download the Active Health System Log from iLO


1.    To download the entire Active Health System Log:

        curl "https://<iLO_IP_address>/ahsdata/ahs.ahs?downloadAll=1" -k -v -u <username>:<password> -o <filename>.ahs


2.    To download the Active Health System Log for the last seven days, and include a case number and contact information:

        curl "https://<iLO_IP_address>/ahsdata/ahs.ahs?days=<number_of_days>&case_no=<number>&contact_name=<name>&phone=<phone_number>&email=<email_address>&co_name=<company>" -k -v -u <username>:<password> -o <filename>.ahs

        curl "https://192.168.1.10/ahsdata/ahs.ahs?days=7&case_no=5642885983&contact_name=Judi&phone=09765898746&email=judi@judi.com&co_name=JUDI" -k -v -u iLOusername:iLOPassword -o 5642885983_CC200A1H76.ahs

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


Popular Posts