Projet

Général

Profil

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

root / plugins / nginx / nginx_byprojects / README.md @ 17f78427

Historique | Voir | Annoter | Télécharger (2,17 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 17f78427 Lars Kruse
Count the number of hits per projects/vhost.
6 614c22df Danny Fullerton
![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access")
7
8
## munin_byprojects_bandwidth
9 17f78427 Lars Kruse
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 17f78427 Lars Kruse
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 17f78427 Lars Kruse
In your munin plugin configuration file (for example, a new dedicated /etc/munin/plugin-conf.d/nginx_byprojects), configure the plugins:
20 614c22df Danny Fullerton
21 3a17b22e Neraud
      [byprojects_*]
22
      env.logtail /usr/local/bin/logtail
23 614c22df Danny Fullerton
24 a1f7808b Neraud
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter.
25
Each log is defined in a dedicated environment variable, named env.site.[siteName]. The value is JSON formatted.
26
27
      env.site.prod 	[{"path":"/home/prod/log/access.log"}]
28
      env.site.dev		[{"path":"/var/log/httpd/ssl-dev-access.log"}, {"path":"/home/dev/log/access*.log"}]
29
      env.site.test 	[{"path":"/var/log/access.log","regex":"\"[A-Z]+ /test/"}, {"path":"/home/test/log/access.log"}]
30 614c22df Danny Fullerton
31
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/).
32
33
Then link the file just as any other plugins.
34 5271859f Danny Fullerton
35
      ln -s /usr/local/sbin/<plugin> /usr/local/etc/munin/plugins/<plugin>
36 cf03f9b0 Danny Fullerton
37 9ce70486 Neraud
And restart the munin-node service.
38 17f78427 Lars Kruse
39 cf03f9b0 Danny Fullerton
## License
40
MIT