The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q & A: How Do I Turn Off Service Protector During Scheduled Maintenance?

Q & A
  Wanted to know if there’s a way for Service Protector to not monitor a service during a patching period of time? Or any scheduled period of time without sending a million alerts?

— Mark @ Red Roof Inns

Hi Mark. Apologies for the barrage of unnecessary emails! Unfortunately Service Protector doesn’t know that it is OK for your service to be down while you are patching. It is diligently doing its job.

To avoid the false alarms, we recommend shutting down Service Protector at the start of your maintenance window and reactivating it once patching has concluded. These operations can be performed from the Service Protector GUI or with the standard Windows NET command.

You see, Service Protector creates a Windows Service for each service it monitors. If your service is named “MyService”, then Service Protector creates a service called “ServiceProtector: MyService” to watch your target service. Here is what it looks like for the “Print Spooler” service on our Windows Server 2016 machine:

Note that the service name may not be the same as the friendly “display name” you see in Service Protector (and Services.msc). For example, the service name of the “Print Spooler” service is actually “Spooler”:

This post shows how to find the service name.

How to Stop Protection at the Start of Maintenance

  • Stopping From the GUI

    Select Stop <ServiceName> from the Protector menu. This will shut down Service Protector but will leave your target service running:

    Stop Protecting your Windows Service

  • Stopping From the Command Line

    This command will stop the instance of Service Protector monitoring a service named “MyService”:

    NET STOP “ServiceProtector: MyService”

    Here is what the process looks like for the Spooler service:

    Run NET STOP

    Simply run the NET STOP command before patching starts.

How to Restart Protection at the End of Maintenance

  • Starting From the GUI

    Select Start <ServiceName> from the Protector menu. This will fire up Service Protector — and your target service if it’s idle:

    Start Protecting your Windows Service

  • Starting From the Command Line

    A slightly different version of the NET command will restart the instance of Service Protector monitoring a service named “MyService”:

    NET START “ServiceProtector: MyService”

    Restarting protection for the Spooler service looks like this:

    Run NET START

    Run the NET START command once your system is back to normal.

How to Stop and Restart Service Protection Automatically

For patching that occurs at a defined time, we recommend using the Windows Task Scheduler to automate the process. Create a pair of scheduled tasks — one to stop protection and the other to restart it.

For example, if maintenance occurs every Saturdays from 1 AM to 3 AM, your first scheduled task could run NET STOP at 12:59 AM. The second task could be configured to run NET START at 3:01 AM.

Posted in Service Protector | Tagged , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *