Powershell monitor , update existing alert?

Hi!
I have created a powershell monitor that enters info into an alert. Is it possible to make the script update the alert even though the alerts state has not changed?

example code, not my alert but same concept. When alert is triggered one site is not running, one hour later two sites is not running. How do I get the updated information into the alert?

$alert = Get-IISSite | where-object {$_.state -ne "Started"}
if ($alert.count -gt 0)
{
$messagetext = "$alert.name , $alert.state"
$state = "Error"
}else
{
$state = "OK"
}

Not that I am aware of. Statechanges are required for an alert output of a monitor. You could have a three state monitor, and update the alert context and alert severity, having 1 site down = warning, with 2+ sites down = critical?

Alternatively, you could use a rule, with repeat counts. The latest alert context would update the existing alert with a site count value, I believe.

1 Like