[SCRIPT] Generate report and notify users about INACTIVE and OVERQUOTA mail accounts

unihostbrasil

Verified User
Joined
Nov 23, 2009
Messages
128
Location
São Paulo - Brazil
We created two bash scripts to notify server admin and DA users on INACTIVE and OVERQUOTA POP accounts.

It helps a lot to reduce disk usage and support requests due to overquota POP accounts not receiving new messages.
It also helps users to remember of forgotten POP accounts.

We implemented these scripts to several servers some time ago with success, and after a few enhancements and fixes we make it public for free.

They also passed through the John (from DirectAdmin) review's, who kindly suggested some improvements that have been implemented.

Features:

  • Can be run via server terminal to just display the report
  • Send the report to the server admin
  • Send an alert to each Directadmin user e-mail with an inactive or overquota pop account
  • Configurable alert thresholds
  • Configurable alert mail template
  • Run at low server priority (w/ nice)

Screenshots from the reports at terminal:

inactivity.gif
usage.gif

Complete info, usage and download here:
https://github.com/vbenincasa/DirectAdmin-pop-alerts

* It's important to keep the DA users emails updated as the alerts are sent to them (Users details page from admin or reseller level)
* It's important to setup the scripts to include at least your sender name/mail and admin to receive the report.


Hope that helps everyone. All suggestions are welcome.
 
For statistical purposes, you can post the stats generated on your script run.
Here is our:

$ ./alert-pop-usage.sh --display
STATS:
-> Overquota accounts: 31 of 3236 analyzed
-> Script running time: 23s

$ ./alert-pop-inactivity.sh --display
STATS:
-> Inactive accounts: 23 of 3236 analyzed
-> Total wasted space: 1216MB
-> Script running time: 18s

We do not have statistics on how much space was saved since we implemented the alerts, but helped a lot.
 
Look pretty nice, i'll test it soon.

But, i've a question: there is a way to set --email and only notify admin without contact users directly?

Regards and thanks
 
Well i suppose it should be since may be useful also just for admin to have a usage report instead considering those info as possible problems :)

Regards
 
Back
Top