Web Hosting Talk







View Full Version : how to monitor bandwidth/transfer used by a user without a control panel?


cybotix
11-17-2002, 08:51 AM
on a freebsd system, apache2, qmail, proftpd.

is there something i need to install, or some special ways to configure the above programs?

if it's possible to monitor total bandwidth/transfer used by a user, not just limited to www/ftp/mail, that'd be great. thanks :)

PHBPendragon
11-17-2002, 10:22 AM
By ip, network card, port or domain ? How are you defining "user"

cybotix
11-17-2002, 10:42 AM
Originally posted by PHBPendragon
By ip, network card, port or domain ? How are you defining "user" i suppose by domain... but i want to be able to monitor bandwidth used by all unix users, say someone ssh in then wgets a file or something...

PHBPendragon
11-17-2002, 11:45 AM
Use ipa w/ ipfw and give each domain it's own IP.

cybotix
11-17-2002, 02:46 PM
Originally posted by PHBPendragon
Use ipa w/ ipfw and give each domain it's own IP. thx, but is there a way to do it without giving each domain an ip?

Goni
11-17-2002, 04:02 PM
Originally posted by cybotix
thx, but is there a way to do it without giving each domain an ip?

As far as the webserver, mailserver and FTP server is concerned it can be easily done by log files. Many of log file parsing software are lurking around. But specifically mentioned about monitoring the usage of Shell access. Its coming to my mind that I have seen a software which actually tells you how much of your user has transferred and what is doing. I can't recall it exactly but I think it was IPMON or something like this. Correct me if I am wrong.


Naseer

achost_ca
11-17-2002, 05:13 PM
IMO the best way is using log files to moniter for web, email, ftp etc, and simply not enabling SSH on a site unless they have a very good reason to need it.

Acronym BOY
11-17-2002, 06:36 PM
Have something like webalizer of AWStats go through the logs. It gives you totals.

Or something like RRDtool or MRTG.

Sonic Blue
11-18-2002, 04:28 AM
Interesting how there is no solid way lol. I've asked myself this same question and never been able to find something. I havent looked at RRDTool or AWStats but i found MRTG to be not very user friendly and their documentation less then user firendly or less then lacking.

UH-Matt
11-18-2002, 05:59 AM
I was looking for a solution to this before I got ensim up on our servers.

I found something called "peracctbw" or something that sounded like that - It was a long time ago - This was a package which worked out bandwidth from all the necessary log files, however the project wasnt maintained and i think the last release i found was 1998.

As far as i know you would need to get someone to code you some nice perl to grab the logs for ftp,email,www and do the maths to work out per user usage :)

Goni
11-18-2002, 09:18 AM
As far the log files are there, you can get anything out from it. I think wget or many other similiar programs generate log files. One can force the log files to be in some specific folder where root only can access and parse those log files after each session. But the question is, how will you limit the user to just use wget, lynx, links or something which generate log files?

rusko
11-18-2002, 09:38 AM
goni,

chroot shell =] i have one for all my clients.

Spingen
11-18-2002, 12:12 PM
didn't see it listed here but ipfm is a nice utilitity for monitoring bw

Goni
11-18-2002, 01:19 PM
Originally posted by Spingen
didn't see it listed here but ipfm is a nice utilitity for monitoring bw

As far as I've used and remember, it shows mainly the total system bandwidth usage or per device. It shows you any stats for per shell user usage? Off course all the users have the same IPs i-e no dedicated IP.

Starhost
11-18-2002, 01:30 PM
Maybe we should start a project together to write a script. That calculates bandwidth with atleast the bandwidth usage of Apache, Mail, FTP.

Goni
11-18-2002, 03:51 PM
Originally posted by Starhost
Maybe we should start a project together to write a script. That calculates bandwidth with atleast the bandwidth usage of Apache, Mail, FTP.

You don't have to do it for Apache, Mail, FTP etc .. as there are lots of tools lurking around like, webalizer, AWStats, mrtg etc..

As far as, shell bandwidth usage is concerned .. we can work on it together. BTW: would you like to intro?

Spingen
11-18-2002, 04:36 PM
if you want to write it you can count it with iptables :)
I just don't have the time nor need to do it, Can be done though, count it for every user

Starhost
11-18-2002, 05:47 PM
Then how do you do bandwidth monitoring by user???

compiled
06-09-2004, 10:43 PM
Nethogs does realtime statistics per shell user. It's actually a really great program.

Starhost
06-10-2004, 05:43 AM
Originally posted by compiled
Nethogs does realtime statistics per shell user. It's actually a really great program. Does it also do this for bandwidth usage from apache, exim (mail), ftp ???

compiled
06-12-2004, 03:31 PM
As long as it's a process being run by that user, it will pick it up in realtime.