fileactivity is a meter to measure the rate at which lines get appended
to a log file. When you see a lot of lines per minute on a particular file, it
is a good indicator of where your load problem is.
The thing shows hits per minute, 5 minutes and 15 minutes on a file. It
understands a few types of timestamp (apache, syslog and exim, IIRC), and does
an update every 15 minutes. The load average is printed out so you can compare
the pattern of usage to the load. That doesn't usually help.
Audience: Linux system administrators
Requires: Python
Optional: A terminal :)
Language: Python
Licence: GPL
Download
You can do stuff:- fileactivity - python script
Usage
Here's how the help looks:
root@somewebserver [~]# fileactivity --help
usage: Usage: fileactivity [<options>]
File activity monitor, with quasi-load printout
options:
-h, --help show this help message and exit
-m MMIN, --mmin=MMIN ignore files older than m minutes (10)
-n DISPLAY, --display=DISPLAY
display this many files
-s SLEEP, --sleep=SLEEP
Sleep interval between checks (10 seconds)
-c COUNT, --count=COUNT
Number of minutes to run for
-z, --zero Start with zero counters
-r REGEX, --re=REGEX Regexes to allow (default is any)
And this is what it looks like when it runs:
root@somewebserver [~]# fileactivity
359 of 3159 files opened
Reading simple averages ............
Hits per minute: moving average over 1, 5 and 15 minutes:
4.000 4.000 3.867 /usr/local/apache/domlogs/sghodf.org.za
0.000 4.000 1.333 /usr/local/apache/domlogs/hwgoidshfasf.co.za
24.000 4.800 2.867 /usr/local/apache/domlogs/oijgadsnia.com
3.000 4.800 4.000 /usr/local/apache/domlogs/hdgiuodga.co.za
0.000 5.200 6.200 /usr/local/apache/domlogs/desjasfogda.co.za
9.000 6.600 4.867 /usr/local/apache/domlogs/redahdgoaufg.za.com
0.000 8.200 6.133 /usr/local/apache/domlogs/n9dasf.co.za
0.000 14.400 23.133 /usr/local/apache/domlogs/rubasfds.co.za
8.000 14.800 5.467 /usr/local/apache/domlogs/psajdfl.co.za
22.000 37.600 20.333 /usr/local/apache/domlogs/map51.co.za
20:41:17 up 245 days, 13:01, 1 user, load average: 2.24, 2.90, 2.53
0.000 3.841 1.315 /usr/local/apache/domlogs/hwgoidshfasf.co.za
4.215 4.046 3.884 /usr/local/apache/domlogs/sghodf.org.za
2.449 4.609 3.946 /usr/local/apache/domlogs/hdgiuodga.co.za
19.631 4.611 2.829 /usr/local/apache/domlogs/oijgadsnia.com
0.000 4.991 6.116 /usr/local/apache/domlogs/desjasfogda.co.za
7.376 6.342 4.803 /usr/local/apache/domlogs/redahdgoaufg.za.com
0.000 7.886 6.054 /usr/local/apache/domlogs/n9dasf.co.za
0.000 13.835 22.827 /usr/local/apache/domlogs/rubasfds.co.za
7.526 14.444 5.464 /usr/local/apache/domlogs/psajdfl.co.za
19.967 36.572 20.207 /usr/local/apache/domlogs/map51.co.za
20:41:27 up 245 days, 13:01, 1 user, load average: 2.20, 2.87, 2.53
It prints out changes every 15 seconds.