• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Event handler for subscription created

eworksmedia

New Pleskian
Which Event Handler gets fired when a subscription is created? I've tried both "Hosting settings created" and "Default domain (the first domain added to a subscription/webspace) created" but those don't seem to be firing when I create a new subscription. After creating the Event Handler the psa service was restarted each time. I have a script setup to just log the NEW_DOMAIN_NAME to a file, but that isn't happening.
 
I too am experiencing this very same problem. I need to run a script that automates a few things each time a new domain is created for a new subscription, but I can't seem to find the correct event trigger. I've tried a couple, including "Hosting settings created" and "Default domain (the first domain added to a subscription/webspace) created" to no avail.

Has anybody had any luck with this yet? Are there any log files I can look at to see if the event listener is even being triggered?

Cheers,
Pedro
 
This is how I solved it. Save a file like this:

Code:
class MYEventListener_EventListener implements EventListener {
	
	private static $domain_name = '';
	
	public function handleEvent($objectType, $objectId, $action, $oldValues, $newValues) { // called for all Plesk events
		if($action == 'phys_hosting_create'){ // subscription created
			self::$domain_name = $newValues['Domain Name'];
		}
	}
	
}

return new MYEventListener_EventListener();

To
Code:
/usr/local/psa/admin/plib/registry/EventListener/MYEventListener.php
 
Thanks for the quick reply. I eventually found the error. I was a stupid typo in the command field. One of those you read over and over and all is fine in your head, until another person reads it and spots the error... :(
 
Back
Top