Current time: 04-23-2024, 11:23 PM Hello There, Guest! (LoginRegister)


Post Reply 
PHP based Disk and Traffic report
Author Message
crafter Offline
Junior Member
*

Posts: 10
Joined: Sep 2009
Reputation: 0
Post: #1
PHP based Disk and Traffic report
The attached PHP script sends users and resellers information about the traffic and disk usage for their registered domains.

The script is normally meant to run once a day. Each domain is queried and the current resource usage is calculated against the allocated limits.

If the resource limit is exceeded, then the domain contact is sent an email, alerting them to the resource usage.

In addition, reseller accounts are sent a daily email that provides the resource usage for each administered domain, and a total against the resource limits allocated to the reseller.

Usage Notes
The tool is intended to run from the command line as a PHP script.

An example of this is :
Quote:php /var/www/ispcp/engine/tools/usage_reports.php

You can guess that I installed the script in var/www/ispcp/engine/tools/usage_reports.php

As an example, to run the script at midnight, add the following line to the file
/etc/cron.d/daily/ispcp
Quote:# resource usage - send email to customer - added by Pradesh - 2009/11/07
@daily root php /var/www/ispcp/engine/tools/usage_reports.php &>/var/log/ispcp/usage_reports.log



Attached File(s)
.php  usage_reports.php (Size: 14.45 KB / Downloads: 57)
(This post was last modified: 04-13-2010 06:55 AM by crafter.)
04-13-2010 06:32 AM
Find all posts by this user Quote this message in a reply
idento Offline


Posts: 1
Joined: Jul 2010
Reputation: 0
Post: #2
RE: PHP based Disk and Traffic report
Hi i have this error:


Parse error: syntax error, unexpected $end in /var/www/ispcp/engine/tools/usage_reports.php on line 344
(This post was last modified: 11-10-2010 08:27 PM by idento.)
11-10-2010 08:26 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)