• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Event Parameters are empty

anasafi

New Pleskian
Server operating system version
CentOS Linux 7
Plesk version and microupdate number
18.0.41
I created an Event Handler for "SSL/TLS certificate on domain assigned/unassigned" event in Plesk Settings. However, the specified in the documentation Event Parameters (Event Parameters Passed by Event Handlers) are mostly empty with the exception of DOMAIN_ID and DOMAIN_NAME (new and old).

I'm passing the parameters in <> and then just trying to print them out:

Bash:
/root/ssl-copy-xmpp.sh <NEW_SSL_BINDING_TYPE> <NEW_DOMAIN_ID> <NEW_DOMAIN_NAME> <NEW_CERTIFICATE_ID> <NEW_CERTIFICATE_NAME> <NEW_CERTIFICATE_FILE> <OLD_CERTIFICATE_FILE>


cat /root/ssl-copy-xmpp.sh
#!/bin/bash
echo $1 >> /tmp/ssl-copy-xmpp.log
echo $2 >> /tmp/ssl-copy-xmpp.log
echo $3 >> /tmp/ssl-copy-xmpp.log
echo $4 >> /tmp/ssl-copy-xmpp.log
echo $5 >> /tmp/ssl-copy-xmpp.log
echo $6 >> /tmp/ssl-copy-xmpp.log
echo $7 >> /tmp/ssl-copy-xmpp.log


To test this, I reissue a Letsencrypt certificate through admin panel.


Result:
Code:
""
1
domain.com
""
""
""
""


Meanwhile, all those parameters seem to be available if I check Plesk action log. Is there something I'm doing wrong?
 
Seems like the documentation is a bit outdated in this regard. Here are the environment variables that are actually set up for this event handler by the underlying mechanism:
Code:
NEW_SSL_CERTIFICATE_BINDING_TYPE=WEB
OLD_SSL_CERTIFICATE_BINDING_TYPE=WEB
OLD_DOMAIN_NAME=example.com
NEW_DOMAIN_NAME=example.com
OLD_DOMAIN_ID=30
NEW_DOMAIN_ID=30
OLD_DOMAIN_GUID=41cdaa53-526e-427f-b41a-0f2af698b2dc
NEW_DOMAIN_GUID=41cdaa53-526e-427f-b41a-0f2af698b2dc
OLD_SSL_CERTIFICATE_FILE=scf7WELFT
NEW_SSL_CERTIFICATE_FILE=scf7WELFT
OLD_SSL_CERTIFICATE_NAME=Lets Encrypt example.com
NEW_SSL_CERTIFICATE_NAME=Lets Encrypt example.com
OLD_SSL_CERTIFICATE_ID=62
NEW_SSL_CERTIFICATE_ID=62
OLD_CLIENT_GUID=dffa724f-1719-458e-b10f-8e65b4403800
NEW_CLIENT_GUID=dffa724f-1719-458e-b10f-8e65b4403800

By the way, you can reference them directly in script instead of assigning them to positional parameters:
Bash:
#!/usr/bin/env bash

act_in_some_way "${NEW_DOMAIN_NAME}" "${NEW_SSL_CERTIFICATE_FILE}"

Anyway, I've sent info on this discrepancy to the Documentation Team, can't promise when it'll be fixed. As a W/A you can try dumping envvars into a file, like this:
Bash:
#!/usr/bin/env bash

env > /tmp/params # Or any other location

That will allow you to find out what actual parameters are passed to the script.
 
Back
Top