Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / nginx / nginx_byprojects / README.md @ df5325d2

Historique | Voir | Annoter | Télécharger (2,27 ko)

1 614c22df Danny Fullerton
# The 'byprojects' family
2 5271859f Danny Fullerton
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 614c22df Danny Fullerton
4
## munin_byprojects_access
5
Count the number of hits per projects/vhost.  
6
![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access")
7
8
## munin_byprojects_bandwidth
9 5271859f Danny Fullerton
Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.  
10 614c22df Danny Fullerton
![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth")
11
12
## munin_byprojects_inout_bandwidth
13 5271859f Danny Fullerton
Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.  
14 614c22df Danny Fullerton
![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth")
15
16
## Installation
17 5271859f Danny Fullerton
The setup is pretty straight forward. First you need to configure the plugin:
18 614c22df Danny Fullerton
19 5271859f Danny Fullerton
Define the file which will be used by logtail to identify it's position in the log and the path to logtail:
20 614c22df Danny Fullerton
21
      $statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
22
      $logtail = '/usr/local/bin/logtail';
23
24
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:
25
26 5271859f Danny Fullerton
      my %logs = (
27
        'prod' => [
28
                    {'path' => '/home/prod/log/access.log'}
29
                  ],
30
         'dev' => [
31
                    {'path' => '/var/log/httpd/ssl-dev-access.log'},
32
                    {'path' => '/home/dev/log/access.log'}
33
                  ],
34
        'test' => [
35
                    {'path' => '/var/log/access.log', 'regex' => '"[A-Z]+ /test/'},
36
                    {'path' => '/home/test/log/access.log'}
37
                  ],
38 614c22df Danny Fullerton
      );
39
40
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/).
41
42
Then link the file just as any other plugins.
43 5271859f Danny Fullerton
44
      ln -s /usr/local/sbin/<plugin> /usr/local/etc/munin/plugins/<plugin>