HP Scripting Tools for Windows PowerShell User Guide: OA cmdlets

Connect-HPOA : Failed for 192.168.242.61:A connection attempt failed because the connected party did not
properly respond after a period of time, or
established connection failed because connected host has failed to respond 192.168.242.61:22
At line:1 char:1
+ Connect-HPOA 192.168.242.61 -Username Administrator -Password Admin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Connect-HPOA], HPOAErrorMsg
+ FullyQualifiedErrorId : HPOACmdlets.ConnectHPOA
Using cmdlets to manage OA
Once connection to OA is established other cmdlets can be used to manage OA. For example,
the Get-HPOAEnclosureStatus cmdlet can be used to display OA enclosure information as
shown:
PS C:\> Get-HPOAEnclosureStatus $conObj
IP : 192.168.1.2
Hostname : oahostv2.company.net
StatusType : OK
StatusMessage : OK
Enclosure : @{Status=Degraded; UnitIdentificationLED=On; DiagnosticStatus=}
OnboardAdministrator : @{Status=OK}
PowerSubsystem : @{Status=Degraded; PowerMode=Not Redundant with Power Ceiling;
PowerCapacity=3600 Watts DC; PowerAvailable=2540 Watts DC; PresentPower=628 Watts AC}
CoolingSubsystem : @{Status=OK; FansGoodWantedNeeded=6/6/5; Fans=System.Management.Automation.PSObject[]}
Other cmdlets can be used to set or update OA settings. For example, the Set-HPOAName cmdlet
can be used to change the OA name as follows:
PS C:\> Set-HPOAName $conObj -Name Examples
You can use output type RawText to display more information for the cmdlet execution as shown
in the following example:
PS C:\> Set-HPOAName $conObj -Name Examples -OutputType RawText
Onboard Administrator name changed to Examples.
If the cmdlet is successful, no other message is displayed. If an error occurs, an output message
similar to the following is displayed.
IP Hostname StatusType StatusMessage
-- -------- ----------- --------------
192.168.1.2 oahostv2.company.net ERROR {Invalid Arguments.}
Log processing examples
The following examples demonstrate how to access OA log data. In these examples, you want to
get a summary of the events in the logs available to the OA (that come from blades in the enclosure)
without having to view all the log events. The summary enables you to focus on the details for
specific types of events in the logs if necessary for a Caution or Critical event.
The first example gets and processes iLO event logs.
PowerShell script:
#Find the OAs that I want
$OAS = Find-HPOA 192.168.242.63-65 -Verbose |
% {Add-Member -PassThru -InputObject $_ Username Administrator}|
% {Add-Member -PassThru -InputObject $_ Password Admin}
#Connect to the OAs
$conObj = $OAS | Connect-HPOA
#get the iLO event logs from the blades in Bay 4
$rt = $conObj | Get-HPOASysLog -Target iLO -Bay 4
#process the ilo event log returned from each OA from the iLO in Bay 4
foreach ($ilo in $rt) {
$ilo.IP + " OA has " + $ilo.Bay.iLOEventLog.Count + " Bay 4 iLO log entries."
$sevs = $(foreach ($event in $ilo.Bay.iLOEventLog) {$event.SEVERITY})
$uniqsev = $($sevs | Sort-Object | Get-Unique)
$sevcnts = $ilo.Bay.iLOEventLog | group-object -property SEVERITY noelement
"There are " + $uniqsev.Count + " type(s) of events in the iLO log in Bay 4.
Using cmdlets to manage OA 17