Script to get cpanel access logs through email
Hello,
I hope you are doing well. I would like to request you that if you know solution of my concern. I shall be thankful to you.
When I run this command through CLI "grep 'SUCCESS' /usr/local/cpanel/logs/login_log | tail -n 100" I get all successfully logins of cPanel and webmail.
This way i get to know who has logged through which IP. But how it is possible to create a script and add it to cron. So every 30 minutes this command run auto and i get logs through email.
Is there any possibility? Or any other way to get logs through email for cpanel, webmail logins.
Please help.
I am using CSF firewall, Immunify360 and I have made LF_CPANEL_ALERT to all. But it is sending only cpanel alert. I want logs like this command shows.
-
If you're running it as a cron, just set the MAILTO in the crontab to email you the results. 0 -
How about this? /usr/bin/grep 'SUCCESS' /usr/local/cpanel/logs/login_log | mail -s SUBJECTHERE EMAILHERE 0
Please sign in to leave a comment.
Comments
2 comments