Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Alert Suppression Question

$
0
0

Hi all,

 

I am currently using a powershell script and the SDK to suppress alerts for a bunch of servers in my environment.  I have two questions:

 

1.) It takes upwards of 7 minutes for the script to finish setting the alert suppression for the 215 servers.  Is there a way to speed this up.  I am using the following powershell script (not the full script) to set the Alert Suppression.

 

$query = "select caption,uri from orion.nodes where caption like '%miargmtw%' or caption like '%flargmtw%'"

try

{

    $uri = Get-SwisData -SwisConnection $swis -query $query -ErrorAction Stop

}

catch

{

    $body = "$($MyInvocation.InvocationName) hit an exception during the query to get server information.  The Error:`r`n $($error[0])"

    $eventLogMessage += "$body"

    send-email -body $body

    Write-EventLog -LogName $eventLogName -Source $source -EntryType Error -Category 0 -EventId 3245 -Message $eventLogMessage

    Exit

}

if([string]::IsNullOrEmpty($uri))

{

    $body = "$($MyInvocation.InvocationName): SolarWinds Query did not return any values.  Please Validate Query in the SWQL Studio`r`n The query was '$query'"

    $eventLogMessage += $body

    Send-Email -body $body

}

else

{

    $eventlogMessage += "Found $($uri.count) servers to put into maintenance mode`r`n"

    $eventlogMessage += "Placing Servers into maintenance mode`r`n"

    try

    {

        Invoke-SwisVerb -SwisConnection $swis -EntityName Orion.AlertSuppression -Verb SuppressAlerts -Arguments @([string[]] $uri.uri, $startTime, $endtime) -ErrorAction Stop | Out-Null

    }

    catch

    {

        $body = "$($MyInvocation.InvocationName): Exception when attempting to Set AlertSuppression on the Node."

        $eventLogMessage += $body

        Send-Email -body $body

    }

 

2.) If I query the alertsuppression table, I see all of the servers that I have muted alerts for using the powershell script from above.  My question is, does this table purge the values after the suppress time ends or do i have to specifically say to resume alerts to clear that table?  And if so, are the alerts still muted, even though the web console doesn't show that the alerts are muted in the status under managed nodes.

 

Thanks,

Steve


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>