Help Docs

Windows Service Automation

An IT automation tool for the Windows services running in your server. It helps to automate the start and stop of a service to ensure its continued functioning.

Use Case: Restart a Windows Service

Consider an IIS application being monitored by our Server Monitoring solution. Unexpectedly, the service becomes unresponsive. On analyzing, it is found that the memory usage of one of the sites exceeds 90%.

Problem Statement:

This slows down the application. Customers have difficulty in accessing the various sections of the app.

Solution: 

You can have a Windows Service automation configured to restart the service when the memory exceeds 90%. This can then be associated to the server monitor or the individual service.  

Add Automation

Supported from Windows agent 18.4.0 version and above. 

  1. Log in to Site24x7 and go to Admin > IT Automation Templates (+). You can also navigate via Server > IT Automation Templates (+).
  2. Select the Type of Automation as Windows Service.
  3. Provide a Display Name for identification purposes.
    Eg: in the above use, name the automation as Service Stop.
  4. Choose the Action to be Automated from the drop-down: Start, Stop, or Restart a service.
  5. Provide the complete Service Name on which the selected action should be automated.
    Eg: Kaspersky Seamless Update Service.
  6. Select the Hosts, Tags, or Monitor Groups on which you want the automation to be executed. You can select multiple hosts for parallel execution.
    You can choose $LOCALHOST to execute the automation on any host where there is a threshold violation or monitor status change. This is applicable only for server monitors (agent-based).
  7. Enter a Time-out period (in seconds) representing the maximum time period the agent has to wait for the command execution to complete. Post that, there will be a time-out error. This will be captured in the email report, if configured as Yes.
    The Time-out is set at 15 seconds, by default. You can define a time-out between 1-90 seconds.
  8. You can choose to Send an Email of the Automation Result to the user group(s) configured in the notification profile. By default, it is set to No. This email will contain parameters including the automation name, type of automation, incident reason, destination hosts, and more.
    If you've multiple automations executed in one data collection, a consolidated email will be sent.
  9. Save the changes.
Once an automation is added, schedule these automations to be executed one after the other.

Notification Profile Settings:

Configure the following settings in the notification profile:

  • Notify Down/Trouble status after executing IT automations associated to the monitor: When set to Yes, if your monitor still faces an outage even after executing the specified action, you'll be immediately alerted about the Down/Trouble status. 
  • Suppress IT Automation of dependent monitors: When the status of the dependent resource is Down, execution of the IT automation is not performed. 

Test Automation

Once you add an automation, go to the IT Automation Summary page (Server > IT Automation Templates) and use the  icon for a test run. Read more.

The test run would be applied to all the hosts selected for Windows Service action execution. An exception to this would be selection of $LOCALHOST as the only host for execution.

Click on the IT Automation Logs to view the list of automations executed by date.

Map Automation

Once the automation created is tested successfully, map them with the desired event. This can be done in two ways:

 

Related Articles

Was this document helpful?

Shortlink has been copied!