root / plugins / apache / apache_byprojects / README.md @ 17f78427
Historique | Voir | Annoter | Télécharger (2,08 ko)
| 1 |
# The 'byprojects' family |
|---|---|
| 2 |
Those plugins are used to monitor different projects or vhost (i.e. either different log files or using regular expression as filters) on the same web server. |
| 3 |
|
| 4 |
## munin_byprojects_access |
| 5 |
Count the number of hits per projects/vhost. |
| 6 |
 |
| 7 |
|
| 8 |
## munin_byprojects_bandwidth |
| 9 |
Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. |
| 10 |
 |
| 11 |
|
| 12 |
## munin_byprojects_inout_bandwidth |
| 13 |
Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required. |
| 14 |
 |
| 15 |
|
| 16 |
## Installation |
| 17 |
The setup is pretty straight forward. First you need to configure the plugin: |
| 18 |
|
| 19 |
Define the path to logtail: |
| 20 |
|
| 21 |
$logtail = '/usr/local/bin/logtail'; |
| 22 |
|
| 23 |
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter: |
| 24 |
|
| 25 |
my %logs = ( |
| 26 |
'prod' => [ |
| 27 |
{'path' => '/home/prod/log/access.log'}
|
| 28 |
], |
| 29 |
'dev' => [ |
| 30 |
{'path' => '/var/log/httpd/ssl-dev-access.log'},
|
| 31 |
{'path' => '/home/dev/log/access.log'}
|
| 32 |
], |
| 33 |
'test' => [ |
| 34 |
{'path' => '/var/log/access.log', 'regex' => '"[A-Z]+ /test/'},
|
| 35 |
{'path' => '/home/test/log/access.log'}
|
| 36 |
], |
| 37 |
); |
| 38 |
|
| 39 |
In the previous example the prod project graph will be using everything in /home/prod/log/access.log. The test project will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in /var/log/httpd/access.log (e.g. "GET /test/). |
| 40 |
|
| 41 |
Then link the file just as any other plugins. |
| 42 |
|
| 43 |
ln -s /usr/local/sbin/<plugin> /usr/local/etc/munin/plugins/<plugin> |
