• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Email notification when user logs in to Plesk

camthor

New Pleskian
Server operating system version
Debian 10.13
Plesk version and microupdate number
18.0.61_build1800240703.08
I want to set up notifications for any user login (including admin/root) to Plesk using this information: Question - Plesk email alert login

So I created an event "Plesk user logged in" with the command
Bash:
echo "username: ${NEW_CONTACT_NAME}" | mail -s "Plesk: User login" -r "[email protected]" [email protected]
. Priority lowest, user "root".

It works when I run this command with SSH, but no email arrives when I log out and log back in to Plesk. Do I have to enable events somewhere?
 
Hi there, did you use that command directly in the in the command field of the event? If so, I recommend creating a Bash script instead with that command and calling that script from the command field of the event instead.

There is a similar topic here that might help you troubleshoot.
 
Thank you! Indeed, it works now after I moved that line into a bash script and call that script in the event.
 
Hi, Is there any way to also put the IP address of the login to the mail body like:
Code:
echo "username: ${NEW_CONTACT_NAME}" | mail -s "User Login Plesk Panel" -b "$plesk db "SELECT login,ip_address FROM sessions;"" [email protected]
 
Back
Top