VMware Cloud Community
CompassITCanada
Contributor
Contributor
Jump to solution

Script Help: Trying to remove Alarm Definitions for vSAN as we won't use it ever

My scripting is really rusty and I'm trying to remove all vSAN pre defined Alarms as there are 278 of them or some high number.

All the searching I have done doesn't seem relevant or have right syntax for 6.7

Thanks in anticipation

Twister

0 Kudos
2 Solutions

Accepted Solutions
amohammadimir
Hot Shot
Hot Shot
Jump to solution

I wrote this PowerCLI script for you, it might be helpful:

Get-AlarmDefinition | Where-Object { $_.Name -like '*vSAN*'} | Set-AlarmDefinition -Enabled:$false

Please remember to mark the replies as answers if they helped.

View solution in original post

CompassITCanada
Contributor
Contributor
Jump to solution

Thanks amirmohammadimir, that got going in right direction. Very much appreciated.Smiley Happy

I amended the action to | Remove-AlarmDefinition so that the Alarms were removed as desired.

Final command works a treat

Get-AlarmDefinition | Where-Object {$_.Name -like '*vSAN*'} | Remove-AlarmDefinition

View solution in original post

2 Replies
amohammadimir
Hot Shot
Hot Shot
Jump to solution

I wrote this PowerCLI script for you, it might be helpful:

Get-AlarmDefinition | Where-Object { $_.Name -like '*vSAN*'} | Set-AlarmDefinition -Enabled:$false

Please remember to mark the replies as answers if they helped.
CompassITCanada
Contributor
Contributor
Jump to solution

Thanks amirmohammadimir, that got going in right direction. Very much appreciated.Smiley Happy

I amended the action to | Remove-AlarmDefinition so that the Alarms were removed as desired.

Final command works a treat

Get-AlarmDefinition | Where-Object {$_.Name -like '*vSAN*'} | Remove-AlarmDefinition