Solved

PHP bandwidth monitor script

Posted on 2010-08-16
18
641 Views
Last Modified: 2013-12-07
Can somebody help me to write or find a php bandwidth monitor script?
It is not a homework and I want to make it on my website.
I have searched for days in Google.
I would like it to be like below:
Bandwidth:100MB/1000MB

Thanks very much!
0
Comment
Question by:mickey159
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 4
  • 2
  • +1
18 Comments
 
LVL 6

Accepted Solution

by:
mickey159 earned 0 total points
ID: 33451809
I am thinking of a way but I dont know whether it is good and simple.
Its about getting the file size of the page, every time the page is needed, add the file size to the database.
0
 
LVL 6

Author Comment

by:mickey159
ID: 33485437
I am reading...
so please wait for comments
Thank you!
0
 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

 
LVL 6

Author Comment

by:mickey159
ID: 33549161
A question:
How to use it?
Put it on top of the page?
And how to add the result to the database for log?
Also,is it useful for file download?
(setting the header to force download and use readfile()?)

Thanks!
0
 
LVL 26

Expert Comment

by:arober11
ID: 33625592
Have you considered Cacti: http://www.cacti.net/
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33628887
PHP cannot monitor bandwidth because you need something that is pcap enabled. PHP is not.

PHP is a scripting language not a full blown compileable programming language with access to the raw nic.

Use ntop.

If you are trying to monitor webserver bandwidth, however, you can do that by parsing the logs.
0
 
LVL 6

Author Comment

by:mickey159
ID: 33634272
I am quite busy these days and I may answer every 2 days.
How to install ntop?
Can it be easier?
I think I m using Cacti.

Thanks!
0
 
LVL 6

Author Comment

by:mickey159
ID: 33634286
Reading the docs, I don't think I can install Cacti.
It needs admin previllege to install PRDTool,right?
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33637110
Is this your server or shared / hosted? Do you have root privs?
0
 
LVL 6

Author Comment

by:mickey159
ID: 33645361
I plan to get it on hosted server.
I don't think I will have root privs.

Thank you!
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33652290
Then you can't do what you want to do. the closest you'll get is awstats from cPanel's built in monitor. You will have access (or should have access) to the awstats logs, which you can use PHP to parse.

That's as good as you're going to get.
0
 
LVL 6

Author Comment

by:mickey159
ID: 33652686
I of course know that.
Every panel has its bandwidth monitor.
But what I want to do is like the example picture.
Now I don't mind whether it is php or not,
I want to just record the bandwidth and add it to the database.
(It is not possible to ask the host provider to get the code, they just won't allow everything such as allow the use of some function or help you to install php plugins)

Thanks very much for all of your help!
example.bmp
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33654105
If you're running this on a hosted solution, the only thing you can do is parse the logs.

If you're running this on a dedicated box, you have more options.
0
 
LVL 6

Author Comment

by:mickey159
ID: 33660111
So how can I do it?
0
 
LVL 26

Expert Comment

by:arober11
ID: 33829188
Per post: http:#33625592  Cacti.
0
 
LVL 6

Author Comment

by:mickey159
ID: 33873487
Thanks but I will get it my way.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question