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
# 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
![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access")
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
![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth")
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
![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth")
15

    
16
## Installation
17
The setup is pretty straight forward. First you need to configure the plugin:
18

    
19
Define the file which will be used by logtail to identify it's position in the log and the path to logtail:
20

    
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
      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
      );
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

    
44
      ln -s /usr/local/sbin/<plugin> /usr/local/etc/munin/plugins/<plugin>