I used a batch script below to restart a remote service The batch file itself uses psexec to stop / restart a remote service on another server.
@echo off
REM restarts Apache Tomcat Service
"c:\Program Files\PRTG Network Monitor\Custom Sensors\EXE\psexec" \\xxx.xxx.xxx.xxx -u Domain\User -p Password net stop "Apache Tomcat"
"c:\Program Files\PRTG Network Monitor\Custom Sensors\EXE\psexec" \\xxx.xxx.xxx.xxx -u Domain\User -p Password net start "Apache Tomcat"
pause
I do not really understand why the batch file is working properly, but I can not seem to be scheduled or executed by PRTG or Launcher.
Article Comments
I'm trying to run a batch file from the Notifications \ EXE folder and it will not work. This is a batch file that calls the PSexec program (to remotely shutdown / restart a Windows service on another machine). I put a copy of the program PSexec in Windows / System32 and if I run the command file manually from the folder Notifications / exe, it works properly
I want to run a batch file script by prtg to restart a remote service if possible to tell me the procedure in detail
Mar, 2019 - Permalink
Dear Samir,
please refer to this KB article, which addresses this inquiry.
Best regards,
Sven Roggenhofer [Paessler Technical Support]
Mar, 2019 - Permalink
Hi Samir,
Do I understand this right - you want to use PRTG to schedule a restart of a service?
Why don't you just place the script on the target system as a scheduled task?
I am not sure if PRTG can even do such a schedule - assuming I understood the request right - the Paessler support team might know this better... just trying to help out :-)
Regards
Florian Rossmark
www.it-admins.com
Mar, 2019 - Permalink