Is it possible to mute alerts for a group?
I also had this question.
I have attempted to achieve this task through the Orion SDK using Powershell, since there is no way to do it from the UI. This can be used as a workaround if needed...
I believe I have achieved this by using the following code:
# Load the SwisSnapin
Add-PSSnapin "SwisSnapin"
# Get Swis Connection Info
$username = Read-Host "Enter Username"
$SecurePassword = Read-Host "Enter Password" -AsSecureString
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword)
$Password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
$OrionServer = "OrionServer"
$swis = Connect-Swis $OrionServer -UserName $Username -Password $password
# You can get the URI by using $URI = Get-SwisData $swis "SELECT URI FROM Orion.Container WHERE Name LIKE 'WhateverGroupHere'"
$URI = "Some Group's URI HERE"
# This is the line that Mutes the group for Alerts
Invoke-SwisVerb $swis -verb "SuppressAlerts" -EntityName Orion.AlertSuppression @(,@([string]$URI))
# Checking if the group is muted or not.
$MutedOrNot = Invoke-SwisVerb $swis -verb "getAlertSuppressionState" -EntityName Orion.AlertSuppression @(,@([string]$URI))
$MutedOrNot = $MutedOrNot.InnerText.Replace($URI,"")
if($MutedOrNot -match "\."){$MutedOrNot = ($MutedOrNot -replace '(\d)').Split(".")[1]}
$MutedOrNot
# If you want to unmute the group for alerts, uncomment this line of code:
#Invoke-SwisVerb $swis -verb "ResumeAlerts" -EntityName Orion.AlertSuppression @(,@([string]$URI))
Thanks,
Jordan
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.