Hello,
we have a Windows Service which was not running and PRTG detected that correctly - however the sensor is configured that it should restart the service, which has not been done and thats why an IT Admin had to interact and restart the service on the server.
Is there any way how to find out why PRTG couldnt restart the service?
The only difference i could find between services which have been successfully restarted by PRTG is that this service has dependencies configured to other services - but both of these services were running on which it is depending.
Is there any way to configure PRTG that it is able to restart this service or is this simply not possible?
Article Comments
Hello Daniel,
Thank you for your message.
When the WMI service sensor is configured to restart the service, PRTG executes a query on the target device which might indeed fail if Windows prevent for example to restart services dependent on others.
If this is the case, I'm afraid that it is not possible to modify the sensor to force the restart of the service. In such case, you could use a custom script within a notification template by using the Execute Program method. For example, you could use the following PowerShell command to restart a service with dependencies:
Get-Service -ComputerName computername -Name servicename | Restart-Service -force
In order to use the script within the template, the latter must be stored under "C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE" on the PRTG server.
If you have questions, do not hesitate.
Regards.
Aug, 2022 - Permalink
Hello Daniel,
Thank you for your message.
When the WMI service sensor is configured to restart the service, PRTG executes a query on the target device which might indeed fail if Windows prevent for example to restart services dependent on others.
If this is the case, I'm afraid that it is not possible to modify the sensor to force the restart of the service. In such case, you could use a custom script within a notification template by using the Execute Program method. For example, you could use the following PowerShell command to restart a service with dependencies:
Get-Service -ComputerName computername -Name servicename | Restart-Service -force
In order to use the script within the template, the latter must be stored under "C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE" on the PRTG server.
If you have questions, do not hesitate.
Regards.
Aug, 2022 - Permalink