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


Mar 9, 2020

SPARC Soalris OpenBoot PROM (OBP) Commands

SPARC Solaris OpenBoot PROM (OBP) Commands

APPLIES TO :  SPARC Solaris Servers

ISSUE :  NIL

GOAL : SPARC Solaris Useful OK Prompt or OBP commands

SOLUTION :  SPARC Solaris Useful OK Prompt or OBP commands

Prerequisites :  NIL

OK Prompt or OBP commands

  1. To show the disks
               OK> show-disks

  2. To search the scsi devices attached to the primary scsi controller
               OK> probe-scsi

  3. To search all the scsi devices
               OK> probe-scsi-all

  4. To list device alias names
               OK> devalias

  5. To temporarily create a device alias
               OK> devalias <alias> <path>

  6. To view the current NVRAM settings
               OK> printenv

  7. To set the envirement variables
               OK> setenv <env> <value>

  8. To set the open boot prompt settings to the factory default
               OK> set-defaults

  9. To set the device alias permanently to NVRAM
               OK> nvalias <alias> <path>

  10. To remove the nvalias 'cdrom1' from NVRAMRC
               OK> nvunalias cdrom1

  11. To find out the Open boot prompt version
               OK> .version

  12. To find out the ethernet MAC address
               OK> .ent_addr

  13. To find out the CPU and PCI bus speeds
               OK> .speed

  14. To display the Model, Architecture, processor, openboot version, ethernet address, hostid and etc
               OK> banner

  15. To reset variable values to the factory defaults
               OK> set-defaults

  16. To reboot the system from OK Prompt
               OK> reset-all

  17. To show the PCI devices
               OK> show-devs

  18. Boot the system from the default boot devices
               OK> boot

  19. To boot from cdrom
               OK> boot cdrom

  20. Boots the system from device as specified by the disk device alias
               OK> boot disk

  21. Boot from the full device mentioned
               OK> boot device-path

  22. Betwork boot .boots from a TFTP boot server or Jumpstart server
               OK> boot net

  23. Jumpstart boot.
               OK> boot net -install

  24. Tape boot.boots off a SCSI tape if available
               OK> boot tape

  25. Boot halted .boot into a halted state(ok prompt) interesting for troubleshooting boot at the lowest level
               OK> boot -h

  26. Reconfiguration boot.Boot and search for all attached device.useful when new device attached to the system
               OK> boot -r

  27. Single user.boots the system to run level 1
               OK> boot -s

  28. Verbose boot.show good debugging information.
               OK> boot -v

  29. To boot the server to failsafe mode
               OK> boot -F failsafe

Displaying System Information

  30. Display ID PROM contents
               OK> .idprom

  31. Display a list of processor-dependent trap types
               OK> .traps

  32. Display list of installed and probed devices
               OK> show-devs

  33. Eject the floppy
               OK> eject floppy

  34. Eject the cdrom
               OK> eject cdrom

  35. Call the operating system to write information to hard disk
               OK> sync

Emergency Keyboard Commands

  36. Bypass POST .(This command does not depend on security-mode)
               OK> Stop

  37. Abort.(This will also stop a running system. You can resume normal operations if you enter go at the prompt. Enter anything else and you will stay halted)
               OK> Stop-A

  38. Enter diagnostic mode(set diag-switch?to true) 
               OK> Stop-D

  39. Reset NVRAM contents to default values.
               OK> Stop-N




~Judi~




How to disable IPv6 in Soalris

How to disable IPv6 in Soalris

APPLIES TO :  Disable IPv6 in Solaris, Solaris Operating System - Version 8 6/00 U1 to 10 8/11 U10 [Release 8.0 to 10.0]

ISSUE :  Currently no ISO images available with IPS repositories for Oracle Solaris Studio, nor with patches for Oracle Solaris Studio.

GOAL :  This document describes what files to remove or edit to disable IP Version 6 on Solaris[TM] 8,9,10 on systems that only require IPv4 (IPv6 configuration is no longer needed)

SOLUTION :  This document describes what files to remove or edit to disable IP Version 6 on Solaris[TM] 8,9,10 on systems that only require IPv4 (IPv6 configuration is no longer needed)

Prerequisites :   It is not recommended to disable IPv6 on Solaris 11.

               1. Make a backup of the IPv6 NDP daemon's configuration file, (if it exists),
by using;
                      # cp /etc/inet/ndpd.conf /etc/inet/ndpd.conf.`date +%Y%m%d`

               2. Remove any lines from the IPv6 NDP Daemon's configuration file. Then
add these 2 lines;
                      StatefulAddrConf false
                      StatelessAddrConf false
                              These lines will prevent remote and automatic IPv6 address assignments.

               3. Stop and restart the NDP Daemon;
                      svcadm restart ndp

               4. Delete any IPv6 interfaces, for example using "net0/v6";
                      ipadm show-addr
                      ipadm delete-addr net0/v6
                      ipadm show-addr

               5. Disable the following services;
                      # svcadm disable svc:/network/routing/legacy-routing:ipv6
                      # svcadm disable svc:/network/dhcp/server:ipv6
                      # svcadm disable svc:/network/dhcp/relay:ipv6

               6. Reboot to verify IPv6 remains off



Oracle SupportDocument 1010562.1 How to disable IPv6  




~Judi~






















How to Install Oracle Developer Studio 12.6

How to Install Oracle Developer Studio 12.6

APPLIES TO :  Solaris 10 and Solaris 11

ISSUE :  Currently no ISO images available with IPS repositories for Oracle Solaris Studio, nor with patches for Oracle Solaris Studio.

GOAL :  Install Oracle Developer Studio 12.6

SOLUTION :  Install Oracle Solaris Studio 12.6 From a Tar File 

Prerequisites :   Solaris 10 and Solaris 11

               1. Download Oracle Developer Studio 12.6.
                       Download Link

               2. Extract the tar file using the appropriate command for your platform:
                       bzcat download-directory/SolarisStudio12.6-solaris-sparc-bin.tar.bz2 | tar -xf -
                       The contents are unpacked in a directory named: SolarisStudio12.4-OS-platform-bin where OS is solaris or linux

               3. Install the operating system patches as described below. (Oracle Solaris 10 only)
                       installation-directory/install_patches.sh

               4How to Create a Local IPS Repository for Oracle Solaris Studio (Doc ID 2100640.1)
                       There currently are no ISO images available with IPS repositories for Oracle Solaris Studio, nor with patches for Oracle Solaris Studio., This is the topic of BUG:22099153.


Part I: Get the certificates

If the certificates have already been downloaded, there is no need to download them again.
1.) Go to https://pkg-register.oracle.com
2.) Select Oracle Solaris Studio Support -> Show Details
3.) Click on the link to the "certificate page", currently at https://pkg-register.oracle.com/register/certificate
4.) Download both Key and Certificate
5.) Give the downloaded files recognizable names, for example:
solarisstudio-support-pkg.oracle.com.certificate.pem
solarisstudio-support-pkg.oracle.com.key.pem

Part II: Setting up the Repository Server

The repository server needs to be able to connect to https://pkg-register.oracle.com.
No Solaris packages or Oracle Solaris Studio packages will be installed on the repository server.
Only the local IPS repository will be created and populated.
How exactly the repository is created should not matter; steps 7 and 8
are examples, but if you prefer a different approach, use your own preferred method
to create the local IPS repository.
6.) Transfer Key and Certificate to the repository server, into a directory where the superuser can access the pem files
7.) Create a zfs pool for the rlocal IPS epository:
The example instructions below put the repository under rpool/export/local/solarisstudio
$ sudo zfs create rpool/export/local
$ sudo zfs create -o compression=on -o atime=off rpool/export/local/solarisstudio
Check:
$ zfs get -r compression,atime rpool/export/local
NAME PROPERTY VALUE SOURCE
rpool/export/local compression off default
rpool/export/local atime on default
rpool/export/local/solarisstudio compression on local
rpool/export/local/solarisstudio atime off local
8.) Create the repository:
$ sudo pkgrepo create /export/local/solarisstudio
9) Create a file update-studio-124 which looks like this:
$ cat update-studio-124
DIRECTORY=<DIR_CONTAINING_CERTS>
PRODUCT=solarisstudio-support-pkg.oracle.com
KEY=${DIRECTORY}/${PRODUCT}.key.pem
CERT=${DIRECTORY}/${PRODUCT}.certificate.pem
# if the certificates do not cover Oracle Solaris Studio Support,
# use the https://pkg.oracle.com/solarisstudio/release repository instead.
SOURCE=https://pkg.oracle.com/solarisstudio/support/
TARGET=/export/local/solarisstudio
pkgrecv -s $SOURCE -d $TARGET --key $KEY --cert $CERT -r \
developer/solarisstudio-124
# "-m all-timestamps" is default in Solaris 11.2.
# Add "-m latest" option to download only the most recent version of each patch
pkgrecv -s $SOURCE -d $TARGET --key $KEY --cert $CERT -r \
developer/solarisstudio-124/*
[ $? -eq 0 ] && pkgrepo refresh -s $TARGET

10) Run this script:
$ sudo sh -x update-studio-124
+ DIRECTORY=<DIR_CONTAINING_CERTS>
+ PRODUCT=solarisstudio-support-pkg.oracle.com
+ KEY=<DIR_CONTAINING_CERTS>/solarisstudio-support-pkg.oracle.com.key.pem
+ CERT=<DIR_CONTAINING_CERTS>/solarisstudio-support-pkg.oracle.com.certificate.pem
+ SOURCE=https://pkg.oracle.com/solarisstudio/support/
+ TARGET=/export/local/solarisstudio
+ pkgrecv -s https://pkg.oracle.com/solarisstudio/support/ -d /export/local/solarisstudio --key <DIR_CONTAINING_KEY>/solarisstudio-support-pkg.oracle.com.key.pem --cert <DIR_CONTAINING_CERT>/solarisstudio-support-pkg.oracle.com.certificate.pem -r developer/solarisstudio-124
Processing packages for publisher solarisstudio ...
Retrieving manifests for dependency evaluation ...
PROCESS ITEMS GET (MB) SEND (MB)
Completed 36/36 1448/1448 4231/4231
+ pkgrecv -s https://pkg.oracle.com/solarisstudio/support/ -d /export/local/solarisstudio --key <DIR_CONTAINING_KEY>/solarisstudio-support-pkg.oracle.com.key.pem --cert <DIR_CONTAINING_CERT>/solarisstudio-support-pkg.oracle.com.certificate.pem -r 'developer/solarisstudio-124/*'
Processing packages for publisher solarisstudio ...
Retrieving manifests for dependency evaluation ...
PROCESS ITEMS GET (MB) SEND (MB)
developer/solarisstudio-124/backend 0/37 44/1315 15/4579
[...]
+ [ 0 -eq 0 ]
+ pkgrepo refresh -s /export/local/solarisstudio
Initiating repository refresh.
$

At this point, the local IPS repository has been created, and populated with Oracle Solaris Studio 12.4. It is now possible to create a copy of the repository and move that
to another server, for example via an ISO image, or by transferring a tarball.

11.) Create Repository Server.
The example sets up an HTTP server
$ sudo svccfg -s application/pkg/server setprop pkg/inst_root=/export/local/solarisstudio
$ sudo svccfg -s application/pkg/server setprop pkg/readonly=true
$ svcprop -p pkg/inst_root application/pkg/server
/export/local/solarisstudio
$ sudo svcadm refresh application/pkg/server
$ sudo svcadm enable application/pkg/server

At this point, the repository server is completely set up.

Part III: Client setup

The client must have a working solaris publisher to add Solaris packages.
On any client on which the compilers are supposed to be installed:
12.) Configure the publisher for solarisstudio:
$ sudo pkg set-publisher -G '*' -M '*' -g http://<repository server>:80 solarisstudio
$ pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F http://pkg.oracle.com/solaris/release/
solarisstudio origin online F http://<repository server>:80/
Check:
$ sudo pkg refresh solarisstudio
$ pkg list -af 'pkg://solarisstudio/*'
NAME (PUBLISHER) VERSION IFO
developer/solarisstudio-124 (solarisstudio) 12.4-1.0.0.1 ---
developer/solarisstudio-124 (solarisstudio) 12.4-1.0.0.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.6.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.5.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.4.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.3.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.2.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.1.0 ---
developer/solarisstudio-124/backend (solarisstudio) 12.4-1.0.0.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.10.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.9.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.7.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.5.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.4.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.2.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.1.0 ---
developer/solarisstudio-124/c++ (solarisstudio) 12.4-1.0.0.0 ---
developer/solarisstudio-124/cc (solarisstudio) 12.4-1.0.4.0 ---
developer/solarisstudio-124/cc (solarisstudio) 12.4-1.0.3.0 ---
[...]

13.) Install the packages:
$ sudo pkg install solarisstudio-124

4. How to Create a Copy of a Solaris Studio IPS Repository (Doc ID 2101537.1)


~Judi~

Popular Posts