Log files

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Log files

Post by alex.barylski »

I've asked this just recently, but I believe this to be slightly more specific.

I would like to know (how to enable) log files for the following:
1) CPU/RAM usage
2) Bandwidth usage

Obviously the latter is specific to Apache, but I cannot find any logs which indicate bandwidth usage? How (or are there) applications which allow you to setup domain's on a dedicate server and restrict their bandwidth/HDD space (including their mysql, etc)???

Logging CPU on a per web site basis isn't really nessecary (although if PHP has logging which I could use to narrow down which site was highest) that would be killer. :P

Basically I need a way to monitor who is doing what and how much they are consuming on a per web site basis.

Edit: I'm looking into access_log for Apache and it looks very promising. :) However I wonder if there is a way add COOKIE data to that request log? Relying on IP alone isn't the greatest for determining unique hits. Anyone know of a way or think of a workaround?

Cheers :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Badwidth usage:

MRTG (web application)
iptraf (command line tool)

CPU/RAM:

I'm not aware of anything but you could script it yourself easily. Refer to the files at /proc/cpuinfo and /proc/meminfo. These are just text files which give you realtime figures for CPU and RAM usage. There are other tools such as "free", "top" and "uptime" but if you're scripting your own I'd look in /proc for sure :) If you have acpi enabled look at various files in /proc/acpi too (again, just plain text files).
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Cool, thanks man. :)
Post Reply