• 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.

Question Global Event Parameters for Event Handlers

pleskuser67553

Basic Pleskian
Server operating system version
AlmaLinux 8.10
Plesk version and microupdate number
18.0.63 Update #4
Hello,

I have read this Event Parameters Passed by Event Handlers but I'd like to be able to pass the IP address that triggered the Event. Are there any global parameters that are always passed by Event Handlers? If so, what are they or how would I discover them?

For additional context, it's for a simple script I have to notify when a user is logged in but I want to know the IP address too please Resolved - Event Manager - Plesk user logged in not firing The IP address is revealed in Tools & Settings > Log Browser > Action Log, so I would hope it can be accessed by the Event Handler too.
 
I don't think the login IP address isn't available as a environment variable for this particular event. (Would be nice if it was). If you want to be sure you can dump all available environment variables into a file with a script like this:
Bash:
#!/usr/bin/env bash

env > /tmp/params # Or any other location

Unfortunately the "Plesk user logged in" event probably isn't of much use for your particular use case. The data shown in the Action Log is stored in the PSA database log_actions table. Sadly it's difficult to fetch any additional data based on the event paramater (contact name). What you could consider doing however, is to query the database table and just return the most resent logged cp_user_login action.

I am not sure if that actually does gets you the data you need. Because the event might get triggered before the login data gets stored to the action log (so you might end up with data from an previous login action). But this might be worth testing. It's the only thing I can think off that comes close to what you're trying to accomplish.

Hope this helps.
 
Back
Top