root / plugins / nginx / nginx_byprojects / README.md @ 614c22df
Historique | Voir | Annoter | Télécharger (1,94 ko)
| 1 | 614c22df | Danny Fullerton | # 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 |  |
||
| 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 | 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. |
