Script to get cpanel access logs through email

efuzone

Well-Known Member
Mar 17, 2011
93
1
58
cPanel Access Level
Root Administrator
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.
 

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
How about this?
/usr/bin/grep 'SUCCESS' /usr/local/cpanel/logs/login_log | mail -s SUBJECTHERE EMAILHERE