What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

PRTG and PsExec

Votes:

0

I'm trying to have PsExec run as an executable to re-start a a process on a remote computer when the monitored process has gone down. But I get an EXE timeout error in the PRTG log.

This is what I have in my parameter - I am wondering: Does the \\ (double backslash) in front of the %device variable have any impact that would cause it to not run properly?

\\%device  -u domain\myaccount -p mypassword -d -i 0 "C:\Program Files\My Program\My_App.exe"

So normally from a command prompt I can successfully run:

PsExec.exe \\remotepc -u domain\myaccount -p mypassword -d -i 0 "C:\Program Files\My Program\My_App.exe"

But when I try to launch from PRTG it does not appear to be successful.

Regards,

Matt

custom-exe custom-notification prtg

Created on Jul 20, 2010 5:18:11 PM

Last change on Jul 21, 2010 10:54:21 AM by  Daniel Zobel [Product Manager]



Best Answer

Accepted Answer

Votes:

1

With PTF Launcher, yes you can

PTF launcher is a Custom Notification that can launch external applications. PRTG Server runs as a service and therefore cannot start applications that interact with the desktop. With PTF Launcher, this is no longer an issue.

The download includes two .exe files:

  • Launch.exe is the Custom Notification and needs to be copied to the \Notifications\EXE subfolder of your PRTG installation.
  • Launcher.exe is a system tray application that needs to be started on your PRTG server. The Launch.exe Custom Notification parses the details of the external application that needs to be started to the Launcher.exe tray application that actually starts the external application.
  • For the launcher application to work, a user must always be logged into the computer running your PRTG Server.

More details

Created on Jul 24, 2010 3:27:41 PM

Last change on May 28, 2014 4:07:10 PM by  Gerald Schoch [Paessler Support]



13 Replies

Votes:

0

Dear Matthew,

there might be two reasons why this won't work from PRTG:

  • The account PRTGs services run under. By default it's the "LOCAL SYSTEM" account, which usually does not have the same permissions as a normal (admin) user. Thus PRTG may not be allowed to access the Remote PC or the path.
  • Also due to the fact that PRTG runs as a service, it cannot open/start anything which does open a window. If PSexec or your application 'myapp' should open or try to open a window, it won't work as well.

Best Regards.

Created on Jul 21, 2010 11:19:08 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Thanks for your reply Torsten,

I tried using a different account for the PRTG Core Server service that has local administrator rights. That didn't help unfortunately.

I also tried in putting the %device in quotation marks as a long shot, but still no luck.

I think if we can solve this it's a very nice solution to what PRTG already has in place for 'services' (ability to restart), but does not currently have for 'processes'.

PSexec is a commmand line app which I think should work in a hidden manner on the PRTG server. The remote PC where the 'myapp' opens is what needs to occur interactively on that remote node only. I don't think this should be a problem.

Example of how it runs from a cmd line on the PRTG server if I do it manually:

C:\>psexec \\remotepc1 -u domain\username -p mypassword -d -i 0 notepad

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

notepad started on remotepc1 with process ID 9172.

C:\>

Any other suggestions greatly appreciated.

Created on Jul 21, 2010 11:29:15 AM

Last change on Jul 21, 2010 2:04:00 PM by  Daniel Zobel [Product Manager]



Votes:

0

Dear Matthias,

notepad.exe is definitely a windowed application, so it works when you tried it manually but not if you would try it from PRTG. We would suggest to try testing with a batch-file which then "prints" the parameters into a textfile, so that you could see if they come out the way you need them for PSexec.

Created on Jul 21, 2010 11:47:48 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Notepad itself does not open up on the PRTG server, it appears on the remote workstation only. From PRTG's perspective, it would only see the text as follows:

C:\>psexec remotepc1 -u domain\username -p mypassword -d -i 0 notepad

PsExec v1.98 - Execute processes remotely Copyright (C) 2001-2010 Mark Russinovich Sysinternals - www.sysinternals.com

notepad started on remotepc1 with process ID 9172.

C:\>

Do you have an example for the batch-file suggestion? I'd like to try it.

Created on Jul 21, 2010 12:00:49 PM

Last change on Jul 21, 2010 2:02:56 PM by  Daniel Zobel [Product Manager]



Accepted Answer

Votes:

1

With PTF Launcher, yes you can

PTF launcher is a Custom Notification that can launch external applications. PRTG Server runs as a service and therefore cannot start applications that interact with the desktop. With PTF Launcher, this is no longer an issue.

The download includes two .exe files:

  • Launch.exe is the Custom Notification and needs to be copied to the \Notifications\EXE subfolder of your PRTG installation.
  • Launcher.exe is a system tray application that needs to be started on your PRTG server. The Launch.exe Custom Notification parses the details of the external application that needs to be started to the Launcher.exe tray application that actually starts the external application.
  • For the launcher application to work, a user must always be logged into the computer running your PRTG Server.

More details

Created on Jul 24, 2010 3:27:41 PM

Last change on May 28, 2014 4:07:10 PM by  Gerald Schoch [Paessler Support]



Votes:

0

Very close now but I'm seeing the following error (my PRTG server runs on 2008 R2 64-bit):

C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE>launch -s=notepad. exe Could not load file or assembly 'AliasAccount, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Do you have any thoughts on what this could be?

Created on Aug 21, 2010 9:38:56 AM



Votes:

0

Hi Matthew,

This error was caused by the fact that a required DLL was not merged into the executable before it was published.

This is now fixed in version 1.0.3 of PTF Launcher.

There are also two enhancements in version 1.0.3:

  • Errors of both the Launch notification and the Launcher application are now written into the machine's event log.
  • Added a parameter to activate 1 of 2 relays connected to the comport of the machine running the Launcher application, allowing you to sound a siren, flash a warning light or ....
-io=4,7,1 will activate the relay connected to pin 7 on comport 4.
-io=4,7,0 will deactivate the relay connected to pin 7 on comport 4.
-io=4,7,1,5 will activate the relay connected to pin 7 on comport 4 for 5 seconds.

The illustration below shows you how to wire the comport on the target machine:

Note: the illustration above is for demonstration purposes only and although it will work, it is always better to use an optocoupler, protecting your comport.

Created on Aug 24, 2010 2:29:53 PM

Last change on Aug 25, 2010 9:25:59 AM by  Patrick Hutter [Paessler Support] (7,225) 3 3



Votes:

0

Thanks all. This has been resolved and is a great success for us here. For anyone that is interested, this is the final script i ended up using:

-s=cmd -a=/K C:\PsExec.exe
%host -u domain\username -p password -i 0 C:\Progra1\example\run.exe

I had a small problem with using quotation marks around the path, but used an the older 8 character path as above to workaround it. Seems PRTG did not parse the " " marks properly. No problem though, workaround is good enough for me.

Thanks again.

Matt

Created on Aug 27, 2010 11:25:17 AM



Votes:

0

We really like PTF Launcher, Thanks!

I'm having a problem, everytime it runs, the follow error pops up: Image description

The event log contains an error with the same message, as well as error files being created in C:\PTF.Launch

This is the command I'm running: -k=proofcreator -u=domain\test1 -p=h:2rddfdfdfasdfsf== -c=server1.domain.com -s=cmd -a=/C del %temp%\srvOutput\*.indd /F /Q

Any help would be appreciated. Thanks

Created on Sep 10, 2010 4:14:22 PM



Votes:

0

Hi Benjamin,

I managed to reproduce the "-io parameter not wellformatted" issue.

This is now fixed in version 1.0.4 of PTF.Launch.

The message folder with this version is moved one folder deeper from c:\PTF.Launch to c:\PRTG Tools Family\PTF.Launch, making room for another tool that is also going to use this folder structure

Please download the update from here

Created on Sep 12, 2010 12:45:38 PM

Last change on Apr 27, 2012 12:51:20 PM by  Manischa Mittal [Paessler Support]



Votes:

0

Hey all,

I have problem with sending. I use PTF launcher, and the command I'm running: s-Gnokii.bat a-[%sitename] %device %name %status %down (%message)

log status say: Sending : OK but I don't get an SMS.

This is my batch file

echo "%1 %2 %3 %4 %5 %6" | "E:\Program Files\PRTG Network Monitor\Notifications\EXE\gnokii.exe" --config gnokiirc --sendsms +316******--smsc +316*****

Created on Dec 10, 2010 8:08:11 AM

Last change on Dec 10, 2010 1:34:51 PM by  Daniel Zobel [Product Manager]



Votes:

0

i have a simlar problem with launch.exe

i try to start it like this

-s=c:\admin\scripts\restart_remote_service.cmd -a=%host W3SVC

and the restart_remote_service.cmd contains:

c:\admin\sysinternals\PsExec.exe
%1 -u USER -p * net stop "%2" c:\admin\sysinternals\PsExec.exe
%1 -u USER -p * net start "%2"

the script, when run from the command line works, but started with launch.exe (tested from the command line) does nothing..

Created on Dec 14, 2010 1:48:06 PM



Votes:

0

Could you please try -a="%host W3SVC"

Created on Dec 14, 2010 2:52:59 PM




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.