burnley
Regular Pleskian
CentOS 7, Plesk 12.5.30 Update #51, last updated at Oct 25, 2016 12:40 PM
It appears that I don't have access to the NEW_DOMAIN_NAME and OLD_DOMAIN_NAME when using the Plesk event handlers for domain alias. Neither of the 6 handlers available for domain alias events, documented in https://docs.plesk.com/en-US/12.5/a...nt-parameters-passed-by-event-handlers.67897/, expose NEW_DOMAIN_NAME or OLD_DOMAIN_NAME. Here are 2 examples for "add" and "delete" actions, where from the handler script I'm logging the entire environment as exported by Plesk:
1. Add:
2016-10-31 08:45:07.682642 [domainmgr.py[16435]] - [Debug] Environment variables: {'NEW_DOMAIN_ALIAS_NAME': 'aditesting1-alias1.local', 'NEW_STATUS': '0', 'USER': 'psaadm', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/usr/local/psa/admin', 'NEW_CLIENT_GUID': 'edaed7e4-33d8-4e67-95ec-1211df3d2cd6', 'SHLVL': '1', 'NEW_DOMAIN_ID': '190', 'NEW_MAIL': 'true', 'OLD_DOMAIN_ID': '', 'OLD_DNS': '', '_': '/usr/local/psa/admin/bin/event_handler', 'OLD_STATUS': '', 'OLD_TOMCAT': '', 'OLD_MAIL': '', 'NEW_DOMAIN_GUID': '11357153-292f-4c9b-9fd2-63a1b9e44cf0', 'OLD_DOMAIN_GUID': '', 'OLD_DOMAIN_ALIAS_NAME': '', 'NEW_TOMCAT': 'false', 'NEW_DNS': 'true', 'PLESK_INTERNAL_PHP_EXEC': '', 'PWD': '/usr/local/psa/admin/htdocs', 'OLD_CLIENT_GUID': '', 'NEW_WEB': 'true', 'OLD_WEB': ''}
2. Delete:
2016-10-31 08:50:23.725397 [domainmgr.py[16930]] - [Debug] Environment variables: {'USER': 'psaadm', 'OLD_LOGIN_NAME': 'aditesting', 'NEW_LOGIN_NAME': '', 'NEW_STATUS': '', 'NEW_DNS': '', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/usr/local/psa/admin', 'NEW_CLIENT_GUID': '', 'SHLVL': '1', 'NEW_DOMAIN_ID': '', 'NEW_MAIL': '', 'OLD_DOMAIN_ID': '190', 'OLD_DNS': 'true', '_': '/usr/local/psa/admin/bin/event_handler', 'OLD_STATUS': '0', 'OLD_TOMCAT': 'false', 'OLD_MAIL': 'true', 'NEW_DOMAIN_GUID': '', 'OLD_DOMAIN_GUID': '11357153-292f-4c9b-9fd2-63a1b9e44cf0', 'OLD_DOMAIN_ALIAS_NAME': 'aditesting1-alias1.local', 'NEW_TOMCAT': '', 'NEW_DOMAIN_ALIAS_NAME': '', 'PWD': '/usr/local/psa/admin/htdocs', 'OLD_CLIENT_GUID': 'edaed7e4-33d8-4e67-95ec-1211df3d2cd6', 'NEW_WEB': '', 'OLD_WEB': 'true'}
As a workaround, I can pull the domain name from psa.domains using NEW_DOMAIN_ID and OLD_DOMAIN_ID, but I'd rather have Plesk do the right thing.
It appears that I don't have access to the NEW_DOMAIN_NAME and OLD_DOMAIN_NAME when using the Plesk event handlers for domain alias. Neither of the 6 handlers available for domain alias events, documented in https://docs.plesk.com/en-US/12.5/a...nt-parameters-passed-by-event-handlers.67897/, expose NEW_DOMAIN_NAME or OLD_DOMAIN_NAME. Here are 2 examples for "add" and "delete" actions, where from the handler script I'm logging the entire environment as exported by Plesk:
1. Add:
2016-10-31 08:45:07.682642 [domainmgr.py[16435]] - [Debug] Environment variables: {'NEW_DOMAIN_ALIAS_NAME': 'aditesting1-alias1.local', 'NEW_STATUS': '0', 'USER': 'psaadm', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/usr/local/psa/admin', 'NEW_CLIENT_GUID': 'edaed7e4-33d8-4e67-95ec-1211df3d2cd6', 'SHLVL': '1', 'NEW_DOMAIN_ID': '190', 'NEW_MAIL': 'true', 'OLD_DOMAIN_ID': '', 'OLD_DNS': '', '_': '/usr/local/psa/admin/bin/event_handler', 'OLD_STATUS': '', 'OLD_TOMCAT': '', 'OLD_MAIL': '', 'NEW_DOMAIN_GUID': '11357153-292f-4c9b-9fd2-63a1b9e44cf0', 'OLD_DOMAIN_GUID': '', 'OLD_DOMAIN_ALIAS_NAME': '', 'NEW_TOMCAT': 'false', 'NEW_DNS': 'true', 'PLESK_INTERNAL_PHP_EXEC': '', 'PWD': '/usr/local/psa/admin/htdocs', 'OLD_CLIENT_GUID': '', 'NEW_WEB': 'true', 'OLD_WEB': ''}
2. Delete:
2016-10-31 08:50:23.725397 [domainmgr.py[16930]] - [Debug] Environment variables: {'USER': 'psaadm', 'OLD_LOGIN_NAME': 'aditesting', 'NEW_LOGIN_NAME': '', 'NEW_STATUS': '', 'NEW_DNS': '', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/usr/local/psa/admin', 'NEW_CLIENT_GUID': '', 'SHLVL': '1', 'NEW_DOMAIN_ID': '', 'NEW_MAIL': '', 'OLD_DOMAIN_ID': '190', 'OLD_DNS': 'true', '_': '/usr/local/psa/admin/bin/event_handler', 'OLD_STATUS': '0', 'OLD_TOMCAT': 'false', 'OLD_MAIL': 'true', 'NEW_DOMAIN_GUID': '', 'OLD_DOMAIN_GUID': '11357153-292f-4c9b-9fd2-63a1b9e44cf0', 'OLD_DOMAIN_ALIAS_NAME': 'aditesting1-alias1.local', 'NEW_TOMCAT': '', 'NEW_DOMAIN_ALIAS_NAME': '', 'PWD': '/usr/local/psa/admin/htdocs', 'OLD_CLIENT_GUID': 'edaed7e4-33d8-4e67-95ec-1211df3d2cd6', 'NEW_WEB': '', 'OLD_WEB': 'true'}
As a workaround, I can pull the domain name from psa.domains using NEW_DOMAIN_ID and OLD_DOMAIN_ID, but I'd rather have Plesk do the right thing.