ProLiant Servers (ML,DL,SL)
1820120 Members
3022 Online
109619 Solutions
New Discussion

Retrieve information about "Operating System" via iLO PowerShell cmdlets

 
SOLVED
Go to solution
Flankengott
Advisor

Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hi all,

how can I retrieve the information about "Operating System" via iLO PowerShell cmdlets at iLO4 and iLO5?

Inormation > Overview > Server > Operating System

 

iLO Operating System.jpg

 
9 REPLIES 9
thutchings
HPE Pro

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hello,

 

This type of information about the OS and other various SW related items, is retrieved by the iLO using the Agentless Management Service (AMS). You can get this for RHEL here:

 

https://support.hpe.com/hpesc/public/swd/detail?swItemId=MTX_dc65ecbdcd2343858629d86281

 

Most supported operating systems have an option to use this.

 

Regards



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Flankengott
Advisor

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

@thutchings 

Hi,

thanks for you answer.

AMS is already isnstalled.

This is the reason why the "operating system" is known by iLO

My question was:

How can I retrieve the information about "Operating System" via iLO PowerShell cmdlets at iLO4 and iLO5?

What iLO PowerShell cmdlet do I have to use to get this "Operating System" information, mentioned in the screenshot above.

Something like:

Get-HPEiLO Overview Information.....???!!

thutchings
HPE Pro

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hello,

 

Sorry, I thought you provided the screenshot as an example of what you are looking for.

 

I tested this out and found that the command "Get-HPEiLOServerInfo -Connection $conn -OutputType RawResponse -Verbose" does provide the OS information:

"HostOS": {
"OsName": "VMware ESXi",
#1 SMP Release build-16324942 Jun 2 2020 10:08:07 x86_64 x86_64 x86_64 ESXi"

 

There is quite a bit of information provided with the above command, so I suspect it will likely require a Select-String command in order to parse the data.

 

Regards



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Flankengott
Advisor

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hi thutchings. 

Thanks!

At least that looks a bit better now. (A huge amount of information.......)
Will try to use Select-String. Never worked with it.
Hopefully this works.

Do you have another suggestion / cmdlet beside this "Select-String" ?

Kashyap02
HPE Pro

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hi @thutchings 

 

Even I tried the same command but I did not get the desired output. Is there something I am missing ? Is it because of the ILO user previlages ? Host OS details are missing in the output.

 

FanInfo : {HPE.iLO.Response.Redfish.Fan, HPE.iLO.Response.Redfish.Fan, HPE.iLO.Response.Redfish.Fan, HPE.iLO.Response.Redfish.Fan...}
FirmwareInfo : {HPE.iLO.Response.Redfish.FirmwareInformation, HPE.iLO.Response.Redfish.FirmwareInformation, HPE.iLO.Response.Redfish.FirmwareInformation,
HPE.iLO.Response.Redfish.FirmwareInformation...}
TemperatureInfo : {HPE.iLO.Response.Redfish.Temperature, HPE.iLO.Response.Redfish.Temperature, HPE.iLO.Response.Redfish.Temperature,
HPE.iLO.Response.Redfish.Temperature...}
MemoryInfo : HPE.iLO.Response.Redfish.MemoryInfoDetail
NICInfo : HPE.iLO.Response.Redfish.NICInfoDetail
PowerSupplyInfo : HPE.iLO.Response.Redfish.PowerSupply
ProcessorInfo : {HPE.iLO.Response.Redfish.Processor, HPE.iLO.Response.Redfish.Processor}
HealthSummaryInfo : HPE.iLO.Response.Redfish.HealthSummaryInfo
ServerName : localhost.localdomain
HostOS :
IP : 
Hostname : 
Status : OK
StatusInfo :

I am a HPE Employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

Accept or Kudo

thutchings
HPE Pro

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Hello,

 

If you do not add "-OutputType RawResponse", then you will likely see what you noticed in the output. I would add that and check what result you have.

 

Regarding the use of Select-String...I do not have much experience with using this either, but this should give you something similar to what grep does in Linux. There are different variables that can be used with this that should make it easier to parse the information from the Get-HPEiLOServerInfo command.

 

Regards



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Kashyap02
HPE Pro

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

Thank you. I got the desired output. 

I am a HPE Employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

Accept or Kudo

Flankengott
Advisor

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

@Kashyap02 

Hi  Kashyap02,

could you please share your script with your desired output?

Kashyap02
HPE Pro
Solution

Re: Retrieve information about "Operating System" via iLO PowerShell cmdlets

@Flankengott 
Hi, You can use the below set of commands to retrieve just the OS from ILO cmdlets. 

$conn = Connect-HPEiLO -Address <ILO IP> -Username <ILO Username> -Password <ILO Password> -DisableCertificateAuthentication
$response = $(Get-HPEiLOServerInfo -Connection $conn -OutputType RawResponse).ToString()
$pattern = [Regex]::new('(?<="HostOS":)(.*)(?=,"IntelligentProvisioningAlwaysOn)')
$HostOs = [regex]::Match($response,$pattern).Groups[1].Value  | ConvertFrom-Json
$HostOs

 

I tried this. got the below output. 

OsName OsSysDescription OsType OsVersion
------ ---------------- ------ ---------
Red Hat Enterprise Linux Linux localhost.localdomain 4.18.0-372.9.1.el8.x86_64 #1 SMP Fri Apr 15 22:12:19 EDT 2022 x86_64 40 8.6

I am a HPE Employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

Accept or Kudo