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


How to restart a windows service based on a sftp sensor state?

Votes:

0

Your Vote:

Up

Down

Hi

We currently monitor our sftp sites with the sftp sensor.

If this sensor goes down, how can I instruct PRTG to restart a specific windows service which should bring the sftp site back up?

Thanks

sftp windows-services wmi

Created on Jan 5, 2018 12:37:19 PM by  flame (50) 1 1



11 Replies

Votes:

0

Your Vote:

Up

Down

Hi Flame,

Please check out the WMI Service Sensor, as it has the ability to restart the monitored service once it goes down once. If this attempt fails, the sensor will stay in an erroneous state. Further recovery options can be configured in the recovery tab of the service itself.


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 8, 2018 9:17:52 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Stephan

Thanks for the reply, however I need PRTG to restart a service based on the state of the SFTP sensor. So in other words, if the SFTP sensor goes into error, it should trigger a service restart. How can I achieve this?

Created on Jan 8, 2018 10:07:48 AM by  flame (50) 1 1



Votes:

0

Your Vote:

Up

Down

Does the SFTP service run on a Windows server? I'm confused, because you said:


Quote from Flame:
...how can I instruct PRTG to restart a specific windows service which should bring the sftp site back up?


Since it's a Windows service you'd like to restart, you can simply create the aforementioned Windows Service sensor and let it monitor the SFTP service. It will be restarted as soon as it's stopped.


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 8, 2018 11:35:20 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

It doesnt necessarily needs to be an SFTP sensor. It can be any sensor. If the state of the sensor changes to error, is it possible to instruct prtg to restart a specific windows service?

Created on Jan 8, 2018 1:33:37 PM by  flame (50) 1 1



Votes:

0

Your Vote:

Up

Down

You'll need to monitor the corresponding service (which can be any service) with the aforementioned sensors in order for PRTG to restart it. Note that this only works on Windows hosts :)


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 8, 2018 6:44:31 PM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

I think Ive found the solution I was looking for. I will create a notification which execute a program. However, one more question. Assuming I select a powershell script, does this script need to be added to the core server where prtg is installed, or the remote probe which the device belongs to?

Created on Jan 10, 2018 7:25:04 AM by  flame (50) 1 1



Votes:

0

Your Vote:

Up

Down

Notifications are always executed on the core server. But you might be doing it the complicated way. Would you mind sharing the current setup of sensor and notification? Where the SFTP service is running, etc.?


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 10, 2018 7:35:22 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

We have an SFTP server running Windows server 2016, using copssh for external vendors to connect to our sftp site. Every now and then then the sftp folders become unavailable and users cant connect. We monitor these sites/folders with the sftp sensor and whenever it goes down, the operator on shift normally manually logs into the server and restarts a windows service.

The aim is to automate this so that if the sftp site becomes unavailable, prtg will detect this and automatically restart the service on the server.

Created on Jan 12, 2018 8:06:50 AM by  flame (50) 1 1



Votes:

0

Your Vote:

Up

Down

So, it's a dedicated application that's not really integrated as a service - correct?


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 12, 2018 8:34:54 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Yes thats correct

Created on Jan 12, 2018 8:56:59 AM by  flame (50) 1 1



Votes:

0

Your Vote:

Up

Down

The easiest way would be to use a service wrapper like winSW to turn it into a Windows service instead of an application. Then use the aforementioned WMI Service Sensor to monitor its state and metrics :)


Kind regards,
Stephan Linke, Tech Support Team

Created on Jan 12, 2018 9:06:08 AM by  Stephan Linke [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.