Event Handlers in Plesk
By Jithin on September 22nd, 2016
Event handlers are intended to help you get warnings about Plesk occasions. The most run of the mill approach to utilizing them is as per the following: you make a script to be executed upon a specific Plesk event, and afterward, you relate the event, and your script is utilizing an event handler. Every time the occasion occurs, the event handler will trigger your script. You can likewise relate event handlers with a framework charge or a double document. There are two truths to consider before you begin utilizing occasion handlers:
1) Event handlers trigger directions for the benefit of the Plesk admin.
2) Event handlers have data around a related Plesk object “before” and “after” an event.
At the point when an event happens, event handlers get the event subtle elements, and you can utilize these points of interest in your guidelines. For instance, you can acquire the IP address which was included by the “including an IP address” event. The event points of interest are passed to your guidelines as environment variables.
Running scripts via event handlers
For instance, we should store the names of new clients on the document framework. To do this, first, we ought to discover nature variable that contains the contact name. This variable is recorded in the Administrator’s Guide, Appendix > Customer account created. As should be obvious, the variable name is NEW_CONTACT_NAME. At the moment, we have to make an event handler.
To create the event handler via Plesk
1) Sign into Plesk. Go to the Tools and Settings tab > Event Manager.
2) Click Add New Event Handler and indicate the following:
Event. Select Customer Account Created from the menu.
Priority. Leave set to least (0).
User. Leave set to root.
Command. Indicate the way the shell script was during step one (for instance,/tmp/write-names.sh).
3) Click OK.
The event handler will be set off each time another client record is made and will compose the client’s contact name to the predetermined document.
If you need any further assistance please contact our support department.