SOLVED: Alerts and API: How to update the targets of the Alert Suppression Window
Borru
Posts: 3 New member
Dear all,
I have two questions which are connected:
1. If the host machine (which may run several instances) is in a downtime window and the instances are not, will the instances still raise alerts or are they suppressed as the host machine is already in a downtime window?
2. How can I update the Targets of a configured Alert Suppression Window with the help of the Powershell API:
We have patch days here and a subset of machines machines are in different patch day groups.
I have configured to suppress alerts based on tags for the instances, but since only instances can be tagged and host machines not, I want to update the alert suppression windows with the help of the powershell API to include the host machine.
I have tried the following:
Kind Regards,
Borru
I have two questions which are connected:
1. If the host machine (which may run several instances) is in a downtime window and the instances are not, will the instances still raise alerts or are they suppressed as the host machine is already in a downtime window?
2. How can I update the Targets of a configured Alert Suppression Window with the help of the Powershell API:
We have patch days here and a subset of machines machines are in different patch day groups.
I have configured to suppress alerts based on tags for the instances, but since only instances can be tagged and host machines not, I want to update the alert suppression windows with the help of the powershell API to include the host machine.
I have tried the following:
- Create a new array, add the machine from the objects I get from Get-SqlMonitorMachine and then assign this array to the "Targets"-Property of the object I get from Get-SqlMonitorAlertSuppressionWindow like this:
$machine = Get-SqlMonitorMachine<br>$window = Get-SqlMonitorAlertSuppressionWindow -Name WindowName<br>$targets = $window.Targets<br>$newTargets = @($targets,$machine[0])<br>$window.Targets = $newTargets
- Set only the machine object like this:
$machine = Get-SqlMonitorMachine<br>$window = Get-SqlMonitorAlertSuppressionWindow -Name WindowName<br>$window.Targets = $machine[0]
Kind Regards,
Borru
Tagged:
Comments
the first question is answered as we tried it yesterday:
If the machine (host) is in a alert suppression window, the instances will not raise any alerts.
The second question on how to add a machine as a target for the update-sqlmonitoralertsuppressionwindow cmdlet is still open.
Kind Regards,
Borru
Kind Regards,
Borru
Apologies we didn't respond to you sooner, looks like there was a brief issue with the mechanism that generates tickets internally from our forum. Glad you were able to resolve this, please let us know if you require any further assistance with SQL Monitor.
Tom Claringbold | Redgate Software
Have you visited our Help Center?