cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

Schedule recurring unmanage maintenance windows or alert suppression windows

Hi,

We have currently a SolarWinds infrastructure relying on 2 pollers in HA mode.

We need to define recurring maintenance window either mute the alert or unmanage the nodes.

We can easily do a one time maintenance using the web maintenance mode, however the question comes with the need of a recurring scheduling.

pastedImage_0.png

For the time being there is still the Unmanage Scheduling Utility on the server however :

- this is an old tool not very user friendly (we need to create the task then the Windows scheduling)

- that we can't easily delegate to our user

- that need to be configured on both HA servers

pastedImage_3.png

How are managing the need of recurring maintenance windows ?

Are you still using the the old tool or have start to do something with the SDK ?

In our case the needs come from the windows update, some scheduled server reboot, planned maintenance windows.

Of course the schedule is not the same on all the server, it could depend on the team, the server role,...

I dream of an web interface like the one for the report and to be able to define the Properties, the Frequency and the Actions directly within SolarWinds web interface. (and that kind of thing we can easily delegate to our users)

pastedImage_4.png

Cheers,

Mathieu

Labels (1)
8 Replies
Level 9

I agree as well, it is a good feature to have in web console. Here is the thwack page to give a thumbs up

https://thwack.solarwinds.com/t5/SAM-Feature-Requests/Schedule-recurring-maintenance-unmanage-for-no...

Level 9

You can upvote these features:

Already done

Do you have the link to vote on this. We are running into the same problem...

Level 12

I think there might be a feature request for this out there somewhere. Yes please. You can get stuff working like this via the API/SDK but it's a pain.

Here's my attempt, meant to deal with nth tuesday/thursday windows, and with a starting data sheet. You wont have the same setup but might be able to get something useful from it, this one's not using mutes per-say but feeds into some custom properties that functionally mute the alerting. For actual mutes/unmanages it's a change in the verb at the end.

# Find Tuesdays and Thursdays

$i = 0

Do

{

    $FirstOfMonth = (Get-Date -Day 1).Date.AddDays($i)

    $Day = $FirstOfMonth.DayOfWeek

    $DayInt = [int]$Day

    $i++

}

Until($Day -eq "Tuesday")

$1stTuesday = (Get-Date -day $DayInt)

$2ndTuesday = (Get-Date -day $DayInt).Date.AddDays(7).AddHours(1)

$3rdTuesday = (Get-Date -day $DayInt).Date.AddDays(14).AddHours(1)

$4thTuesday = (Get-Date -day $DayInt).Date.AddDays(21).AddHours(1)

$i = 0

Do

{

    $FirstOfMonth = (Get-Date -Day 1).Date.AddDays($i)

    $Day = $FirstOfMonth.DayOfWeek

    $DayInt = [int]$Day

    $i++

}

Until($Day -eq "Thursday")

$1stThursday = (Get-Date -day $DayInt)

$2ndThursday = (Get-Date -day $DayInt).Date.AddDays(7).AddHours(1)

$3rdThursday = (Get-Date -day $DayInt).Date.AddDays(14).AddHours(1)

$4thThursday = (Get-Date -day $DayInt).Date.AddDays(21).AddHours(1)

#Edit spreadsheet with datetime values - 1AM

$targets = import-csv -Path 'C:\temp\Patch cycle.csv' | ForEach-Object {

    If ($_.Patchcycle -eq '1st Tuesday') {

        $_.Patchcycle = $1stTuesday

        }

    If ($_.Patchcycle -eq '2nd Tuesday') {

        $_.Patchcycle = $2ndTuesday

        }

    If ($_.Patchcycle -eq '3rd Tuesday') {

        $_.Patchcycle = $3rdTuesday

        }

    If ($_.Patchcycle -eq '4th Tuesday') {

        $_.Patchcycle = $4thTuesday

        }

    If ($_.Patchcycle -eq '1st Thursday') {

        $_.Patchcycle = $1stThursday

        }

    If ($_.Patchcycle -eq '2nd Thursday') {

        $_.Patchcycle = $2ndThursday

        }

    If ($_.Patchcycle -eq '3rd Thursday') {

        $_.Patchcycle = $3rdThursday

        }

    If ($_.Patchcycle -eq '4th Thursday') {

        $_.Patchcycle = $4thThursday

        }

        $_

}

#Connect to Solarwinds

Import-Module swispowershell

$credential = Import-CliXml -Path "C:\temp\Cred.xml"

$swis= connect-swis -hostname 'redacted' -Credential $credential

#Loop through spreadsheet, clear values, check SLW for servernames by caption, update customproperties with datetimevalues

foreach ($line in $targets){

$URI = $null

$URI = Get-SwisData $swis "Select Uri FROM Orion.Nodes Where Caption like '$($line.caption)'"

$URI = $URI+'/customproperties/'

$hashtable = @{ }

$hashtable.Add("Maintenance_window_start", "$($line.Patchcycle)")

$hashtable.Add("Maintenance_window_end", "$($line.Patchcycle.AddHours(3))")

Set-SwisObject $swis -uri $URI -properties $hashtable

}

Hi,

Thank you for your answer. So for the time being there is nothing that can easily answer to our needs.

Have you succeed with your powershell script ?

How are you executing it ? through windows task scheduler or other scheduler ?

"So for the time being there is nothing that can easily answer to our needs". - Easily is the operative word there, there's ways and means, but they're all fiddly at best. Not bad if you've got a spare developer for a bit.

Yeah the powershell's working fine on my end - I've scheduled it to run once a month in task scheduler.

I do have a remaining problem that I need to keep the list updated and I cant put other cycles into the same custom properties with this design though, so it doesnt fix everything.

I'm still hoping for a patch or someone with a nicer system to post one up on here.