Web Hosting and Dedicated Servers Australia

Australian Hosting

 
Home
Using Event Manager
Written by Website Tutorials   
Wednesday, 14 June 2006
The Event Manager is designed to help you organize data interchange between Plesk and external systems. It works the following way: you create a file to be executed upon a certain control panel event, and then create an event handler that triggers the event processing. You can assign several handlers to a single event.

Adding an Event Handler

For instance, let's create an event handler for the 'client account creation' event. The handler will accept a client name as the first parameter, and the client's login as the second. For simplicity we will use a batch file called test-handler.bat that looks as follows:

----------------------------------------------------------------------
echo "--------------" >> c:\windows\temp\event_handler.log
rem information on the event date and time
date /T   >> c:\windows\temp\event_handler.log
rem information on the created client account
echo "client created" >> c:\windows\temp\event_handler.log
rem client's name
echo "name: %1"       >> c:\windows\temp\event_handler.log
rem client's login
echo "login: %2"      >> c:\windows\temp\event_handler.log
echo "--------------" >> c:\windows\temp\event_handler.log
----------------------------------------------------------------------

This script prints some information to a file so that we could control its execution.

Suppose, that our script is located in the directory c:\program files\swsoft\plesk\scripts\. Let's register it by creating an event handler via the control panel:

  1. Select the Server shortcut in the navigation pane.

  2. Click the Event Manager icon on the Server administration page. The Event Manager page appears.

  3. Click the Add New Event Handler icon. The event handler setup page appears:

  4. Select the event, you wish to assign a handler to in the Event drop-down box.

  5. Select the priority for handler execution, or specify a custom value. To do this, select custom in the Priority drop-down list and type in the value. Note, when assigning several handlers to a single event you can specify the handler execution sequence, setting different priorities (higher value corresponds to a higher priority).

  6. Select the system user, on behalf of which the handler will be executed.

  7. In the Command input field, specify the path to a file to be executed upon the selected event. In our example it is "c:\program files\swsoft\plesk\scripts\test-handler.bat" <new_contact_name> <new_login_name>

    Note that if directory names or the file name contains spaces, the path should be quoted.

  8. Click OK.

Now if you login to your Plesk control panel and create a new client, specifying the value 'Some Client' in the 'Contact name' field, and 'some_client' in the field 'Login', the handler will be invoked, and the following records will be added to the c:\windows\temp\event_handler.log:

--------------
	Sat Jun 26 21:46:34 NOVT 2004
	client created
	name: Some client
	login: some_client
	--------------

If you want to specify one or few handlers more, repeat the actions above for another handler.

Removing Event Handlers

In order to remove one or several event handlers, in the list of handlers select the corresponding checkboxes and click Remove selected.

Available Event Handler Parameter Templates

The parameter templates that can be used when setting up an event handler are presented in the table below:

2.1.

Component name/descriptionCommand line parameterNotes
Old component valueNew component value
For the events 'Client account created', 'Client account updated', 'Client account removed'
Login Nameold_login_namenew_login_namerequired
Contact Nameold_contact_namenew_contact_namerequired
Company Nameold_company_namenew_company_name 
Phoneold_phonenew_phone 
Faxold_faxnew_fax 
E-mailold_emailnew_email 
Addressold_addressnew_address 
Cityold_citynew_city 
State/Provinceold_state_provincenew_state_province 
Postal/ZIP Codeold_postal_zip_codenew_postal_zip_code 
Countryold_countrynew_country 
For the events 'Domain created', 'Domain updated', 'Domain deleted'
Domain Nameold_domain_namenew_domain_namerequired
For the events 'Subdomain created', 'Subdomain updated', 'Subdomain deleted'
Subdomain Nameold_subdomain_namenew_subdomain_namerequired
Parent Domain Nameold_domain_namenew_domain_namerequired
FTP accountold_system_user_typenew_system_user_type 
Subdomain owner's login nameold_system_usernew_system_user 
Hard disk quotaold_hard_disk_quotanew_hard_disk_quota 
SSI supportold_ssi_supportnew_ssi_support 
PHP supportold_php_supportnew_php_support 
CGI supportold_cgi_supportnew_cgi_support 
Perl supportold_mod_perl_supportnew_mod_perl_support 
Python supportold_mod_python_supportnew_mod_python_support 
ColdFusion supportold_coldfusion_supportnew_coldfusion_support 
Apache::ASP supportold_apache_asp_supportnew_apache_asp_support 
SSL supportold_ssl_supportnew_ssl_support 
For the events 'Physical hosting created', 'Physical hosting updated'
Domain Nameold_domain_namenew_domain_namerequired
IP Addressold_ip_addressnew_ip_address 
IP Typeold_ip_typenew_ip_type 
System Userold_system_usernew_system_user 
System User Passwordold_system_user_passwordnew_system_user_password 
Shell Accessold_system_shellnew_system_shell 
Microsoft FrontPage Supportold_fp_supportnew_fp_support 
Microsoft FrontPage over SSL Supportold_fpssl_supportnew_fpssl_support 
Microsoft FrontPage Authoringold_fp_authoringnew_fp_authoring 
Microsoft FrontPage Admin Loginold_fp_admin_loginnew_fp_admin_login 
Microsoft FrontPage Admin Passwordold_fp_admin_passwordnew_fp_admin_password 
SSI Supportold_ssi_supportnew_ssi_support 
PHP Supportold_php_supportnew_php_support 
CGI Supportold_cgi_supportnew_cgi_support 
Mod Perl Supportold_mod_perl_supportnew_mod_perl_support 
Apache ASP Supportold_apache_asp_supportnew_apache_asp_support 
SSL Supportold_ssl_supportnew_ssl_support 
Web Statisticsold_web_statisticsnew_web_statistics 
Custom Error Documentsold_apache_error_documentsnew_apache_error_documents 
Hard Disk Quotaold_hard_disk_quotanew_hard_disk_quota 
For the event 'Physical hosting deleted'
Domain Nameold_domain_namenew_domain_namerequired
For the events 'Mail name created', 'Mail name deleted'
Mail nameold_mailnamenew_mailnamerequired (in the format mailname@domain)
For the event 'Mail name updated'
Mail nameold_mailnamenew_mailnamerequired (in the format mailname@domain)
Mailboxold_mailboxnew_mailbox 
Passwordold_passwordnew_password 
Mailbox Quotaold_mailbox_quotanew_mailbox_quota 
Redirectold_redirectnew_redirect 
Redirect Addressold_redirect_addressnew_redirect_address 
Mail Groupold_mail_groupnew_mail_group 
Autorespondersold_autorespondersnew_autoresponders 
Mail User Control Panel Accessold_mail_controlpanel_accessnew_mail_controlpanel_access 
For the event 'Web user deleted'
Domain Nameold_domain_namenew_domain_namerequired
Web user Nameold_webuser_namenew_webuser_namerequired
For the events 'Web user created', 'Web user updated'
Domain Nameold_domain_namenew_domain_namerequired
Web User Nameold_webuser_namenew_webuser_namerequired
Web User Passwordold_webuser_passwordnew_webuser_password 
SSI Supportold_ssi_supportnew_ssi_support 
PHP Supportold_php_supportnew_php_support 
CGI Supportold_cgi_supportnew_cgi_support 
Mod Perl Supportold_mod_perl_supportnew_mod_perl_support 
Mod Python Supportold_mod_python_supportnew_mod_python_support 
Apache ASP Supportold_apache_asp_supportnew_apache_asp_support 
Hard Disk Quotaold_hard_disk_quotanew_hard_disk_quota 
For the event 'Client limits updated'
Contact Nameold_contact_namenew_contact_namerequired
Maximum Number of Domainsold_maximum_domainsnew_maximum_domains 
Maximum Amount of Disk Spaceold_maximum_disk_spacenew_maximum_disk_space 
Maximum Amount of Trafficold_maximum_trafficnew_maximum_traffic 
Maximum Number of Web Usersold_maximum_webusersnew_maximum_webusers 
Maximum Number of Databasesold_maximum_databasesnew_maximum_databases 
Maximum Number of Mailboxesold_maximum_mailboxesnew_maximum_mailboxes 
Mailbox Quotaold_maximum_mailbox_quotanew_maximum_mailbox_quota 
Maximum Number of Mail Redirectsold_maximum_mail_redirectsnew_maximum_mail_redirects 
Maximum Number of Mail Groupsold_maximum_mail_groupsnew_maximum_mail_groups 
Maximum Number of Mail Autorespondersold_maximum_mail_autorespon dersnew_maximum_mail_autorespon ders 
Maximum Number of Mailing Listsold_maximum_mail_listsnew_maximum_mail_lists 
Maximum Number of Java Applicationsold_maximum_tomcat_web_appli cationsnew_maximum_tomcat_web_appli cations 
Expiration Dateold_expiration_datenew_expiration_date 
For the event 'Domain limits updated'
Domain Nameold_domain_namenew_domain_namerequired
Maximum Amount of Disk Spaceold_maximum_disk_spacenew_maximum_disk_space 
Maximum Amount of Trafficold_maximum_trafficnew_maximum_traffic 
Maximum Number of Web Usersold_maximum_webusersnew_maximum_webusers 
Maximum Number of Databasesold_maximum_databasesnew_maximum_databases 
Maximum Number of Mailboxesold_maximum_mailboxesnew_maximum_mailboxes 
Mailbox Quotaold_maximum_mailbox_quotanew_maximum_mailbox_quota 
Maximum Number of Mail Redirectsold_maximum_mail_redirectsnew_maximum_mail_redirects 
Maximum Number of Mail Groupsold_maximum_mail_groupsnew_maximum_mail_groups 
Maximum Number of Mail Autorespondersold_maximum_mail_autorespon dersnew_maximum_mail_autorespon ders 
Maximum Number of Mailing Listsold_maximum_mail_listsnew_maximum_mail_lists 
Maximum Number of Java Applicationsold_maximum_tomcat_web_appli cationsnew_maximum_tomcat_web_appli cations 
Expiration Dateold_expiration_datenew_expiration_date 
For the events 'Mailing list created', 'Mailing list updated', 'Mailing list deleted'
Domain Nameold_domain_namenew_domain_namerequired
Mailing list nameold_mail_list_namenew_mail_list_namerequired
Mailing list enabledold_mail_list_enablednew_mail_list_enabled 
For the events 'Control panel user logged in', 'Control panel user logged out'
Contact Nameold_contact_namenew_contact_name 
For the event 'Domain user account updated'
Allow domain user accessold_allow_domain_user_accessnew_allow_domain_user_access 
Login Nameold_login_namenew_login_namerequired
Domain Nameold_domain_namenew_domain_namerequired
Contact Nameold_contact_namenew_contact_name 
Company Nameold_company_namenew_company_name 
Phoneold_phonenew_phone 
Faxold_faxnew_fax 
E-mailold_emailnew_email 
Addressold_addressnew_address 
Cityold_citynew_city 
State/Provinceold_state_provincenew_state_province 
Postal/ZIP Codeold_postal_zip_codenew_postal_zip_code 
Countryold_countrynew_country 
For the events 'Site application installed', 'Site application reconfigured', Site application uninstalled'
Site application package nameold_site_application_package_ namenew_site_application_package_ namerequired
Domain type (domain or subdomain)old_site_application_domain_typenew_site_application_domain_typerequired
Installation path (httpdocs or httpsdocs)old_site_application_directorynew_site_application_directoryrequired
Installation path within the destination directoryold_site_application_installation_ prefixnew_site_application_installation_ prefixrequired
For the events 'Site application package installed', 'Site application package uninstalled'
Site application package nameold_site_application_package_ namenew_site_application_package_ namerequired
For the events 'Service stopped, started, or restarted'
Serviceold_servicenew_servicerequired
For the events 'IP address created, changed, or deleted'
IP addressold_ip_addressnew_ip_addressrequired
IP maskold_ip_masknew_ip_mask 
Interfaceold_interfacenew_interface 
IP typeold_ip_typenew_ip_type 
For the events 'Forwarding created, changed, deleted'
Domain nameold_domain_namenew_domain_namerequired
Forwarding typeold_forwarding_typenew_forwarding_type 
URLold_urlnew_url 
For the event 'Administrator information changed'
Login nameold_login_namenew_login_namerequired
Contact nameold_contact_namenew_contact_name 
Company nameold_company_namenew_company_name 
Phone numberold_phonenew_phone 
Faxold_faxnew_fax 
E-mailold_emailnew_email 
Addressold_addressnew_address 
CItyold_citynew_city 
State/Provinceold_state_provincenew_state_province 
Postal/Zip codeold_postal_zip_codenew_postal_zip_code 
Countryold_countrynew_country 
For the events 'Site application installed, reconfigured, uninstalled'
Site application nameold_package_namenew_package_namerequired
For the events 'Client status updated'
Contact nameold_contact_namenew_contact_namerequired
Login nameold_login_namenew_login_namerequired
Statusold_statusnew_status 
For the events 'Client preferences updated'
Contact nameold_contact_namenew_contact_namerequired
Login nameold_login_namenew_login_namerequired
Page sizeold_lines_per_pagenew_lines_per_page 
Interface skinold_interface_skinnew_interface_skin 
For the event 'Client's IP pool changed'
Contact nameold_contact_namenew_contact_namerequired
IP addressold_ip_addressnew_ip_addressrequired
Statusold_statusnew_status 
For the event 'Limit on disk space reached for the client account'
Disk space limitold_maximum_disk_spacenew_maximum_disk_spacerequired
For the events 'Limit on traffic reached for the client account'
Traffic limitold_maximum_trafficnew_maximum_traffic 
For the events 'Domain status changed'
Domain nameold_domain_namenew_domain_namerequired
Domain statusold_statusnew_status 
For the event 'DNS zone updated for domain'
Domain nameold_domain_namenew_domain_namerequired
For the event 'Limit on disk space reached for domain'
Disk space limitold_maximum_disk_spacenew_maximum_disk_space 
For the event 'Limit on traffic reached for domain'
Traffic limitold_maximum_trafficnew_maximum_traffic 
For the event 'License key update'
License key numberold_licensenew_licenseRequired
License key type (Plesk, additional)old_license_typenew_license_type 
License key name (for additional keys)old_license_namenew_license_name 
 
< Prev   Next >
 
 

Web Hosting Australia | Hosting in the US | Domain Names | Domain Names Registration | Windows Servers | Dedicated Servers | Servers |Site Tutorials