This article applies to PRTG Network Monitor 12 or later, as well as to previous (deprecated) versions
Why doesn't my PRTG notification execute a batch file when triggered? I selected the batch file and left the parameter field blank, but nothing happens during testing.
EXE Notifications: Aspects to Consider
For custom EXE notifications there are some aspects you must be aware of:
- The EXE (or batchfile) will be executed in the security context of the "PRTG Core Server" service. By default, this is the SYSTEM account. For the system account, interactive EXEs or batches are not allowed. You may need to set the account for the "PRTG Core Server" service to a different user account, but this account should have local admin rights. You can change the account running this service in the Windows Computer Management console ("Services").
- If your custom code relies on other files (e.g., DLLs, .NET framework, Windows PowerShell, etc.), you must copy/install these files onto the machine running your PRTG Core Server manually!
- To check your notification, use the Test link of the respective entry in the notifications list in the web interface under Setup | Account Settings | Notifications. This should run your Batch or EXE every time. If not, something is wrong.
- If you use powershell scripts: With Windows' default security settings for powershell scripts, your script must be digitally signed. Information about signing powershell scripts and the Execution Policyfor scripts can be found in the following external resources:
- Make sure to always use full paths in the batch file.
- The notification script cannot open any windowed application and cannot be a windowed application itself. This is not possible because PRTG runs as a service.
- Use " " or ' ' to encapsulate parameters to EXE/script notifications (in the parameters fields in PRTG).
- For Powershell notifications, bear in mind, it depends on which version (32bit or 64bit) of the PRTG Core Service is running, if either the 32bit or the 64bit Powershell are used.
A few more tips for batch-notifications:
- Make sure to always use full paths in the batch file.
- The notification-script can't open any windowed application or can't be a windowed application itself, this is not possible as PRTG runs as a service.
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.