New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Restart windows service

Votes:

0

Your Vote:

Up

Down

Hello,

How can I restart windows service (for example Apache) with PowerShell or batch file remotely?

batch-file powershell restart-service windows-services

Created on Jul 2, 2019 9:08:50 AM by  mlakatamitis (0) 1



3 Replies

Votes:

1

Your Vote:

Up

Down

Hi there,

For this you would need to write a script that performs this action. However you can also use the WMI Service Sensor, which allows you to automatically restart the service:
https://www.paessler.com/manuals/prtg/wmi_service_sensor

Best regards.

Created on Jul 2, 2019 11:19:31 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Dariusz,

Thanks for the help. Can I use this sensor to react when one URL is not responding? For example, one website gets a timeout after 60 sec, the sensor will restart the service.

Thanks in advance.

Created on Jul 3, 2019 8:14:29 AM by  mlakatamitis (0) 1



Votes:

1

Your Vote:

Up

Down

Hi there,

This is not the intended use case for this sensor. This sensor will constantly monitor if the service is running, if the service is detected as stopped, then PRTG tries to restart the service.

In order to restart services, via triggers, you need to write a custom script (e.g. in PowerShell). This can be added to a notification template under "Setup > Account Settings > Notification Templates > ANY NOTIFICATION > Execute Program".

Best regards.

Created on Jul 3, 2019 2:36:20 PM by  Dariusz Gorka [Paessler Support]



Please log in or register to enter your reply.


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.