- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Servers - General
- >
- Need a powershell script to collect unrepaired eve...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 05:00 AM - last edited on 05-04-2023 07:21 AM by support_s
04-24-2023 05:00 AM - last edited on 05-04-2023 07:21 AM by support_s
Need a powershell script to collect unrepaired events in ILO5 IML
I have a few hundred DL/BL/SY servers all with ILO5. I want to run a PS script that will give me a listing of all IML events that show as not repaired. Does anyone have something like that?
THANKS!
- Tags:
- Prolaint server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 12:13 AM
05-01-2023 12:13 AM
Re: Need a powershell script to collect unrepaired events in ILO5 IML
Hi
You can retrieve this information from RESTApi tool. I used postman and used the below methods.
Get method.
https://<ILO IP>/redfish/v1/Systems/1/LogServices/IML/Entries?$filter=Oem.Hpe.Severity eq 'Critical'
You can use the Severity filters like Critical, Repaired, Caution, Informational.
Will this powershell command retrieving the critical messages to a file when run ?
Get-HPEiLOIML $con | ConvertTo-Json | Out-File -FilePath "<Filepath>\<Filename>.json" | Where-Object -Property Severity -EQ Critical
$con is the object set for the ILO of the server.
Making a connection to ILO.
$con = Connect-HPEiLO -IP <ILO IP> -Username <ILO Username> -Password <ILO Password> -DisableCertificateAuthentication
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2023 11:49 PM - last edited on 05-02-2023 10:53 PM by Sunitha_Mod
05-01-2023 11:49 PM - last edited on 05-02-2023 10:53 PM by Sunitha_Mod
Re: Need a powershell script to collect unrepaired events in ILO5 IML
Sure, here's a PowerShell script that should help you collect unrepaired IML events on your ILO5 servers:
# Set the variables for the ILO5 server IP addresses
$server_ips = @("10.0.0.1","10.0.0.2","10.0.0.3")
# Set the variables for the ILO5 login credentials
$username = "username"
$password = "password"
# Iterate through each server IP address and collect the unrepaired IML events
foreach ($server_ip in $server_ips) {
# Create a new ILO5 session
$session = New-HPiLOCredential -Host $server_ip -Username $username -Password $password
# Get the IML log entries
$iml = Get-HPiLOIMLLog -Connection $session
# Filter for unrepaired events
$unrepaired_iml = $iml | Where-Object { $_.RepairState -ne "Repaired" }
# Output the results for the current server
Write-Host "Unrepaired IML events for $server_ip:"
$unrepaired_iml
}
You'll need to replace the $server_ips, $username, and $password variables with your own server IP addresses and login credentials. The script will then iterate through each server IP address and collect the unrepaired IML events using the ILO5 PowerShell cmdlets. The results will be output for each server in the console.