Projet

Général

Profil

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

root / plugins / nginx / nginx_byprojects / README.md @ 614c22df

Historique | Voir | Annoter | Télécharger (1,94 ko)

1
# The 'byprojects' family
2
Those plugins are used to monitor different projects or vhost (i.e. either different log files or uing 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
Installation is pretty straight forward. First you need to configure the plugin:
18

    
19
Identify 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
      %logs = (
27
      'prod' => ('/home/prod/log/access.log'),
28
      'test' => (
29
                  ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
30
                  '/home/test/log/access.log'
31
                )
32
      );
33

    
34
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/).
35

    
36
Then link the file just as any other plugins.