Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th March 2010, 12:05
Corvinus Corvinus is offline
Junior Member
 
Join Date: Mar 2010
Posts: 14
Thanks: 0
Thanked 4 Times in 3 Posts
Default ISP Config 3 Traffic Quota

One of my site costumers has gone over his designated traffic quota by a whole GiB. I set their limit to 1000MB, and WebTraffic shows 2199MB.

Nothing happens?

I can't find any settings on warnings or automatic site blocking when they surpass the allowed traffic?

Please advise.

Kind regards,
Jonny

Last edited by Corvinus; 29th March 2010 at 00:51.
Reply With Quote
Sponsored Links
  #2  
Old 26th March 2010, 15:25
Corvinus Corvinus is offline
Junior Member
 
Join Date: Mar 2010
Posts: 14
Thanks: 0
Thanked 4 Times in 3 Posts
Default

bump.

Gotta be some info on this matter? Are there no alert system or automatic blocking functions at all in ISP Config 3?
Reply With Quote
  #3  
Old 26th March 2010, 19:38
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,509
Thanks: 815
Thanked 5,269 Times in 4,130 Posts
Default

Update to ispconfig 3.0.2.1
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 26th March 2010, 20:11
Corvinus Corvinus is offline
Junior Member
 
Join Date: Mar 2010
Posts: 14
Thanks: 0
Thanked 4 Times in 3 Posts
Default

Update complete without any problems, I'll wait and see if this changes anything.

Thanks Till.
Reply With Quote
  #5  
Old 28th March 2010, 03:14
Corvinus Corvinus is offline
Junior Member
 
Join Date: Mar 2010
Posts: 14
Thanks: 0
Thanked 4 Times in 3 Posts
Default

I have run the newly updated version for 2 days now. Nothing seems to be disabling the site that is now at 2800mb which clearly is over the 1000mb limit.

Please advise as how to troubleshoot this properly.
Reply With Quote
  #6  
Old 28th March 2010, 22:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,509
Thanks: 815
Thanked 5,269 Times in 4,130 Posts
Default

You can use the code from the cron_daily.php scipt, especially the sql quieries that detect the quota to check what's wrong with your installation.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 29th March 2010, 00:44
Corvinus Corvinus is offline
Junior Member
 
Join Date: Mar 2010
Posts: 14
Thanks: 0
Thanked 4 Times in 3 Posts
Default

I have done as you asked and checked your script:
/usr/local/ispconfig/server/cron_daily.php

It seems it's your SQL query that's faulty. If you think it works properly, then you have missed this logical error.

You use this query to check for the month's traffic, which will return a row-set of dates:
PHP Code:
SELECT traffic_bytes FROM web_traffic WHERE traffic_date like '$current_month%' AND hostname '$domain' 
So when you run the below PHP code, you only retrieve the traffic from the first date of current month:
PHP Code:
$web_traffic $tmp['traffic_bytes']/1024/1024
Which should be cast to int by the way:
PHP Code:
$web_traffic = (int)$tmp['traffic_bytes']/1024/1024
It looks to me like you really meant to use an SQL statement like this instead to return all the month's bytes in 1 row. This will return all the month's traffic, and with the rest of your PHP code compare it correctly against the traffic_quota column from the table web_domain:
PHP Code:
SELECT SUM(traffic_bytes) As total_traffic_bytes FROM web_traffic WHERE traffic_date like '$current_month%' AND hostname '$domain' 
And change the $web_traffic code to:
PHP Code:
$web_traffic = (int)$tmp['total_traffic_bytes']/1024/1024
To put it simple, your script currently only locks a site if the first day of traffic for the current month is over the traffic quota that is supposed to be for the whole month. I have made these modifications to your script in my version of ISP Config, and it works properly now if I run: /usr/local/ispconfig/server/cron_daily.sh

Kind regards,
Jonny

Last edited by Corvinus; 29th March 2010 at 00:51.
Reply With Quote
The Following User Says Thank You to Corvinus For This Useful Post:
till (29th March 2010)
  #8  
Old 29th March 2010, 17:15
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,509
Thanks: 815
Thanked 5,269 Times in 4,130 Posts
 
Default

Yes, youre right. I must have mixed up the web traffic with the mail traffic table format. I've added this to the bugtracker.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
How to retrieve email? (Postfix / Courier) Merritt General 20 5th April 2009 14:26
Spamsnake - Problem with spamassassin, FuzzyOcr and MySQL debuguser HOWTO-Related Questions 6 16th September 2008 18:37
ISPConfig 2.2.14 released till General 48 19th July 2007 23:46
spamassasin/clamAV not working Daisy Installation/Configuration 32 15th February 2007 00:09


All times are GMT +2. The time now is 09:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.