• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved Event Manager - Plesk user logged in not firing

pleskuser67553

Basic Pleskian
Server operating system version
AlmaLinux 8.9
Plesk version and microupdate number
Plesk Obsidian 18.0.59 Update #2
Hello,

I have this set up identically on two of my servers, works on one but not the other:

1714726715342.png
Contents of /usr/local/psa/bin/event_plesk_user_logged_in.sh, where example is my email address.
Bash:
#!/bin/bash
mail -s "Plesk user logged in" [email protected] <<< "${NEW_CONTACT_NAME}"

Permissions are 755.

On the affected server, this script works when called from the terminal (without outputting the variable, obviously).

I have installed the Plesk Action Log extension and I can see CP User Login is being correctly recorded there.

I've also carried out a Plesk Diagnose & Repair and I've repaired the installation, to no avail.

It's my first time using Event Manager and this is the only event I've tried, but it's also the only event I want.

Both servers are the same OS, although the working one is 18.0.60 Update #1 (I can't see anything recently in the change log relating to event manager).

What else can I do please?
 
Open the Task Manager (in Tools & Settings) and look for a task with the description Event handler with ID '1' for event 'cp_user_login' (where the ID number can be different).

Whats the status of the task and if you open it and click on the bug icon, what's the output shown there?
 
Hi Kaspar, thanks for your response.

I don't know why I've not looked in Task Manager before. There is nothing in the bug icon and there are no failed Event handler with ID '1' for event 'cp_user_login' entries.

1714734558501.png
 
The task shows that the cp_user_login event has fired successfully. So most likely there is something not quite working with your script. Look at the maillog to see if there is anything related logged there.

You can also use the other icons (with up and down arrows) next to the bug icon to see if there some more information on the event call.
 
There is no output in STDIN STDOUT or STDERR.

I can run the script from the terminal with /usr/local/psa/bin/event_plesk_user_logged_in.sh and it sends me an email.

I have the identical script on a second server and it sends me an email in both scenarios (execution in terminal and on event trigger at login).

On the affected server, the Mail tab in Log Browser shows the mail sent to me when the script was executed in the console (Postfix), but it looks like my login event did trigger plesk-sendmail, but it stops at stderr: PASS

Sendmail is enabled in Mail server-wide settings, and I have websites that are using it without issue in the logs.

1714736118394.png


Here is what happens on the unaffected server:

1714736418866.png
 
So it's a simple outgoing mail issue. Is the outgoing mail limit sufficient for the mailbox, domain and subscription? Is the outgoing mail port open, e.g. can other mail be sent through it? Are sender and recipient address formatted correctly? Only two entries in the maillog seem to be too little. There should be more, maybe just not identified by the same ID. Is the outgoing mail stuck in the mail queue? What's the source code of it saying in the outgoing mail queue?
 
So it's a simple outgoing mail issue. Is the outgoing mail limit sufficient for the mailbox, domain and subscription? Is the outgoing mail port open, e.g. can other mail be sent through it? Are sender and recipient address formatted correctly? Only two entries in the maillog seem to be too little. There should be more, maybe just not identified by the same ID. Is the outgoing mail stuck in the mail queue? What's the source code of it saying in the outgoing mail queue?
This started working after the server automatically updated to Version 18.0.60 Update #1, so I guess something got restarted? Otherwise, yes, all other outgoing email functions were working for my other purposes. And I checked the queue each time, nothing stuck there.
 
Back
Top