HPE Synergy
1758503 Members
2348 Online
108871 Solutions
New Discussion

OneView - Clearing Alerts via PowerShell based on Alert "Description"

 
SOLVED
Go to solution
gcj2021
Advisor

OneView - Clearing Alerts via PowerShell based on Alert "Description"

Hello!

I currently use PowerShell command to clear Locked alerts when necessary, but I need the ability to clear alerts based on the Name/Description of the alert.

Get-OVServer | Get-OVAlert -State Locked | Set-OVAlert -Cleared 

The above works, but I need to define the alert based on the name to clear specific alerts.

 

I tried the below, with no luck.

 

Get-OVServer | Get-OVAlert -Description "Overall security status of the system is at risk" -State Active | Set-OVAlert -Cleared 

Any help would be great! Also, it needs to be PowerShell. 

 

 

 

 

 

 

4 REPLIES 4
ChrisLynch
HPE Pro
Solution

Re: OneView - Clearing Alerts via PowerShell based on Alert "Description"

The only way to accomplish this is with the following 1-liner:

Get-OVServer | Get-OVAlert -State Active | ? description -eq "Overall security status of the system is at risk" | Set-OVAlert -Cleared -Notes "Clearing locked alert from PowerShell by $($ConnectedSessions.Username)"

I am an HPE employee

Accept or Kudo

gcj2021
Advisor

Re: OneView - Clearing Alerts via PowerShell based on Alert "Description"

Thanks Chris! Works well.

Sunitha_Mod
Moderator

Re: OneView - Clearing Alerts via PowerShell based on Alert "Description"

Hello @gcj2021

Awesome! 

We are glad to know your concern has been addressed. 

Thanks,
Sunitha G
I'm an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
pirx
Valued Contributor

Re: OneView - Clearing Alerts via PowerShell based on Alert "Description"

Any idea why this is not working? I've a few servers with disk errors (false alarms as this now happens on all server with PCIe NVMes after update)

# Get-OVServer | Get-OVAlert -State Active | ? description -like "The status of the PCIe disk at location*"

Severity Resource Created Modified State AssignedToUser Description
-------- -------- ------- -------- ----- -------------- -----------
Warning kdev0112 Sun 17 Mar 2024 10:05:04 Sun 17 Mar 2024 10:05:04 Active The status of the PCIe disk at location Embedded:Port=4A:Box=1:Bay=2 is deg…
Warning kdev0113 Mon 18 Mar 2024 11:21:43 Mon 18 Mar 2024 11:21:43 Active The status of the PCIe disk at location Embedded:Port=4A:Box=1:Bay=2 is deg…
Warning kdev0114 Mon 18 Mar 2024 18:32:35 Mon 18 Mar 2024 18:32:35 Active The status of the PCIe disk at location Embedded:Port=3A:Box=1:Bay=4 is deg…

Not sure what this etag is, pretty new to OV + pwsh.

# Get-OVServer | Get-OVAlert -State Active | ? description -like "The status of the PCIe disk at location*" | Set-OVAlert -Cleared
Set-OVAlert: [Send-OVRequest]: The specified ETag does not match the current ETag of the alert. Specify a valid ETag for the alert.

Note parameter is also not accepted. HPEOneView.850 used.

Get-OVServer -Name kdev0112* | Get-OVAlert -State Active | ? description -like "The status of the PCIe disk at location*" | Set-OVAlert -Cleared -Notes "test"
Set-OVAlert: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

 

I was able to clear other types like below sucessfully.

# Get-OVServer | Get-OVAlert -State Active | ? description -like "Platform Configuration Register(PCR)*" | Set-OVAlert -Cleared