Projet

Général

Profil

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

root / plugins / nginx / nginx_byprojects @ c40eabee

Nom Taille Révision Âge Auteur Commentaire
LICENSE.txt 1,06 ko cf03f9b0 presque 12 ans Danny Fullerton Add file expansion (glob) and switch to MIT lic...
README.md 2,3 ko cf03f9b0 presque 12 ans Danny Fullerton Add file expansion (glob) and switch to MIT lic...
byprojects_access 2,77 ko cf03f9b0 presque 12 ans Danny Fullerton Add file expansion (glob) and switch to MIT lic...
byprojects_bandwidth 3,17 ko 7afe6bfb environ 11 ans Stig Sandbeck Mathisen Fix syntax error
byprojects_inout_bandwidth 3,41 ko de4ba4b5 environ 11 ans Stig Sandbeck Mathisen Fix syntax error

Dernières révisions

# Date Auteur Commentaire
7afe6bfb 2014-10-04 13:48 Stig Sandbeck Mathisen

Fix syntax error

de4ba4b5 2014-10-04 13:45 Stig Sandbeck Mathisen

Fix syntax error

cf03f9b0 2013-12-03 21:23 Danny Fullerton

Add file expansion (glob) and switch to MIT license

5271859f 2012-12-12 22:56 Danny Fullerton

Switch to strict mode.
Fix hash/array syntax causing regex-based log to fail.

614c22df 2012-04-17 17:49 Danny Fullerton

Add ithe byprojects family (vhost AND regex monitoring) to apache and nginx.

Voir les révisions

README


The 'byprojects' family

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.

muninbyprojectsaccess

Count the number of hits per projects/vhost.
byproject_access

muninbyprojectsbandwidth

Count the total bandwidth used by each projects/vhost. Logtail is required.
byproject_bandwidth

muninbyprojectsinout_bandwidth

Counts the in/out bandwidth used by each projects/vhost. Logtail is required.
byproject_inout_bandwidth

Installation

The setup is pretty straight forward. First you need to configure the plugin:

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

  $statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
  $logtail = '/usr/local/bin/logtail';

Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:

  my %logs = (
    'prod' => [
                {'path' => '/home/prod/log/access.log'}
              ],
     'dev' => [
                {'path' => '/var/log/httpd/ssl-dev-access.log'},
                {'path' => '/home/dev/log/access*.log'} # glob is supported
              ],
    'test' => [
                {'path' => '/var/log/access.log', 'regex' => '"[A-Z]+ /test/'},
                {'path' => '/home/test/log/access.log'}
              ],
  );

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

Then link the file just as any other plugins.

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

License

MIT

Formats disponibles : Atom