Hi, I have an issue with one server that I can prevent when a certain service remains in a stopped state. I would like to be alerted as soon as that service is started (or even better, have PRTG act and stop it again), so I can stop it again to prevent issues on the server. How can I have PRTG alert me whenever the service is in a running state (rather than the more logical stopped state)?


Article Comments

Hello,

Thank you very much for using PRTG. It is not possible to invert the Service Sensor itself. You can use a work around via the Sensor Factory though, by having it just display the values of the original sensor (as channel definition), and using the following custom Status Formula:

10000 - status(id_of_the_source_sensor)

best regards.


Oct, 2017 - Permalink

Hi, You might want to have a look at the ServiceStatus sensor.

This sensor retrieves the status of a Windows service and returns a numeric value (see table below)
Using limits, you can set the sensor to an Error or Warning state when the service is started.

0Not Installed
1Stopped
2Start Pending
3Stop Pending
4Running
5Continue Pending
6Paused Pending
7Paused

Oct, 2017 - Permalink

Works like a charm, thanks.
For others,
EXE/Script: ServiceStatus.exe

as Parameters I have (Warning is 4 and Error 3, 1 is deemed good (Service is not running in that case 1:OK is the output)):
-s="Service Name" -m=SERVERNAME -w=4 -e=3
e.g.
-s="SMS Agent Host" -m=EURSERV003 -w=4 -e=3

The notification is set to:
When Value (#) channel is Not Equal to 1 for at least 60 seconds perform [your notification here]


Nov, 2017 - Permalink