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

Execute Program

Votes:

0

I am trying to setup a batch file (Test10.bat) to execute when one of our sensors goes down. I created a new notification and have the following setup

program file: Test10.bat
Parameter: (blank)
Domain or Computer Name: Remote Computer Name
Username: Admin username on remote computer
Password: Admin password
Timeout: 30 

I created two batch files one that executes from the server where PRTG is installed, and one that works locally on the remote computer. Both work out of PRTG, but not when PRTG tries to execute. I also changed the PRTG CORE SERVER SERVICE from local system account to a domain admin account. Is there something missing?

custom-exe custom-script-exe notification prtg

Created on Mar 30, 2017 6:12:55 PM

Last change on Apr 3, 2017 10:35:02 AM by  Torsten Lindner [Paessler Support]



12 Replies

Votes:

0

Hello,

Thank you very much for the KB-Post. Can you please share more details, like the batch files and also the full settings for those exe/script-notifications in PRTG; so that we have the full setup?
Also, when testing this notification from PRTG, which error does PRTG state under Logs->System Events->Notifications?

best regards.

Created on Apr 3, 2017 10:36:47 AM by  Torsten Lindner [Paessler Support]



Votes:

0

The error message we receive is "Error sending "EXE": Timeout (Sensor/Source/ID: 3111/3111/3)". The batch file should execute to start up a remote registry service on the remote computer. It works out of PRTG but not within.

Created on Apr 26, 2017 3:21:47 PM



Votes:

0

Please see if the tips from the following answer do help: EXE Notifications: Aspects to Consider

Created on Apr 27, 2017 8:11:02 AM by  Torsten Lindner [Paessler Support]



Votes:

0

That seem's to got me closer to the goal. I now see "Error sending "EXE": A required privilege is not held by the client. (0x522)" in the logs. I tried researching a resolution but couldn't seem to correct the issue. Any ideas?

Created on Apr 27, 2017 2:50:42 PM



Votes:

0

Those tips did help, but now I'm getting a different error message. I am now seeing "a required privilege is not held by client" in the logs. I tried to search for a fix but I couldn't find one. Any suggestions?

Created on Apr 28, 2017 6:48:48 PM



Votes:

0

Can you share the full content of the batch files here?

Created on May 1, 2017 7:06:28 AM by  Torsten Lindner [Paessler Support]



Votes:

0

The batch file on the server does this:

"psexec
user-PC "C:\users\user\prtgtesting\test10.bat" Pause"

The test10.bat does this: "start "" /b "C:\Users\user\Desktop\test.lnk" Pause"

test.lnk is a shortcut that will always run as administrator. The shortcut runs the test.bat and it has the following: "sc start remoteregistry Pause"

Hope this is what you were asking for.

Created on May 1, 2017 11:46:15 AM



Votes:

0

It may still be a permissions issue here, even though the Core Service is running under an admin account. Can you check, if it is possible to write the output of the psexec-call into a file? To see if it fails there. So that you can try filling the call also with admin-credentials for a test.

Created on May 2, 2017 8:36:11 AM by  Torsten Lindner [Paessler Support]



Votes:

0

I'm not entirely sure what you mean? Do you want me to not put an account to it requests it?

Created on May 2, 2017 5:50:33 PM



Votes:

0

I apologise for the confusion. I suspect that currently the account used, doesn't have sufficient permissions for the call, and that getting the script to write debug output into a file (most importantly the response / exit code from the psexec call) may help to show why it fails exactly.

Created on May 3, 2017 7:01:59 AM by  Torsten Lindner [Paessler Support]



Votes:

0

I am using the same credentials on the client computer and in PRTG. I am also able to execute the ".bat" file without PRTG and it works with no issues. How do I get the batch files to create a exit code for review?

Created on May 3, 2017 11:58:12 AM



Votes:

0

Please be aware that we only provide technical support for PRTG (i.e. 'stuff does not work' or 'how does this stuff work') itself. There is only limited support for customising of PRTG. This includes custom sensors, as well as custom notifications, customising on PRTG's Webserver files, and also custom map objects.
There obviously is a difference when PRTG executes the script vs. when you execute it. Bear in mind, PRTG runs as a service, and not in a "desktop session" that you may have used when testing the script.
The error message indicates it's a permissions issue. You need to research if the psexec-call has an error response / output, and if you can divert this into a file with simple things like:

>> c:\debug.txt

Created on May 4, 2017 7:22:37 AM by  Torsten Lindner [Paessler Support]




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.