This article applies to as of PRTG 12 or later
I would like to remotely restart a Windows service on a target machine in the network of my PRTG core server. How can I do this automatically?
Automatically Restart Windows Services
This functionality is not build into PRTG by default, but you can achieve an automatic Windows service restart by using a custom script in combination with PRTG's Execute Program notification.
- Write a script that is capable of restarting the desired Windows service on the target computer.
- Adapt the script to suit your needs. You can also use placeholders. For details, please see What placeholders can I use with PRTG?
- Note: Notification scripts can only be executed on the machine running the PRTG core server, never on a Remote Probe!
- Save the script to the Notifications\EXE sub folder of your PRTG program directory. Make sure the Windows user account running your PRTG core server has sufficient rights to execute the script. By default, this is the "System" local Windows user account.
- In PRTG, create a new notification (see PRTG Manual: Account Settings—Notifications). Enable the Execute Program section and select your newly saved script. Save your settings.
- (Optional) Test the notification by clicking on the Test link in the list of notifications.
- Now you need to set a notification trigger to execute the script on a certain condition. For example, navigate to Notifications tab of a sensor, then add a trigger for the status condition Down which executes your "Execute Program" notification. The script will then be executed if the sensor changes to a red "down" status. For details about notifications triggers, please see PRTG Manual: Sensor Notifications Settings
More
Disclaimer:
The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.