PRTG Manual: Custom Notifications

In addition to the various standard methods for notifications, you can also define your own notifications that can trigger desired actions. The possibilities of these notifications go far beyond just sending out messages, because you can perform almost any action you like whenever the notification is triggered.

The following documentation describes these custom notifications. Different notification methods can also be combined in one notification.

icon-book-arrowsFor more general information about notifications based on email, messaging, and others, see section Notifications.

Execute HTTP Action

This notification method executes a GET request or sends any POST, PUT, or PATCH data to a custom URL. You can execute specific actions on a web server or control any web service that accepts commands via one-time HTTP requests. Whenever a notification of this kind is triggered, the HTTP action is sent.

With this method, you can also call any API function of the PRTG web interface. For example, you can set PRTG to automatically pause a sensor, or acknowledge an alarm.

icon-i-round-redAuthentication with username and passhash (or username and password) must always be included in each PRTG API request. See section Authentication for more information.

icon-speechExamples

To automatically pause the sensor that triggers the notification, enter the following HTTP action:

http://yourserver/api/pause.htm?id=%sensorid&action=0&username=myuser&password=mypassword

To use the notification to automatically acknowledge the alarm that triggered it, enter this HTTP action:

http://yourserver/api/acknowledgealarm.htm?id=%sensorid&ackmsg=Auto-Acknowledged&username=myuser&password=mypassword

icon-book-arrowsFor more information about authentication within the URL and for other possible actions you can configure, see sections HTTP API and Object Manipulation.

Execute Program

With this notification method, you can execute a script or a program as an external process. It can be a Windows executable file or a BAT, CMD, or PowerShell file. You can use EXE, COM, BAT, CMD, VBS, or PS1 files.

icon-i-round-redYou must create the notification as a file and place it in a specific folder on the PRTG core server system (in a cluster, copy the files to every node).

Place executables (.EXE, .COM), batch files (.CMD, .BAT), VBS scripts (.VBS), or PowerShell scripts (.PS1) into the folder:

\Notifications\EXE

As soon as a file is placed into the folder, you can create or edit your own custom execute program notification and select the new file from the list of files. You can also enter start parameters and use PRTG placeholders for this.

Notes

  • PRTG will execute the file on the local PRTG core server system using the account configured for the PRTG core server service ("system" is the default).
  • If your custom notifications code relies on other files (for example, DLLs, .NET framework, or Windows PowerShell), you must copy/install these files on the PRTG core server machine manually!
  • Make sure the return code of the executable is 0 (zero). Otherwise PRTG assumes something went wrong with the notification and will try to send it up to 3 times.
  • When running PRTG in a cluster, copy the respective files to every single node to make sure the notification also works when the primary master is not reachable.
  • EXE notifications will fail if they attempt to open any graphical user interface windows using the Win32 APIs (this is not allowed for processes that are started by a system service).

Placeholders

icon-book-bulbFor more information about the placeholders you can use, see the Paessler Knowledge Base What placeholders can I use with PRTG?

PRTG Script World

Find useful scripts for custom notifications in the PRTG Script World, written by dedicated PRTG customers around the world and Paessler!

More

icon-book-bulbFor more information about custom notifications, see the Paessler Knowledge Base, tag-set "custom-notification".

 

Application Programming Interface (API) Definition—Topics