I've just gotten into VPS hosting, and I am trying to come up with an automated way of notifying myself if one of the accounts on the CentOS/Apache/cPanel/WHM server experiences a spike in bandwidth from a DOS or DDOS attack that might put them over their monthly bandwidth limit.
Ideally, I'd have an automated system for handling the problem, but if nothing else, I'd like to get an email notice that it's happening so I could do something about it.
I ran across mod_throttle in my search for something that would accomplish this, and checked with my managed hosting service, but they told me "mod_throttle is currently unavailable."
Is there another way to accomplish this kind of monitoring and attack prevention?
Check out vnstat. Basically it has a cron job which will notify you if an interface goes over a certain amount of Bandwidth. I'm sure you could easily integrate it into a simple bash script and notify you.
Basically create some kind of database or simple file and have the script compare current usage against normal usage.
█ Inode Hosting - Reliable Web Hosting for the right price.
█ Shared & Reseller hosting featuring the industry leading cpanel
█ 99.9% Uptime Guarantee ,30 Day Money Back Guarantee ,24/7 Support
█ Established since 2011