diff --git a/plugins/nginx/nginx_byprojects/README.md b/plugins/nginx/nginx_byprojects/README.md index d2b59505..f095a9b7 100644 --- a/plugins/nginx/nginx_byprojects/README.md +++ b/plugins/nginx/nginx_byprojects/README.md @@ -16,9 +16,10 @@ Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www. ## Installation The setup is pretty straight forward. First you need to configure the plugin: -Define the path to logtail: +In your munin plugin configuration file (for example, a new dedicated /etc/munin/plugin-conf.d/nginx_byprojects), configure the plugins : - $logtail = '/usr/local/bin/logtail'; + [byprojects_*] + env.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: diff --git a/plugins/nginx/nginx_byprojects/byprojects_access b/plugins/nginx/nginx_byprojects/byprojects_access index 81d755dd..496a0137 100644 --- a/plugins/nginx/nginx_byprojects/byprojects_access +++ b/plugins/nginx/nginx_byprojects/byprojects_access @@ -23,11 +23,15 @@ use strict; # Test graph will be using everything file matching /home/test/log/access*.log # and stuff that match the expression '"[A-Z] /test/' in /var/log/access.log # such as '"GET /test/' +# +# Configuration +# [byprojects_*] +# env.logtail_path /usr/local/bin/logtail my $server = 'Nginx'; my $statepath = $ENV{MUNIN_PLUGSTATE}; -my $logtail = '/usr/local/bin/logtail'; +my $logtail = $ENV{logtail_path} || '/usr/local/bin/logtail'; my %logs = ( 'prod' => [ diff --git a/plugins/nginx/nginx_byprojects/byprojects_bandwidth b/plugins/nginx/nginx_byprojects/byprojects_bandwidth index 1ccce21a..7e6d796b 100644 --- a/plugins/nginx/nginx_byprojects/byprojects_bandwidth +++ b/plugins/nginx/nginx_byprojects/byprojects_bandwidth @@ -29,11 +29,15 @@ use strict; # Test graph will be using everything file matching /home/test/log/access*.log # and stuff that match the expression '"[A-Z] /test/' in /var/log/access.log # such as '"GET /test/' +# +# Configuration +# [byprojects_*] +# env.logtail_path /usr/local/bin/logtail my $server = 'Nginx'; my $statepath = $ENV{MUNIN_PLUGSTATE}; -my $logtail = '/usr/local/bin/logtail'; +my $logtail = $ENV{logtail_path} || '/usr/local/bin/logtail'; my %logs = ( 'prod' => [ diff --git a/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth b/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth index 8f02826b..55358b47 100644 --- a/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth +++ b/plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth @@ -29,11 +29,15 @@ use strict; # Test graph will be using everything file matching /home/test/log/access*.log # and stuff that match the expression '"[A-Z] /test/' in /var/log/access.log # such as '"GET /test/' +# +# Configuration +# [byprojects_*] +# env.logtail_path /usr/local/bin/logtail my $server = 'Nginx'; my $statepath = $ENV{MUNIN_PLUGSTATE}; -my $logtail = '/usr/local/bin/logtail'; +my $logtail = $ENV{logtail_path} || '/usr/local/bin/logtail'; my %logs = ( 'prod' => [