Event handlers in Plesk help to receive notifications about Plesk events. It helps to run scripts whenever certain events occur in Plesk. When a script was created and need to be executed upon a certain Plesk event, then the event handler can associate both the event and the script. Whenever the event happens, the event handler will trigger the script. When an event occurs, the event details will be received by the event handlers and those details can be used in the instructions.

The event handlers can also be associated with a system command or a binary file and not only on a script. It can trigger the instructions on behalf of the Plesk administrator. These handlers have information about a related Plesk object on both “before” and “after” an event.

Event handlers can be managed by via command line interface or the Plesk GUI. The utility event_handler can be used to manage the event handlers when using with the command line. This utility can be used to create, update, remove and lists all the handlers and their settings. It also lists the events that trigger event handlers and also the users on behalf of which scripts defined in the event handler settings are executed.

To create event handler via Plesk, follow the below steps

Step 1: Login to Plesk and Go to Tools and Settings

Step 2: Click the option ‘Event Manager’

Step 3: Click the option ‘Add New Event Handler’

Step 4: Select the event, priority, user and set the command. Then click OK.

Categorized in:

Tagged in:

,