How do you use cloud databases? Take the survey.
Options

How can I set/edit/remove a maintenance window from a command line?

I've been surprised to find that SQL Monitor doesn't have an API for anything other than adding monitored entities. My company doesn't always conduct maintenance at the exact same time/dates every week, so we want to be able to start and stop maintenance windows on the fly without using the web GUI.

I have been digging through the Redgate directory, and I have found many things related to what I'm looking for, but I have yet to find the silver bullet. The editMaintenanceWindowUrl doesn't seem to respond to my web requests despite the JavaScript appearing to do exactly that in order to set/remove maintenance windows (at least as far as I can tell with my limited knowledge on this subject). And I can't seem to find any file that contains the maintenance window settings.

Is there any way to accomplish this or is this quest hopeless?

Thanks!
Tagged:

Answers

  • Options
    There isn't, currently I'm afraid. We do want to introduce more of an API but its a long way off yet.
    Have you visited our Help Centre?
  • Options
    ScottForrestScottForrest Posts: 1 New member
    I've been surprised to find that SQL Monitor doesn't have an API for anything other than adding monitored entities. My company doesn't always conduct maintenance at the exact same time/dates every week, so we want to be able to start and stop maintenance windows on the fly without using the web GUI.

    I have been digging through the Redgate directory, and I have found many things related to what I'm looking for, but I have yet to find the silver bullet. The editMaintenanceWindowUrl doesn't seem to respond to my web requests despite the JavaScript appearing to do exactly that in order to set/remove maintenance windows (at least as far as I can tell with my limited knowledge on this subject). And I can't seem to find any file that contains the maintenance window settings.

    Is there any way to accomplish this or is this quest hopeless?

    Thanks!
    Hi,

    We have the same issue. I've taken to creating a PowerShell script that updates the database to 'switch on' maintenance mode for a list of monitored instances. It's not perfect, and still needs some work but it's a start.

    FYI - The database tables involved are the settings.clusters & settings.servers and the key columns are the MW_IsEnabled, MW_Start, MW_Duration and the day column. Not too sure what the policy is on sharing scripts on here? 

    Redgate people - is there any plan to add this functionality into the powershell API? Would be great to pass a list of servers to a cmdlet and to invoke maintenance mode.

    Cheers,
    Scott


  • Options
    No current plans to extend the API to this I'm afraid, but if you can please post this on the sql Monitor uservoice: https://sqlmonitor.uservoice.com/forums/91743-suggestions/.

    Have you visited our Help Centre?
Sign In or Register to comment.